public class Command extends Object implements ActionListener
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
This method is called when the soft button/Menu item is clicked
|
boolean |
equals(Object obj)
compare two commands
|
Object |
getClientProperty(String key)
The client properties are a useful way to associate meta-data with a command
without subclassing
|
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 |
isDisposesDialog()
Indicates whether this command causes the dialog to dispose implicitly, defaults to true
|
boolean |
isEnabled()
Allows disabling/enabling the command
|
void |
putClientProperty(String key,
Object value)
The client properties are a useful way to associate meta-data with a command
without sub classing
|
void |
setCommandName(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 |
setDisposesDialog(boolean disposesDialog)
Indicates whether this command causes the dialog to dispose implicitly, defaults to true
|
void |
setEnabled(boolean enabled)
Allows disabling/enabling the command
|
void |
setIcon(Image icon)
Sets the icon for 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
|
String |
toString()
Returns a string representation of the object
|
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 commandpublic int getId()
public String getCommandName()
public void setCommandName(String command)
command
- public Image getIcon()
public void setIcon(Image icon)
icon
- the new iconpublic String toString()
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(Object obj)
public int hashCode()
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- the Event Objectpublic void setDisposesDialog(boolean disposesDialog)
public boolean isDisposesDialog()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- the enabled to setpublic Object getClientProperty(String key)
key
- an arbitrary user key