hades.gui
Class ChangeNameCommand

java.lang.Object
  extended byjava.util.EventObject
      extended byhades.gui.Command
          extended byhades.gui.ChangeNameCommand
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 ChangeNameCommand
extends Command
implements java.awt.event.ActionListener

ChangeNameCommand - copy an object in an HADES Design.

See Also:
Serialized Form

Field Summary
(package private)  ObjectCanvas canvas
           
(package private)  boolean hasName
           
(package private)  java.lang.String newname
           
(package private)  java.awt.Point newPos
           
(package private)  java.lang.String oldname
           
(package private)  StringDialog stringDialog
           
(package private)  SimObject target
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ChangeNameCommand(Editor editor)
          The constructor for a ChangeNameCommand on object 'target'.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void execute()
          perform the action corresponding to this ChangeNameCommand object and register it with the UndoStack.
 java.lang.String getDescription()
           
 void setPosition(java.awt.Point SP, java.awt.Point WP)
          Select the object whose name to change.
 java.lang.String toString()
          toString(): identify this ChangeNameCommand
 void undo()
          try to undo the action corresponding to this ChangeNameCommand 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, 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
 

Field Detail

newPos

java.awt.Point newPos

target

SimObject target

canvas

ObjectCanvas canvas

stringDialog

StringDialog stringDialog

hasName

boolean hasName

newname

java.lang.String newname

oldname

java.lang.String oldname
Constructor Detail

ChangeNameCommand

public ChangeNameCommand(Editor editor)
The constructor for a ChangeNameCommand on object 'target'.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class Command

execute

public void execute()
perform the action corresponding to this ChangeNameCommand object and register it with the UndoStack.

Overrides:
execute in class Command

undo

public void undo()
try to undo the action corresponding to this ChangeNameCommand object: we simply delete the copied object.

Overrides:
undo in class Command

setPosition

public void setPosition(java.awt.Point SP,
                        java.awt.Point WP)
Select the object whose name to change.

Overrides:
setPosition in class Command

toString

public java.lang.String toString()
toString(): identify this ChangeNameCommand

Overrides:
toString in class Command

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class Command