hades.gui
Class CreateByNameCommand
java.lang.Object
java.util.EventObject
hades.gui.Command
hades.gui.CreateByNameCommand
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.util.EventListener, FigCanvasListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable
- public class CreateByNameCommand
- extends Command
- implements java.awt.event.ActionListener
CreateByNameCommand - create a HADES component from it's class name.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
void |
execute()
perform the action corresponding to this CreateByNameCommand object
and register it with the UndoStack. |
java.lang.String |
getDescription()
|
void |
mousePressed(FigCanvasEvent ME)
extract the screen and world coordinates of this Event, and
dispatch to setPosition(). |
void |
setPosition(java.awt.Point SP,
java.awt.Point WP)
this method should be called twice for a copy command. |
java.lang.String |
toString()
toString(): identify this CreateByNameCommand |
void |
undo()
try to undo the action corresponding to this CreateByNameCommand object:
we simply delete the copied object. |
Methods inherited from class hades.gui.Command |
cancel, dbg, getLogExtraArguments, initialize, isReady, keyPressed, keyReleased, keyTyped, message, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, statusMessage, writePositionLogMessage |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
newPos
java.awt.Point newPos
target
SimObject target
canvas
ObjectCanvas canvas
stringDialog
StringDialog stringDialog
hasName
boolean hasName
classname
java.lang.String classname
CreateByNameCommand
public CreateByNameCommand(Editor editor,
java.lang.String className)
execute
public void execute()
- perform the action corresponding to this CreateByNameCommand object
and register it with the UndoStack.
- Overrides:
execute
in class Command
undo
public void undo()
- try to undo the action corresponding to this CreateByNameCommand object:
we simply delete the copied object.
- Overrides:
undo
in class Command
mousePressed
public void mousePressed(FigCanvasEvent ME)
- extract the screen and world coordinates of this Event, and
dispatch to setPosition().
- Specified by:
mousePressed
in interface FigCanvasListener
- Overrides:
mousePressed
in class Command
setPosition
public void setPosition(java.awt.Point SP,
java.awt.Point WP)
- this method should be called twice for a copy command.
At the first call, we expect the old position of the object to be
copied, and on the second call its target position.
- Overrides:
setPosition
in class Command
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent evt)
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Overrides:
actionPerformed
in class Command
toString
public java.lang.String toString()
- toString(): identify this CreateByNameCommand
- Overrides:
toString
in class Command
getDescription
public java.lang.String getDescription()
- Overrides:
getDescription
in class Command