|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.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(java.lang.String command)
Creates a new instance of Command |
|
Command(java.lang.String command,
Image icon)
Creates a new instance of Command |
|
Command(java.lang.String command,
Image icon,
int id)
Creates a new instance of Command |
|
Command(java.lang.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(java.lang.Object obj)
compare two commands |
java.lang.Object |
getClientProperty(java.lang.String key)
The client properties are a useful way to associate meta-data with a command without subclassing |
java.lang.String |
getCommandName()
gets the Command Name |
Image |
getDisabledIcon()
Indicates the icon that is displayed on the button when the button is in the disabled state |
Image |
getIcon()
Returns the icon representing the command |
int |
getId()
Return the command ID |
Image |
getPressedIcon()
Indicates the icon that is displayed on the button when the button is in pressed state |
Image |
getRolloverIcon()
Indicates the icon that is displayed on the button when the button is in rolled over state |
int |
hashCode()
Allows storing commands in a vector/hashtable |
boolean |
isEnabled()
Allows disabling/enabling the command |
void |
putClientProperty(java.lang.String key,
java.lang.Object value)
The client properties are a useful way to associate meta-data with a command without sub classing |
void |
setCommandName(java.lang.String command)
sets the Command name |
void |
setDisabledIcon(Image disabledIcon)
Indicates the icon that is displayed on the button when the button is in the disabled state |
void |
setEnabled(boolean enabled)
Allows disabling/enabling the command |
void |
setPressedIcon(Image pressedIcon)
Indicates the icon that is displayed on the button when the button is in pressed state |
void |
setRolloverIcon(Image rolloverIcon)
Indicates the icon that is displayed on the button when the button is in rolled over state |
java.lang.String |
toString()
Returns a string representation of the object |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Command(java.lang.String command)
command
- the string that will be placed on the Soft buttons\Menupublic Command(java.lang.String command, Image icon)
command
- the string that will be placed on the Soft buttons\Menuicon
- the icon representing the commandpublic Command(java.lang.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(java.lang.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 java.lang.String getCommandName()
public void setCommandName(java.lang.String command)
command
- public Image getIcon()
public java.lang.String toString()
toString
in class java.lang.Object
public Image getPressedIcon()
public Image getDisabledIcon()
public Image getRolloverIcon()
public void setRolloverIcon(Image rolloverIcon)
rolloverIcon
- icon to usepublic void setPressedIcon(Image pressedIcon)
pressedIcon
- icon usedpublic void setDisabledIcon(Image disabledIcon)
disabledIcon
- icon usedpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- a Command Object to compare
public int hashCode()
hashCode
in class java.lang.Object
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- the Event Objectpublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- the enabled to setpublic java.lang.Object getClientProperty(java.lang.String key)
key
- an arbitrary user key
public void putClientProperty(java.lang.String key, java.lang.Object value)
key
- an arbitrary user keyvalue
- an arbitrary user object, null to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |