FileDocCategorySizeDatePackage
DisplayableLF.javaAPI DocphoneME MR2 API (J2ME)8373Wed May 02 18:00:22 BST 2007javax.microedition.lcdui

DisplayableLF

public interface DisplayableLF
Look and Feel interface used by Displayable.

See Naming Conventions for information about method naming conventions.

Fields Summary
Constructors Summary
Methods Summary
public intgetVerticalScrollPosition()
Get the current vertical scroll position

return
int The vertical scroll position on a scale of 0-100

public intgetVerticalScrollProportion()
Get the current vertical scroll proportion

return
ing The vertical scroll proportion on a scale of 0-100

public voidlAddCommand(Command cmd, int i)
Notifies look&feel object of a command addition to the Displayable.

param
cmd the command that was added
param
i the index of the added command in Displayable.commands[] array

public voidlCommitPendingInteraction()
Called to commit any pending user interaction for the current item before an abstract command is fired. Caller should hold LCDUILock around this call.

public DisplaylGetCurrentDisplay()
Return in which Display instance the LF is visible.

return
the current display.

public DisplayablelGetDisplayable()
Return the associated Displayable object.

return
the Displayable object.

public intlGetHeight()
Returns the height of the area available to the application.

return
height of the area available to the application

public intlGetWidth()
Returns the width of the area available to the application.

return
width of the area available to the application

public booleanlIsShown()
Implement the public API isShown().

return
true if the DisplayableLF is interactive with user.

public voidlRemoveCommand(Command cmd, int i)
Notifies look&feel object of a command removal from the Displayable.

param
cmd the command that was removed
param
i the index of the removed command in Displayable.commands[] array

public voidlSetDisplay(Display d)
Set the display instance the Displayable is associated with. Caller should hold LCDUILock around this call.

param
d Display instance in which this DisplayableLF is visible. null if this DisplayableLF is no longer visible.

public voidlSetTicker(Ticker oldTicker, Ticker newTicker)
Notifies Displayable's look & feel object of a ticker change.

param
oldTicker the old ticker, or null for no ticker
param
newTicker the new ticker, or null for no ticker

public voidlSetTitle(java.lang.String oldTitle, java.lang.String newTitle)
Notifies Displayable's look & feel object of a title change.

param
oldTitle the old title, or null for no title
param
newTitle the new title, or null for no title

public voiduCallFreeze()
While UI resources of this LF are created and visible already, stop any further updates to physical screen because some "system modal dialog" takes over physical screen buffer and user input now. Repaint and invalidate requests from this DisplayableLF will be really scheduled into event queue. Instead, only dirty flag is set. After a LF enters "freeze" mode, it can be resumed of visibility or directly replaced by a new Displayable.

public voiduCallHide()
Remove this displayable from physical screen. The displayable should unload any resource that was allocated. It's not required to clean the physical screen before this function returns. This function could be called while a LF is in "freeze" mode.

public voiduCallInvalidate()
Relayout and repaint now. Called by the event handler to perform an invalidation of this Displayable.

public voiduCallKeyEvent(int type, int keyCode)
Handle key events.

param
type defined in EventConstants.
param
keyCode the key involved in this event.

public voiduCallPaint(Graphics g, java.lang.Object target)
Repaint now. 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, 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.

param
g the graphics context to paint into.
param
target the target Object of this repaint

public voiduCallPointerEvent(int type, int x, int y)
Handle pointer events.

param
type kind of event, defined in EventConstants.
param
x x-coordinate of pointer event
param
y y-coordinate of pointer event

public voiduCallScrollContent(int scrollType, int thumbPosition)
This method notify displayable to scroll its content

param
scrollType scrollType
param
thumbPosition

public voiduCallShow()
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 dsPaint() that will be called on this LF shortly after.

public voiduCallSizeChanged(int w, int h)
This method calls Displayable.sizeChanged method.

param
w the new width
param
h the new height

public booleanuIsScrollNative()
This method is used int repaint, int order to determine the translation of the draw coordinates.

return
true if the scroll responsibility is of the native platform. false - if the scroll is done in the Java level.

public voiduSetFullScreenMode(boolean fullScreenMode)
Notify the full screen mode of this LF. If true, this DisplayableLF will take up as much screen real estate as possible. Any subclass of Displayable should be prepared to do their job to accommodate the change. Note that it can call into the app code.

param
fullScreenMode true if full screen mode should be turned on

public booleanuSetRotatedStatus(boolean newStatus)

public voidupdateCommandSet()
Notifies look&feel object of commandset being updated.