hades.gui
Class DeleteSelectionCommand

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

DeleteSelectionCommand - delete all selected SimObjects and WireSegments etc. from a HADES Design.

See Also:
Serialized Form

Field Summary
(package private)  ObjectCanvas canvas
           
(package private)  java.util.Hashtable victims
           
(package private)  java.util.Hashtable victimSignals
           
(package private)  java.util.Hashtable victimSimObjects
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DeleteSelectionCommand(Editor editor)
           
 
Method Summary
 void execute()
          delete all selected objects: this means both to delete the graphical stuff (FigObjects, WireSegments, SolderDots, and SimObject Symbols) and to delete the Signals and SimObjects from the current Design.
 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 At the first call, we expect the old position of the object to be moved, and on the second call its target position.
 java.lang.String toString()
           
 void undo()
          undo the deletion: reinsert all objects into the design
 
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
 

Field Detail

victims

java.util.Hashtable victims

victimSignals

java.util.Hashtable victimSignals

victimSimObjects

java.util.Hashtable victimSimObjects

canvas

ObjectCanvas canvas
Constructor Detail

DeleteSelectionCommand

public DeleteSelectionCommand(Editor editor)
Method Detail

execute

public void execute()
delete all selected objects: this means both to delete the graphical stuff (FigObjects, WireSegments, SolderDots, and SimObject Symbols) and to delete the Signals and SimObjects from the current Design. Finally, register this command with the UndoStack.

Overrides:
execute in class Command

undo

public void undo()
undo the deletion: reinsert all objects into the design

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 At the first call, we expect the old position of the object to be moved, and on the second call its target position.

Overrides:
setPosition in class Command

toString

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

getDescription

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