public class PeerComponent extends Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR| Modifier | Constructor and Description |
|---|---|
protected |
PeerComponent(Object nativePeer)
This constructor is used by the platform implementation to create instances
of this class use the static create method.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected Dimension |
calcScrollSize()
Method that can be overriden to represent the actual size of the component
when it differs from the desireable size for the viewport
|
static PeerComponent |
create(Object nativePeer)
Use this method to encapsulate a native UI object
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
protected void |
fireClicked()
When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method
in order to allow 3 button devices to work properly.
|
protected void |
focusGained()
Callback allowing a developer to track wheh the component gains focus
|
protected void |
focusLost()
Callback allowing a developer to track wheh the component loses focus
|
protected Image |
generatePeerImage()
The native implementation should implement this method to generate a native peer
image representing the component
|
Object |
getNativePeer()
Returns the native peer instance
|
protected Image |
getPeerImage()
The peer image is drawn when the component doesn't exist or during transition
a placeholder image can be placed in the beginning to show something while
the peer is being created asynchronously.
|
boolean |
handlesInput()
Prevents key events from being grabbed for focus traversal.
|
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
void |
invalidate()
Updates the size of the component from the native widget
|
void |
keyPressed(int keyCode)
If this Component is focused, the key pressed event
will call this method
|
void |
keyReleased(int keyCode)
If this Component is focused, the key released event
will call this method
|
void |
keyRepeated(int keyCode)
If this Component is focused, the key repeat event
will call this method.
|
protected void |
onPositionSizeChange()
Callback useful for sublclasses that need to track the change in size/position
of the component (notice that this might be invoked too many times for a single change)!
|
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
|
protected void |
paintBackground(Graphics g)
This method paints the Component background, it should be overriden
by subclasses to perform custom background drawing.
|
void |
paintBackgrounds(Graphics g)
This method paints all the parents Components Background.
|
protected void |
paintBorder(Graphics g)
Draws the component border if such a border exists.
|
protected void |
paintScrollbars(Graphics g)
Paints the UI for the scrollbars on the component, this will be invoked only
for scrollable components.
|
protected void |
paintScrollbarX(Graphics g)
Paints the UI for the scrollbar on the X axis, this method allows component
subclasses to customize the look of a scrollbar
|
protected void |
paintScrollbarY(Graphics g)
Paints the UI for the scrollbar on the Y axis, this method allows component
subclasses to customize the look of a scrollbar
|
void |
pointerDragged(int[] x,
int[] y)
If this Component is focused, the pointer dragged event
will call this method
|
void |
pointerDragged(int x,
int y)
If this Component is focused, the pointer dragged event
will call this method
|
void |
pointerHover(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerHoverReleased(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerPressed(int[] x,
int[] y)
If this Component is focused, the pointer pressed event
will call this method
|
void |
pointerPressed(int x,
int y)
If this Component is focused, the pointer pressed event
will call this method
|
void |
pointerReleased(int[] x,
int[] y)
If this Component is focused, the pointer released event
will call this method
|
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event
will call this method
|
protected void |
setLightweightMode(boolean l)
An optional callback for peers indicating that the peer is now rendered as part of
a transition or some other state and is thus not truly visible.
|
protected void |
setPeerImage(Image i)
The peer image is drawn when the component doesn't exist or during transition
a placeholder image can be placed in the beginning to show something while
the peer is being created asynchronously.
|
protected boolean |
shouldRenderPeerImage()
Subclasses should return true here if the peer image should be rendered instead of the actual peer
|
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, bindProperty, blocksSideSwipe, cancelRepaints, clearClientProperties, contains, containsOrOwns, createStyleAnimation, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, getAbsoluteX, getAbsoluteY, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBottomGap, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getGridPosX, getGridPosY, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initCustomStyle, initDisabledStyle, initLaf, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSelectableInteraction, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintShadows, paramString, parsePreferredSize, pinch, pinch, pinchReleased, pointerHoverPressed, putClientProperty, refreshTheme, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContainsprotected PeerComponent(Object nativePeer)
nativePeer - the native platform specific peer component.protected Image getPeerImage()
protected Image generatePeerImage()
protected void setPeerImage(Image i)
i - the peer imageprotected boolean shouldRenderPeerImage()
public static PeerComponent create(Object nativePeer)
nativePeer - the native platform specific peer component.public Object getNativePeer()
public boolean animate()
Display class.protected Dimension calcPreferredSize()
calcPreferredSize in class Componentprotected Dimension calcScrollSize()
calcScrollSize in class Componentprotected void deinitialize()
deinitialize in class Componentprotected void fireClicked()
fireClicked in class Componentprotected void focusGained()
focusGained in class Componentprotected void focusLost()
public boolean handlesInput()
handlesInput in class Componentprotected void initComponent()
initComponent in class Componentpublic void keyPressed(int keyCode)
keyPressed in class ComponentkeyCode - the key code value to indicate a physical key.public void keyReleased(int keyCode)
keyReleased in class ComponentkeyCode - the key code value to indicate a physical key.public void keyRepeated(int keyCode)
keyRepeated in class ComponentkeyCode - the key code value to indicate a physical key.public void paint(Graphics g)
protected void paintBackground(Graphics g)
paintBackground in class Componentg - the component graphicspublic void paintBackgrounds(Graphics g)
paintBackgrounds in class Componentg - the graphics objectprotected void paintBorder(Graphics g)
paintBorder in class Componentg - graphics context on which the border is paintedprotected void paintScrollbarX(Graphics g)
paintScrollbarX in class Componentg - the component graphicsprotected void paintScrollbarY(Graphics g)
paintScrollbarY in class Componentg - the component graphicsprotected void paintScrollbars(Graphics g)
paintScrollbars in class Componentg - the component graphicspublic void pointerDragged(int[] x,
int[] y)
pointerDragged in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerDragged(int x,
int y)
pointerDragged in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerHover(int[] x,
int[] y)
pointerHover in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerHoverReleased(int[] x,
int[] y)
pointerHoverReleased in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerPressed(int[] x,
int[] y)
pointerPressed in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerPressed(int x,
int y)
pointerPressed in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerReleased(int[] x,
int[] y)
pointerReleased in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void pointerReleased(int x,
int y)
pointerReleased in class Componentx - the pointer x coordinatey - the pointer y coordinatepublic void invalidate()
protected void onPositionSizeChange()
protected void setLightweightMode(boolean l)
l - true to enable lightweight mode, false to disable it