| java.lang.Object javax.microedition.lcdui.DisplayableLFImpl
All known Subclasses: javax.microedition.lcdui.AlertLFImpl, javax.microedition.lcdui.ScreenLFImpl, javax.microedition.lcdui.CanvasLFImpl, javax.microedition.lcdui.FormLFImpl,
DisplayableLFImpl | abstract class DisplayableLFImpl implements DisplayableLF(Code) | | The look and feel implementation of Displayable based
on platform widget.
|
Field Summary | |
final static int | FROZEN | final static int | HEIGHT Used as an index into the viewport[], for the height. | final static int | HIDDEN | final static int | INVALID_NATIVE_ID Uninitialized native resource id value. | final static int | SHOWN | final static int | WIDTH Used as an index into the viewport[], for the width. | final static int | X Used as an index into the viewport[], for the x origin. | final static int | Y Used as an index into the viewport[], for the y origin. | Display | currentDisplay The current Display object. | boolean | defferedSizeChange True , indicates that before being painted, this
Displayable should be notified that its size has
changed via uCallSizeChanged(). | int | modelVersion Version number of this LF's data model.
Should be updated when public data model has changed and
be passed to native peer if visible. | int | nativeId The MidpDisplayable* of this Displayable
while visible. | Displayable | owner The owner of this view. | boolean | pendingInvalidate | boolean | sawKeyPress True , if a key press is in progress. | boolean | sawPointerPress True , if a pointer press is in progress. | int | state | int | widthheight Width and height available to the Displayable . |
Method Summary | |
abstract void | createNativeResource() Create native resource. | void | deleteNativeResource() Delete native resource. | public int | getVerticalScrollPosition() Get the current vertical scroll position. | public int | getVerticalScrollProportion() Get the current vertical scroll proportion. | public void | lAddCommand(Command cmd, int i) Notifies look & feel object of a command addition
to the Displayable . | void | lCallHide() Remove this Displayable from physical screen.
The Displayable should unload any resource that
was allocated. | void | lCallShow() Prepare to show this LF on physical screen. | public void | lCommitPendingInteraction() Called to commit any pending user interaction for the current item. | public Display | lGetCurrentDisplay() Return the Display instance in which the LF is
currently shown.
the Display instance in which the LF is shown. | public Displayable | lGetDisplayable() Return the associated Displayable object. | public int | lGetHeight() Get the height in pixels this Displayable is using. | public int | lGetWidth() Get the width in pixels this Displayable is using. | public boolean | lIsShown() Implement public API isShown(). | public void | lRemoveCommand(Command cmd, int i) Notifies look &s; feel object of a command removal
from the Displayable . | void | lRequestInvalidate() Called to schedule an "invalidate" for this Displayable . | void | lRequestPaint(int x, int y, int width, int height, Object target) Repaint this Displayable . | void | lRequestPaint() Repaints this Displayable . | void | lRequestPaintContents() Repaint the whole Displayable . | public void | lSetDisplay(Display d) Set the display instance the Displayable is associated
with. | public void | lSetTicker(Ticker oldTicker, Ticker newTicker) Notifies Displayable 's look & feel object of
a ticker change. | public void | lSetTitle(String oldTitle, String newTitle) Notifies Displayable 's look & feel object of
a title change. | void | tickerTextChanged(Ticker t) Notification that the ticker has changed. | public void | uCallFreeze() Some "system modal dialog" takes over physical screen
buffer and user input now or foreground is lost. | public void | uCallHide() Remove this Displayable from physical screen. | public void | uCallInvalidate() Called by the event handler to perform an invalidation of this
Displayable . | public void | uCallKeyEvent(int type, int keyCode) Handle a raw key event from Display . | void | uCallKeyPressed(int keyCode) Handle a key press. | void | uCallKeyReleased(int keyCode) Handle a key release. | void | uCallKeyRepeated(int keyCode) Handle a repeated key press. | public void | uCallPaint(Graphics g, Object target) Display calls this method on it's current
Displayable . | void | uCallPointerDragged(int x, int y) Handle a pointer drag event. | public void | uCallPointerEvent(int type, int x, int y) Called from the event delivery loop when a pointer event is seen. | void | uCallPointerPressed(int x, int y) Handle a pointer press event. | void | uCallPointerReleased(int x, int y) Handle a pointer release event. | public void | uCallScrollContent(int scrollType, int thumbPosition) | public void | uCallShow() Prepare to show this LF on physical screen. | public void | uCallSizeChanged(int w, int h) Package private equivalent of sizeChanged(). | public int | uGetKeyMask() Called to get the key mask of all the keys that were pressed. | public boolean | uIsScrollNative() This method is used in repaint, in order to determine the translation
of the draw coordinates. | void | uRequestPaint() Request to paint all of this Displayable (without holding a lock). | public void | uSetFullScreenMode(boolean mode) Notifies look & feel object of a full screen mode change. | public boolean | uSetRotatedStatus(boolean newStatus) | public void | updateCommandSet() Updates command set if this Displayable is visible. |
FROZEN | final static int FROZEN(Code) | | frozen state of DisplayableLF
|
HEIGHT | final static int HEIGHT(Code) | | Used as an index into the viewport[], for the height.
|
HIDDEN | final static int HIDDEN(Code) | | hidden state of DisplayableLF
|
INVALID_NATIVE_ID | final static int INVALID_NATIVE_ID(Code) | | Uninitialized native resource id value.
|
SHOWN | final static int SHOWN(Code) | | shown state of DisplayableLF
|
WIDTH | final static int WIDTH(Code) | | Used as an index into the viewport[], for the width.
|
X | final static int X(Code) | | Used as an index into the viewport[], for the x origin.
|
Y | final static int Y(Code) | | Used as an index into the viewport[], for the y origin.
|
currentDisplay | Display currentDisplay(Code) | | The current Display object.
|
defferedSizeChange | boolean defferedSizeChange(Code) | | True , indicates that before being painted, this
Displayable should be notified that its size has
changed via uCallSizeChanged().
|
modelVersion | int modelVersion(Code) | | Version number of this LF's data model.
Should be updated when public data model has changed and
be passed to native peer if visible. Native peer tags
all its native events with this version to prevent user
actions on obsolete copy of the data in native.
|
nativeId | int nativeId(Code) | | The MidpDisplayable* of this Displayable
while visible.
INVALID_NATIVE_ID if no native resource has been created.
|
pendingInvalidate | boolean pendingInvalidate(Code) | | Used to indicate the invalidate is needed
|
sawKeyPress | boolean sawKeyPress(Code) | | True , if a key press is in progress.
|
sawPointerPress | boolean sawPointerPress(Code) | | True , if a pointer press is in progress.
|
state | int state(Code) | | current state of DisplayableLF (HIDDEN, SHOWN, or FROZEN)
|
widthheight | int widthheight(Code) | | Width and height available to the Displayable .
|
DisplayableLFImpl | DisplayableLFImpl(Displayable d)(Code) | | Creates DisplayableLF for the passed in
Displayable .
Parameters: d - the Displayable object associated with this look & feel. |
createNativeResource | abstract void createNativeResource()(Code) | | Create native resource.
Instance variable
DisplayableLFImpl.nativeId nativeId must be set
to the id of the new resource.
|
getVerticalScrollPosition | public int getVerticalScrollPosition()(Code) | | Get the current vertical scroll position.
int The vertical scroll position on a scale of 0-100 |
getVerticalScrollProportion | public int getVerticalScrollProportion()(Code) | | Get the current vertical scroll proportion.
ing The vertical scroll proportion on a scale of 0-100 |
lAddCommand | public void lAddCommand(Command cmd, int i)(Code) | | Notifies look & feel object of a command addition
to the Displayable .
SYNC NOTE: The caller of this method handles synchronization.
Parameters: cmd - the command that was added Parameters: i - the index of the added command in Displayable.commands[] array |
lCallHide | void lCallHide()(Code) | | Remove this Displayable from physical screen.
The Displayable should unload any resource that
was allocated. It is not required to clean the physical screen
before this function returns.
|
lCallShow | void lCallShow()(Code) | | Prepare to show this LF on physical screen. This is the
internal version of showNotify() function as defined in MIDP spec.
It is called immediately prior to this LF being made visible
on the display. The LF should load any resource that is
needed, layout. App's paint() should NOT be called in this function.
Instead, it should be in the uCallPaint() that will be called on this
LF shortly after.
This function sets this DisplayableLF to SHOWN state.
|
lCommitPendingInteraction | public void lCommitPendingInteraction()(Code) | | Called to commit any pending user interaction for the current item.
|
lGetCurrentDisplay | public Display lGetCurrentDisplay()(Code) | | Return the Display instance in which the LF is
currently shown.
the Display instance in which the LF is shown. Null if not shown. |
lGetDisplayable | public Displayable lGetDisplayable()(Code) | | Return the associated Displayable object.
SYNC NOTE: Since the Displayable and
DisplayableLFImpl has 1-to-1 mapping, this function
can be called from in or outside of LCDUILock.
the public model object this LF is associated with. |
lGetHeight | public int lGetHeight()(Code) | | Get the height in pixels this Displayable is using.
height of the area available to the application |
lGetWidth | public int lGetWidth()(Code) | | Get the width in pixels this Displayable is using.
width of the area available to the application |
lIsShown | public boolean lIsShown()(Code) | | Implement public API isShown().
true if current DisplayableLF is interactive with user. |
lRemoveCommand | public void lRemoveCommand(Command cmd, int i)(Code) | | Notifies look &s; feel object of a command removal
from the Displayable .
SYNC NOTE: The caller of this method handles synchronization.
Parameters: cmd - the command that was removed Parameters: i - the index of the removed command in Displayable.commands[] array |
lRequestInvalidate | void lRequestInvalidate()(Code) | | Called to schedule an "invalidate" for this Displayable .
Invalidation is caused by things like size changes, content changes,
or spontaneous traversal within the Item .
SYNC NOTE: Caller must hold LCDUILock around this call.
|
lRequestPaint | void lRequestPaint(int x, int y, int width, int height, Object target)(Code) | | Repaint this Displayable .
Parameters: x - The x coordinate of the region to repaint Parameters: y - The y coordinate of the region to repaint Parameters: width - The width of the region to repaint Parameters: height - The height of the region to repaint Parameters: target - an optional paint target to receive the paint requestwhen it returns via uCallPaint() |
lRequestPaint | void lRequestPaint()(Code) | | Repaints this Displayable .
This is the same as calling
repaint(0, 0, width, height, null)
|
lRequestPaintContents | void lRequestPaintContents()(Code) | | Repaint the whole Displayable .
|
lSetDisplay | public void lSetDisplay(Display d)(Code) | | Set the display instance the Displayable is associated
with.
Caller should hold LCDUILock around this call.
Parameters: d - Display instance in which this DisplayableLF is visible.null if this DisplayableLF is no longer visible. |
lSetTicker | public void lSetTicker(Ticker oldTicker, Ticker newTicker)(Code) | | Notifies Displayable 's look & feel object of
a ticker change.
SYNC NOTE: The caller of this method handles synchronization.
Parameters: oldTicker - the old ticker, or null for no ticker Parameters: newTicker - the new ticker, or null for no ticker |
lSetTitle | public void lSetTitle(String oldTitle, String newTitle)(Code) | | Notifies Displayable 's look & feel object of
a title change.
SYNC NOTE: The caller of this method handles synchronization.
Parameters: oldTitle - the old title, or null for no title Parameters: newTitle - the new title, or null for no title |
tickerTextChanged | void tickerTextChanged(Ticker t)(Code) | | Notification that the ticker has changed.
This method is called from TickerLFImpl .
Parameters: t - the ticker associated with the TickerLFImpl |
uCallFreeze | public void uCallFreeze()(Code) | | Some "system modal dialog" takes over physical screen
buffer and user input now or foreground is lost.
This function calls lCallHide after holding LCDUILock
and sets this DisplayableLF to FROZEN state.
|
uCallHide | public void uCallHide()(Code) | | Remove this Displayable from physical screen.
This function calls lCallHide after holding LCDUILock
and sets this DisplayableLF to HIDDEN state.
|
uCallInvalidate | public void uCallInvalidate()(Code) | | Called by the event handler to perform an invalidation of this
Displayable .
Subclass should override to perform re-layout.
Default implementation does nothing.
|
uCallKeyEvent | public void uCallKeyEvent(int type, int keyCode)(Code) | | Handle a raw key event from Display .
Parameters: type - type of event, defined in EventConstants Parameters: keyCode - code of the key event |
uCallKeyPressed | void uCallKeyPressed(int keyCode)(Code) | | Handle a key press.
Parameters: keyCode - The key that was pressed |
uCallKeyReleased | void uCallKeyReleased(int keyCode)(Code) | | Handle a key release.
Parameters: keyCode - The key that was released |
uCallKeyRepeated | void uCallKeyRepeated(int keyCode)(Code) | | Handle a repeated key press.
Parameters: keyCode - The key that was pressed |
uCallPaint | public void uCallPaint(Graphics g, Object target)(Code) | | Display calls this method on it's current
Displayable .
Displayable uses this opportunity to do necessary stuff
on the graphics context, this includes, paint Ticker, paint Title
and translate as necessary.
The target Object of this repaint may be some Object
initially set by this Displayable when the repaint was
requested - allowing this Displayable to know exactly
which Object it needs to call to service this repaint,
rather than potentially querying all of its Objects to
determine the one(s) which need painting.
SYNC NOTE: The caller of this method handles synchronization.
Parameters: g - the graphics context to paint into. Parameters: target - the target Object of this repaint |
uCallPointerDragged | void uCallPointerDragged(int x, int y)(Code) | | Handle a pointer drag event.
Parameters: x - The x coordinate of the drag Parameters: y - The y coordinate of the drag |
uCallPointerEvent | public void uCallPointerEvent(int type, int x, int y)(Code) | | Called from the event delivery loop when a pointer event is seen.
Parameters: type - kind of pointer event Parameters: x - x-coordinate of pointer event Parameters: y - y-coordinate of pointer event |
uCallPointerPressed | void uCallPointerPressed(int x, int y)(Code) | | Handle a pointer press event.
Parameters: x - The x coordinate of the press Parameters: y - The y coordinate of the press |
uCallPointerReleased | void uCallPointerReleased(int x, int y)(Code) | | Handle a pointer release event.
Parameters: x - The x coordinate of the release Parameters: y - The y coordinate of the release |
uCallScrollContent | public void uCallScrollContent(int scrollType, int thumbPosition)(Code) | | This method notify displayable to scroll its content
Parameters: scrollType - scrollType Parameters: thumbPosition - |
uCallShow | public void uCallShow()(Code) | | Prepare to show this LF on physical screen.
This function will set correct screen mode screen mode
then call lCallShow.
|
uCallSizeChanged | public void uCallSizeChanged(int w, int h)(Code) | | Package private equivalent of sizeChanged().
Parameters: w - the new width Parameters: h - the new height |
uGetKeyMask | public int uGetKeyMask()(Code) | | Called to get the key mask of all the keys that were pressed.
Implement an interface function for CanvasLF only.
keyMask The key mask of all the keys that were pressed. |
uIsScrollNative | public boolean uIsScrollNative()(Code) | | This method is used in repaint, in order to determine the translation
of the draw coordinates.
true , if the scroll responsibility is on the native platform.false , if the scroll is done at Java level. |
uRequestPaint | void uRequestPaint()(Code) | | Request to paint all of this Displayable (without holding a lock).
|
uSetFullScreenMode | public void uSetFullScreenMode(boolean mode)(Code) | | Notifies look & feel object of a full screen mode change.
Parameters: mode - true , if canvas should be displayed without title, ticker, etc.; false otherwise |
uSetRotatedStatus | public boolean uSetRotatedStatus(boolean newStatus)(Code) | | Set status of screen rotation
Parameters: newStatus - |
updateCommandSet | public void updateCommandSet()(Code) | | Updates command set if this Displayable is visible.
SYNC NOTE: Caller must hold LCDUILock around this call.
|
|
|