|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.yospace.yae.yogi.DefaultSelectionModel
Default implementation of the SelectionModel
interface. Selections are stored as intervals in order to minimise the expense
of storing large numbers of selections. Selection modes can be set using the
constants provided in the SelectionModel interface.
| Fields inherited from interface com.yospace.yae.yogi.SelectionModel |
SELECTION_MODE_MULTIPLE_INTERVAL, SELECTION_MODE_NONE, SELECTION_MODE_SINGLE, SELECTION_MODE_SINGLE_INTERVAL |
| Constructor Summary | |
DefaultSelectionModel()
Default constructor. |
|
DefaultSelectionModel(int selectionMode)
Constructor initialising the selection model to a specified mode |
|
| Method Summary | |
int[] |
clearSelections()
Clears all selections in the selection model. |
int |
getMaxSelectionIndex()
Gets the highest index currently selected. |
int |
getMinSelectionIndex()
Gets the lowest index currently selected. |
int |
getSelectedIndex()
Returns an int denoting the index currently selected, or -1 if none are selected. |
int[] |
getSelectedIndices()
Returns an int array containing all currently selected elements. |
int |
getSelectionMode()
Gets the current selection mode, will be one of: SelectionModel.SELECTION_MODE_NONE,
SelectionModel.SELECTION_MODE_SINGLE,
SelectionModel.SELECTION_MODE_SINGLE_INTERVAL. |
boolean |
isSelected(int index)
Returns the selection status of a specified element. |
void |
removeSelection(int index)
Removes a specified selection from the selection model. |
void |
removeSelections(int[] indices)
Removes the specified selections from the selection model. |
int[] |
setSelectedIndex(int index,
boolean selected,
int listSize)
Sets the element specified by index to the specified boolean state. |
int[] |
setSelectedIndices(int[] indices,
boolean selected,
int listSize)
Sets the element specified by index to the specified boolean state. |
void |
setSelectionMode(int selectionMode)
Sets the selection mode. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultSelectionModel()
public DefaultSelectionModel(int selectionMode)
selectionMode - the selection mode.| Method Detail |
public int getSelectionMode()
SelectionModel.SELECTION_MODE_NONE,
SelectionModel.SELECTION_MODE_SINGLE,
SelectionModel.SELECTION_MODE_SINGLE_INTERVAL.
SelectionModel.SELECTION_MODE_MULTIPLE_INTERVAL.getSelectionMode in interface SelectionModelpublic void setSelectionMode(int selectionMode)
SelectionModel.SELECTION_MODE_NONE,
SelectionModel.SELECTION_MODE_SINGLE,
SelectionModel.SELECTION_MODE_SINGLE_INTERVAL.
SelectionModel.SELECTION_MODE_MULTIPLE_INTERVAL.
NB. Calling this method may alter the contents of the selection model.
For example, if multiple intervals are selected and the mode then set
to single selection, all the intervals other than that at index 0 will
be deleted.setSelectionMode in interface SelectionModelselectionMode - the new selection modepublic int getMinSelectionIndex()
getMinSelectionIndex in interface SelectionModelpublic int getMaxSelectionIndex()
getMaxSelectionIndex in interface SelectionModelpublic boolean isSelected(int index)
isSelected in interface SelectionModelindex - the specified element.public int getSelectedIndex()
getSelectedIndex in interface SelectionModelpublic int[] getSelectedIndices()
getSelectedIndices in interface SelectionModel
public int[] setSelectedIndex(int index,
boolean selected,
int listSize)
setSelectedIndex in interface SelectionModelindex - element to setselected - the state to set the element tolistSize - size of the list
public int[] setSelectedIndices(int[] indices,
boolean selected,
int listSize)
setSelectedIndices in interface SelectionModelindices - elements to setselected - the state to set the element tolistSize - size of the listpublic int[] clearSelections()
clearSelections in interface SelectionModelpublic void removeSelection(int index)
removeSelection in interface SelectionModelindex - the index of the selection being removedpublic void removeSelections(int[] indices)
indices - the indices of the selections to remove.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||