public class NavigationCommand

  1. Object
  2. Command
  3. NavigationCommand

ImplementsActionListener<ActionEvent>

The NavigationCommand is a Command that navigates to a given Form. The NavigationCommand calls the show() on the Form object that is returned from getNextForm().

Constructors

public NavigationCommand(String command)Creates a new instance of NavigationCommand
public NavigationCommand(String command, Image icon)Creates a new instance of NavigationCommand
public NavigationCommand(String command, int id)Creates a new instance of NavigationCommand
public NavigationCommand(String command, Image icon, int id)Creates a new instance of NavigationCommand

Methods

public Form getNextForm()Gets the next Form
public void setNextForm(Form nextForm)Sets the Form to navigate to when the actionPerformed is invoked on this Command
public boolean equals(Object o)compare two commands
public int hashCode()Allows storing commands in a vector/hashtable
public void actionPerformed(ActionEvent evt)This method is called when the soft button/Menu item is clicked

Inherited fields

Inherited methods

Constructor details

NavigationCommand

public NavigationCommand(String command)
Creates a new instance of NavigationCommand

Parameters

command String
the string that will be placed on the Soft buttons\Menu

NavigationCommand

public NavigationCommand(String command, Image icon)
Creates a new instance of NavigationCommand

Parameters

command String
the string that will be placed on the Soft buttons\Menu
icon Image
the icon representing the command

NavigationCommand

public NavigationCommand(String command, int id)
Creates a new instance of NavigationCommand

Parameters

command String
the string that will be placed on the Soft buttons\Menu
id int
user defined ID for a command simplifying switch statement code working with a command

NavigationCommand

public NavigationCommand(String command, Image icon, int id)
Creates a new instance of NavigationCommand

Parameters

command String
the string that will be placed on the Soft buttons\Menu
icon Image
the icon representing the command
id int
user defined ID for a command simplifying switch statement code working with a command

Method details

getNextForm

public Form getNextForm()
Gets the next Form

Returns

the next Form

setNextForm

public void setNextForm(Form nextForm)
Sets the Form to navigate to when the actionPerformed is invoked on this Command

Parameters

nextForm Form
The next Form

equals

public boolean equals(Object o)
compare two commands

Parameters

o Object
a Command Object to compare

Returns

true if the obj has the same command name

hashCode

public int hashCode()
Allows storing commands in a vector/hashtable

Returns

unique hashcode for the command class

actionPerformed

public void actionPerformed(ActionEvent evt)
This method is called when the soft button/Menu item is clicked

Parameters

evt ActionEvent
the Event Object