javax.microedition.lcdui
Class Displayable
java.lang.Object
|
+--javax.microedition.lcdui.Displayable
- Direct Known Subclasses:
- Canvas, Screen
- public abstract class Displayable
- extends Object
An object that has the capability of being placed on the display. A
Displayable object may have commands and listeners associated with it.
The contents displayed and their interaction with the user are defined
by subclasses.
- Version:
- MIDP 0.95 Public Draft
Displayable
public Displayable()
addCommand
public void addCommand(Command cmd)
- Adds a Command to the Displayable. The implementation may choose, for
example, to add the command to any of the available softbuttons 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 actually visible on the display, and this call affects the
set of visible Commands, the implementation should update the display as
soon as it is feasible to do so.
- Parameters:
cmd
- the Command to be added.- See Also:
Command
isShown
public boolean isShown()
- Checks if the Displayable is actually visible on the
Display
. In order
for a Displayable to be visible, all of the following must be true: the
Display's MIDlet must be running in the foreground, the Displayable must
be the Display's current screen, and the Displayable must not be obscured
by a system screen.
- Returns:
- true if the Displayable is currently visible
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 actually visible on the
display, and this call affects the set of visible Commands, the
implementation should update the display as soon as it is feasible to
do so.
- 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
.