Package uk.ac.starlink.topcat.plot
Class OrderedSelectionRecorder
java.lang.Object
uk.ac.starlink.topcat.plot.OrderedSelectionRecorder
- All Implemented Interfaces:
EventListener
,ListSelectionListener
ListSelectionListener implementation which can tell you what order
items have been selected in.
- Since:
- 16 Jun 2004
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new recorder with no items selected.OrderedSelectionRecorder
(boolean[] state) Constructs a new recorder with a given initial state. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean[]
Returns the state of the selection model given the source of a selection event.int[]
Returns a list of the currently-selected indices in the selection model in the order in which they were (most recently) added to the selection.void
updateState
(boolean[] state) Sets the new selection state.void
-
Constructor Details
-
OrderedSelectionRecorder
public OrderedSelectionRecorder()Constructs a new recorder with no items selected. -
OrderedSelectionRecorder
public OrderedSelectionRecorder(boolean[] state) Constructs a new recorder with a given initial state.- Parameters:
state
- mask of flags, one true for each selected item
-
-
Method Details
-
getOrderedSelection
public int[] getOrderedSelection()Returns a list of the currently-selected indices in the selection model in the order in which they were (most recently) added to the selection.- Returns:
- ordered selection model indices
-
valueChanged
- Specified by:
valueChanged
in interfaceListSelectionListener
-
updateState
public void updateState(boolean[] state) Sets the new selection state.- Parameters:
state
- mask of flags, one true for each selected item
-
getModelState
protected abstract boolean[] getModelState()Returns the state of the selection model given the source of a selection event.- Returns:
- mask of flags, one true for each selected item
-