roneditor.ronview.commands
Class CreateTokenCommand

java.lang.Object
  extended by org.eclipse.gef.commands.Command
      extended by roneditor.ronview.commands.CreateTokenCommand

public class CreateTokenCommand
extends org.eclipse.gef.commands.Command

Command for adding a Token to a HLPlace. This is undoable.

Author:
Tony Modica

Field Summary
private static java.lang.String CreateCommand_Label
           
private  java.lang.String name
           
private  ronmodel.HLPlace place
           
private  ronmodel.Token token
           
 
Constructor Summary
CreateTokenCommand(ronmodel.HLPlace place, ronmodel.Token token)
           
 
Method Summary
 boolean canExecute()
           
 void execute()
          Executes the command by adding the Net to the HLPlace.
 void redo()
           
 void setName(java.lang.String name)
           
 void undo()
          Undoes the command by removing the Token from the HLPlace.
 
Methods inherited from class org.eclipse.gef.commands.Command
canUndo, chain, dispose, getDebugLabel, getLabel, setDebugLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CreateCommand_Label

private static final java.lang.String CreateCommand_Label
See Also:
Constant Field Values

place

private final ronmodel.HLPlace place

token

private ronmodel.Token token

name

private java.lang.String name
Constructor Detail

CreateTokenCommand

public CreateTokenCommand(ronmodel.HLPlace place,
                          ronmodel.Token token)
Method Detail

execute

public void execute()
Executes the command by adding the Net to the HLPlace.

Overrides:
execute in class org.eclipse.gef.commands.Command
See Also:
Command.execute()

undo

public void undo()
Undoes the command by removing the Token from the HLPlace.

Overrides:
undo in class org.eclipse.gef.commands.Command
See Also:
Command.undo()

redo

public void redo()
Overrides:
redo in class org.eclipse.gef.commands.Command
See Also:
Command.redo()

canExecute

public boolean canExecute()
Overrides:
canExecute in class org.eclipse.gef.commands.Command
See Also:
Command.canExecute()

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set