hades.gui
Class SelectObjectCommand

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

SelectObjectCommand - select/deselect graphical objects (Symbol, WireSegment, basic FigObjects) on the Hades editor canvas.

See Also:
Serialized Form

Field Summary
(package private)  ObjectCanvas canvas
           
(package private)  boolean isSelected
           
(package private)  FigObject target
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SelectObjectCommand(Editor editor)
           
 
Method Summary
 void execute()
          toggle the selection status of the selected 'target' object.
 java.lang.String getDescription()
           
 void mousePressed(FigCanvasEvent ME)
          process a mouse event ME at world coordinates WP and screen coords SP
 void setPosition(java.awt.Point SP, java.awt.Point WP)
          find the object at the mouse position and toggle its selection state.
 java.lang.String toString()
           
 void undo()
          undo: do nothing, the user can easily select the object again to toggle its selection status.
 
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

canvas

ObjectCanvas canvas

target

FigObject target

isSelected

boolean isSelected
Constructor Detail

SelectObjectCommand

public SelectObjectCommand(Editor editor)
Method Detail

execute

public void execute()
toggle the selection status of the selected 'target' object. For normal FigObjects and SimObject Symbols, we just select/deselect the one object. For Signal WireSegments and SolderDots, however, we select/deselect all WireSegments and SolderDots of that Signal.

Overrides:
execute in class Command

undo

public void undo()
undo: do nothing, the user can easily select the object again to toggle its selection status.

Overrides:
undo in class Command

mousePressed

public void mousePressed(FigCanvasEvent ME)
Description copied from interface: FigCanvasListener
process a mouse event ME at world coordinates WP and screen coords SP

Specified by:
mousePressed in interface FigCanvasListener
Overrides:
mousePressed in class Command

setPosition

public void setPosition(java.awt.Point SP,
                        java.awt.Point WP)
find the object at the mouse position and toggle its selection state.

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