MID Profile

javax.microedition.lcdui
Class Displayable

java.lang.Object
  |
  +--javax.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 comnent 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 setListener(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 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 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

setListener

public void setListener(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.

MID Profile

Submit a comment or suggestion Version 0.9 of MID Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.