|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.lwuit.Command
public class Command
The action placed on the soft buttons and in the Menu on devices, similar to the MIDP command abstraction and Swing's Actions. Unlike the MIDP abstraction this class can be derived to implement the right behavior
Constructor Summary | |
---|---|
Command(String command)
Creates a new instance of Command. |
|
Command(String command,
Image icon)
Creates a new instance of Command. |
|
Command(String command,
Image icon,
int id)
Creates a new instance of Command. |
|
Command(String command,
int id)
Creates a new instance of Command. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent evt)
This method is called when the soft button/Menu item is clicked. |
boolean |
equals(Object obj)
Compare two commands. |
String |
getCommandName()
Gets the Command Name. |
Image |
getIcon()
Returns the icon representing the command. |
int |
getId()
Return the command ID. |
int |
hashCode()
|
String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Command(String command)
command
- the string that will be placed on the Soft buttons\Menupublic Command(String command, Image icon)
command
- the string that will be placed on the Soft buttons\Menuicon
- the icon representing the commandpublic Command(String command, int id)
command
- the string that will be placed on the Soft buttons\Menuid
- user defined ID for a command simplifying switch statement code
working with a commandpublic Command(String command, Image icon, int id)
command
- the string that will be placed on the Soft buttons\Menuicon
- the icon representing the commandid
- user defined ID for a command simplifying switch statement code
working with a commandMethod Detail |
---|
public int getId()
public String getCommandName()
public Image getIcon()
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- a Command Object to compare
public int hashCode()
hashCode
in class Object
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- the Event Object
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |