hades.gui
Class CreateSubdesignCommand
java.lang.Object
java.util.EventObject
hades.gui.Command
hades.gui.CreateSubdesignCommand
- 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 CreateSubdesignCommand
- extends Command
- implements java.awt.event.ActionListener
CreateSubdesignCommand - put a subdesign into a design.
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Constructor Summary |
CreateSubdesignCommand(Editor editor,
java.lang.String designName)
select a HADES subdesign in the DesignManager, and include it with
the current editor's design. |
Method Summary |
void |
execute()
if we arrive here, the user has selected a valid subdesign and
the position where to place it. |
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)
select the subdesign target position. |
java.lang.String |
toString()
toString(): identify this CreateSubdesignCommand |
void |
undo()
undo this CreateSubdesignCommand object: we simply delete the subdesign. |
Methods inherited from class hades.gui.Command |
actionPerformed, 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 |
Methods inherited from interface java.awt.event.ActionListener |
actionPerformed |
newPos
java.awt.Point newPos
target
SimObject target
canvas
ObjectCanvas canvas
stringDialog
StringDialog stringDialog
hasName
boolean hasName
resname
java.lang.String resname
CreateSubdesignCommand
public CreateSubdesignCommand(Editor editor,
java.lang.String designName)
- select a HADES subdesign in the DesignManager, and include it with
the current editor's design.
execute
public void execute()
- if we arrive here, the user has selected a valid subdesign and
the position where to place it. Actually include the subdesign
with the editor's design, and register this Command with the UndoStack.
- Overrides:
execute
in class Command
undo
public void undo()
- undo this CreateSubdesignCommand object: we simply delete the subdesign.
- 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)
- select the subdesign target position.
- Overrides:
setPosition
in class Command
toString
public java.lang.String toString()
- toString(): identify this CreateSubdesignCommand
- Overrides:
toString
in class Command
getDescription
public java.lang.String getDescription()
- Overrides:
getDescription
in class Command