public class Command extends Object implements ActionListener
Constructor and Description |
---|
Command(String command)
Creates a new instance of Command
|
Command(String command,
boolean defaultAction)
Deprecated.
this functionality is no longer supported use Form.setDefaultCommand() instead
|
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
|
Command(String command,
int id,
boolean defaultAction)
Deprecated.
this functionality is no longer supported use Form.setDefaultCommand() instead
|
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
|
String |
getCommandName()
gets the Command Name
|
Image |
getIcon()
Returns the icon representing the command
|
int |
getId()
Return the command ID
|
int |
hashCode()
Allows storing commands in a vector/hashtable
|
boolean |
isDefaultAction()
Deprecated.
this functionality is no longer supported use Form.setDefaultCommand() instead
|
void |
setCommandName(String command)
sets the Command name
|
void |
setDefaultAction(boolean defaultAction)
Deprecated.
this functionality is no longer supported use Form.setDefaultCommand() instead
|
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 Command(String command, int id, boolean defaultAction)
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 commanddefaultAction
- Indicates that this action should occur by default
on fire action eventpublic Command(String command, boolean defaultAction)
command
- the string that will be placed on the Soft buttons\MenudefaultAction
- Indicates that this action should occur by default
on fire action eventpublic int getId()
public String getCommandName()
public void setCommandName(String command)
command
- public Image getIcon()
public String toString()
public boolean equals(Object obj)
equals
in class Object
obj
- a Command Object to compareObject.hashCode()
,
HashMap
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- the Event Objectpublic boolean isDefaultAction()
public void setDefaultAction(boolean defaultAction)
defaultAction
- the default action event