hades.gui
Class InsertVertexIntoSignalCommand
java.lang.Object
java.util.EventObject
hades.gui.Command
hades.gui.InsertVertexIntoSignalCommand
- 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 InsertVertexIntoSignalCommand
- extends Command
InsertVertexIntoSignalCommand - insert a new vertex (middle point)
into a HADES Signal
- See Also:
- Serialized Form
Fields inherited from class java.util.EventObject |
source |
Method Summary |
void |
execute()
insert a new vertex at position WP into Signal 'signal'
and register this command with the UndoStack. |
java.lang.String |
getDescription()
|
void |
setPosition(java.awt.Point SP,
java.awt.Point WP)
this method is only called once for a insert vertex command:
we just need one coordinate to find the nearest wire segment
and to specify where to insert the vertex (which may be moved
later on). |
java.lang.String |
toString()
toString(): identify this InsertVertexIntoSignalCommand |
void |
undo()
try to undo this command: we simple remove the new segments
and restore the old wire segment. |
Methods inherited from class hades.gui.Command |
actionPerformed, 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 |
signal
Signal signal
originalSegment
WireSegment originalSegment
newSegment1
WireSegment newSegment1
newSegment2
WireSegment newSegment2
canvas
ObjectCanvas canvas
newVertex
java.awt.Point newVertex
InsertVertexIntoSignalCommand
public InsertVertexIntoSignalCommand(Editor editor)
- The standard constructor
execute
public void execute()
- insert a new vertex at position WP into Signal 'signal'
and register this command with the UndoStack.
- Overrides:
execute
in class Command
undo
public void undo()
- try to undo this command: we simple remove the new segments
and restore the old wire segment.
- Overrides:
undo
in class Command
setPosition
public void setPosition(java.awt.Point SP,
java.awt.Point WP)
- this method is only called once for a insert vertex command:
we just need one coordinate to find the nearest wire segment
and to specify where to insert the vertex (which may be moved
later on).
- Overrides:
setPosition
in class Command
toString
public java.lang.String toString()
- toString(): identify this InsertVertexIntoSignalCommand
- Overrides:
toString
in class Command
getDescription
public java.lang.String getDescription()
- Overrides:
getDescription
in class Command