|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.biologica.ui.SelectionSet
A selection set, an object which manages a set of selected engine objects, notifies listeners that the selection set has changed, etc. A script may create a selection set and then assign it to one or more views. Those views will then reflect the state of the selection set in that the correct object(s) will be selected, etc.
An object of this class will generate the following property change events:
UIProp.SELECTED_OBJECTS
,
PropertyChangeListener
Field Summary | |
protected java.beans.PropertyChangeSupport |
changes
Utility object which manages property change events and listeners. |
static int |
SELECTION_MODE_MULTIPLE_OBJECTS
Normal, multiple object selection mode. |
static int |
SELECTION_MODE_ONE_OBJECT
Single objects selection mode. |
static int |
SELECTION_MODE_TWO_OBJECTS
Two object selection mode. |
static int |
SELECTION_MODE_TWO_ORGANISMS_OPPOSITE_SEXES
Two organism, mixed gender selection mode. |
static int |
SELECTION_MODE_ZERO_OBJECTS
Zero objects selection mode. |
Constructor Summary | |
SelectionSet()
Creates a new, empty selection set. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Add a property change listener for properties. |
void |
addSelectionPresenter(SelectionPresenter aSelectionPresenter)
Add a selection presenter |
boolean |
contains(EngineObject anObject)
Returns whether or not this selection set contains the given object. |
void |
deselectAllObjects()
Deselect all objects |
void |
deselectObject(EngineObject anObject)
Deselect the given object. |
static SelectionSet |
getDefaultSelectionSet()
Get default selection set |
int |
getNumberOfSelectedObjects()
Get the number of selected objects in this view. |
EngineObject |
getSelectedObjectAtIndex(int index)
Get the selected object at the given index in the selection set. |
java.util.Enumeration |
getSelectedObjects()
Get the set of selected objects in this view. |
int |
getSelectionMode()
Get the current selection mode. |
java.util.Enumeration |
getSelectionPresenters()
Get the selection presenters |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle property change events |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
Remove a property change listener for properties. |
boolean |
removeSelectionPresenter(SelectionPresenter aSelectionPresenter)
Remove a selection presenter |
void |
selectObject(EngineObject anObject,
boolean aShiftDown,
boolean aControlDown)
Select an object. |
static void |
setDefaultSelectionSet(SelectionSet selectionSet)
Set default selection set |
void |
setSelectionMode(int aSelectionMode)
Set the current selection mode. |
void |
updatePresenters()
Update the selection presenters because the selection changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int SELECTION_MODE_ZERO_OBJECTS
public static final int SELECTION_MODE_ONE_OBJECT
public static final int SELECTION_MODE_TWO_OBJECTS
public static final int SELECTION_MODE_TWO_ORGANISMS_OPPOSITE_SEXES
public static final int SELECTION_MODE_MULTIPLE_OBJECTS
protected transient java.beans.PropertyChangeSupport changes
Constructor Detail |
public SelectionSet()
Method Detail |
public static SelectionSet getDefaultSelectionSet()
public static void setDefaultSelectionSet(SelectionSet selectionSet)
selectionSet
- SelectionSet - new default selection setpublic void selectObject(EngineObject anObject, boolean aShiftDown, boolean aControlDown)
If extendSelect is false, then all other organisms will be deselected first.
If anOrganism is null and extendSelect is true, then do nothing.
If anOrganism is null and extendSelect is false, deselect everything.
If anOrganism is not null but the organism is not in this view, then this method will return without doing anything.
anObject
- EngineObject - an object to select, may be nullaShiftDown
- boolean - shift key downaControlDown
- boolean - control key downjava.lang.IllegalArgumentException
- - input organism not already in viewpublic void deselectObject(EngineObject anObject)
anObject
- EngineObject - an object to deselect, may be nullpublic void deselectAllObjects()
public void updatePresenters()
public int getNumberOfSelectedObjects()
public java.util.Enumeration getSelectedObjects()
public EngineObject getSelectedObjectAtIndex(int index)
index
- int - selected object index (zero based)public boolean contains(EngineObject anObject)
boolean
- - returns true of object in selected set, else falsepublic int getSelectionMode()
public void setSelectionMode(int aSelectionMode)
aSelectionMode
- int - a new selection modepublic java.util.Enumeration getSelectionPresenters()
Enumeration
- of SelectionPresenter objectspublic void addSelectionPresenter(SelectionPresenter aSelectionPresenter)
aSelectionPresenter
- SelectionPresenter - a selection presenterpublic boolean removeSelectionPresenter(SelectionPresenter aSelectionPresenter)
aSelectionPresenter
- SelectionPresenter - a selection presenterpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- PropertyChangeEvent - the property change eventpublic void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
aListener
- PropertyChangeListener - a new listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
aListener
- PropertyChangeListener - a listener to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |