hades.gui
Class InsertVertexIntoSignalCommand

java.lang.Object
  extended byjava.util.EventObject
      extended byhades.gui.Command
          extended byhades.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

Field Summary
(package private)  ObjectCanvas canvas
           
(package private)  WireSegment newSegment1
           
(package private)  WireSegment newSegment2
           
(package private)  java.awt.Point newVertex
           
(package private)  WireSegment originalSegment
           
(package private)  Signal signal
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
InsertVertexIntoSignalCommand(Editor editor)
          The standard constructor
 
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
 

Field Detail

signal

Signal signal

originalSegment

WireSegment originalSegment

newSegment1

WireSegment newSegment1

newSegment2

WireSegment newSegment2

canvas

ObjectCanvas canvas

newVertex

java.awt.Point newVertex
Constructor Detail

InsertVertexIntoSignalCommand

public InsertVertexIntoSignalCommand(Editor editor)
The standard constructor

Method Detail

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