hades.utils
Class Selection

java.lang.Object
  extended byhades.utils.Selection

public class Selection
extends java.lang.Object

keep track of selected objects.

Selection: a class to manage object selection in the HADES editor. At the moment, this class uses a Hashtable to store the selected objects. Except for the selectToggle() and print() methods it provides little additional value.

You can put any object into the Selection, but the corresponding editor functions for cut/copy/paste mostly expect graphical FigObjects like SimObject Symbols or WireSegments.

To get a reference to the current Editor selection, use the getSelection() method in class hades.gui.Editor.


Constructor Summary
Selection()
          create a new and initially empty Selection.
 
Method Summary
 void add(java.lang.Object o)
          add an object to this Selection.
 java.util.Enumeration elements()
          return an Enumeration of all objects in this Selection.
 java.lang.String print()
          return a String with all currently selected objects.
 void remove(java.lang.Object o)
          deselect Object o.
 void removeAll()
          deselect all objects.
 boolean toggle(java.lang.Object o)
          toggle the Selection status for Object o.
 java.lang.String toString()
          the usual info method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Selection

public Selection()
create a new and initially empty Selection.

Method Detail

add

public void add(java.lang.Object o)
add an object to this Selection.


toggle

public boolean toggle(java.lang.Object o)
toggle the Selection status for Object o. This method returns whether the object is contained in the Selection after the toggling.


remove

public void remove(java.lang.Object o)
deselect Object o.


removeAll

public void removeAll()
deselect all objects.


elements

public java.util.Enumeration elements()
return an Enumeration of all objects in this Selection.


print

public java.lang.String print()
return a String with all currently selected objects.


toString

public java.lang.String toString()
the usual info method. We also print the number of currently selected objects.