hades.gui
Class SelectRegionCommand

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

SelectRegionCommand - select an object (SimObject/Signal) in a HADES Design.

See Also:
Serialized Form

Field Summary
(package private)  java.util.Hashtable candidates
           
(package private)  ObjectCanvas canvas
           
(package private)  java.awt.Point P1
           
(package private)  java.awt.Point P2
           
(package private)  Selection selection
           
 
Fields inherited from class hades.gui.Command
console, debug, editor, ready, versionString
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
SelectRegionCommand(Editor editor)
           
 
Method Summary
 void execute()
          select all objects in the region spanned by P1 and P2, and register this command with the UndoStack.
 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 should be called twice for a select region command, to specify the opposite corners of the region to select.
 java.lang.String toString()
           
 void undo()
          currently, no explicit undo is possible for a SelectRegionCommand.
 
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

P1

java.awt.Point P1

P2

java.awt.Point P2

canvas

ObjectCanvas canvas

candidates

java.util.Hashtable candidates

selection

Selection selection
Constructor Detail

SelectRegionCommand

public SelectRegionCommand(Editor editor)
Method Detail

execute

public void execute()
select all objects in the region spanned by P1 and P2, and register this command with the UndoStack. For Signals, we use the following: If all WireSegments and SolderDots of the Signal are in the selected region, the Signal is selected/ deselected.

Overrides:
execute in class Command

undo

public void undo()
currently, no explicit undo is possible for a SelectRegionCommand. If necessary, simple select the same region again, which will toggle the selection state for all objects inside the region.

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 should be called twice for a select region command, to specify the opposite corners of the region to select.

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