javax.microedition.lcdui
Class Displayable

java.lang.Object
  extended byjavax.microedition.lcdui.Displayable
Direct Known Subclasses:
Canvas, Screen

public abstract class Displayable
extends Object

A superclass of all Screens that can be put on the display.

The application may change the visible component when a Displayable while it its shown to the user. In that case the visible effect should take place no later than immediately after the callback returns back to the implementation.


Method Summary
 void addCommand(Command cmd)
          Adds a command to the Displayable.
 boolean isShown()
          Checks if the Displayable is really shown.
 void removeCommand(Command cmd)
          Removes a command from the Displayable.
 void setCommandListener(CommandListener l)
          Sets a listener for Commands to this Displayable, replacing any previous CommandListener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isShown

public boolean isShown()
Checks if the Displayable is really shown. That is, returns a boolean value indicating whether it is the current screen of the Display of this MIDlet, and the application manager is running this MIDlet in the foreground.

Returns:
true if the Displayable is currently shown

addCommand

public void addCommand(Command cmd)
Adds a command to the Displayable. The implementation may choose to add the command to any of the available soft buttons or place it in a menu. If the added command is already in the screen (tested by comparing the object references), the method has no effect. If the Displayable is physically visible, the visible effect should take place no later than immediately after the callback or startApp returns back to the implemenation.

Parameters:
cmd - the command to be added.
See Also:
Command

removeCommand

public void removeCommand(Command cmd)
Removes a command from the Displayable. If the command is not in the Displayable (tested by comparing the object references), the method has no effect. If the Displayable is physically visible, the visible effect should take place no later than immediately after the callback or startApp returns back to the implementation.

Parameters:
cmd - the command to be removed.
See Also:
Command

setCommandListener

public void setCommandListener(CommandListener l)
Sets a listener for Commands to this Displayable, replacing any previous CommandListener. A null reference is allowed and has the effect of removing any existing listener.

Parameters:
l - the new listener, or null.


Generated on 2003-10-17For further information and updates, please visit Siemens mobile Developer Portal