|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.Component com.sun.lwuit.PeerComponent
public class PeerComponent
A peer component is essentially a "dummy" LWUIT component used to calculate the position of the actual native platform specific component. The behavior of a peer component is very platform specific, it is meant for platforms where a native component can be integrated with a LWUIT component. LWUIT features such as glass pane, z-ordering, dialogs & menus might not work as expected in all situations where peer components are involved. E.g. a peer component might hide itself when a menu/dialog is shown and recreate itself when it is hidden/disposed.
Field Summary |
---|
Fields inherited from class com.sun.lwuit.Component |
---|
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP |
Constructor Summary | |
---|---|
protected |
PeerComponent(java.lang.Object nativePeer)
This constructor is used by the platform implementation to create instances of this class use the static create method. |
Method Summary | |
---|---|
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(java.lang.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 |
java.lang.Object |
getNativePeer()
Returns the native peer instance |
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 |
boolean |
isBorderPainted()
|
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)
Paints the background of the component, invoked with the clipping region and appropriate scroll translation. |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected PeerComponent(java.lang.Object nativePeer)
nativePeer
- the native platform specific peer component.Method Detail |
---|
public static PeerComponent create(java.lang.Object nativePeer)
nativePeer
- the native platform specific peer component.public java.lang.Object getNativePeer()
public boolean animate()
Animation
Display
class.
animate
in interface Animation
animate
in class Component
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class Component
protected Dimension calcScrollSize()
Component
calcScrollSize
in class Component
protected void deinitialize()
Component
deinitialize
in class Component
protected void fireClicked()
Component
fireClicked
in class Component
protected void focusGained()
Component
focusGained
in class Component
protected void focusLost()
Component
focusLost
in class Component
public boolean handlesInput()
Component
handlesInput
in class Component
protected void initComponent()
Component
initComponent
in class Component
public boolean isBorderPainted()
public void keyPressed(int keyCode)
Component
keyPressed
in class Component
keyCode
- the key code value to indicate a physical key.public void keyReleased(int keyCode)
Component
keyReleased
in class Component
keyCode
- the key code value to indicate a physical key.public void keyRepeated(int keyCode)
Component
keyRepeated
in class Component
keyCode
- the key code value to indicate a physical key.public void paint(Graphics g)
Component
paint
in interface Animation
paint
in class Component
g
- the component graphicsprotected void paintBackground(Graphics g)
Component
paintBackground
in class Component
g
- the component graphicspublic void paintBackgrounds(Graphics g)
Component
paintBackgrounds
in class Component
g
- the graphics objectprotected void paintBorder(Graphics g)
Component
paintBorder
in class Component
g
- graphics context on which the border is paintedprotected void paintScrollbarX(Graphics g)
Component
paintScrollbarX
in class Component
g
- the component graphicsprotected void paintScrollbarY(Graphics g)
Component
paintScrollbarY
in class Component
g
- the component graphicsprotected void paintScrollbars(Graphics g)
Component
paintScrollbars
in class Component
g
- the component graphicspublic void pointerDragged(int[] x, int[] y)
Component
pointerDragged
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerDragged(int x, int y)
Component
pointerDragged
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHover(int[] x, int[] y)
Component
pointerHover
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverReleased(int[] x, int[] y)
Component
pointerHoverReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerPressed(int[] x, int[] y)
Component
pointerPressed
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerPressed(int x, int y)
Component
pointerPressed
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerReleased(int[] x, int[] y)
Component
pointerReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerReleased(int x, int y)
Component
pointerReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void invalidate()
protected void onPositionSizeChange()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |