|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdiva.canvas.interactor.BasicSelectionModel
A basic implementation of the SelectionModel interface. This model requires that each object in the selection be an instance of Figure. When each item is added to the selection, the model gets its interactor, and if it is an instance of SelectionInteractor, gets a selection renderer from the interactor and uses it to highlight the selected figures.
| Field Summary |
| Fields inherited from interface diva.canvas.interactor.SelectionModel |
MULTIPLE_SELECTION, SINGLE_SELECTION |
| Constructor Summary | |
BasicSelectionModel()
Construct an empty selection. |
|
| Method Summary | |
void |
addSelection(java.lang.Object sel)
Add an object to the selection. |
void |
addSelectionListener(SelectionListener l)
Add a selection listener to this model. |
void |
addSelections(java.lang.Object[] sels)
Add an array of objects to the selection and highlight the selected objects. |
void |
clearSelection()
Clear the selection. |
boolean |
containsSelection(java.lang.Object sel)
Test if the selection contains the given object |
void |
dispatchSelectionEvent(SelectionEvent e)
Dispatch a selection event to all registered listeners |
java.lang.Object |
getFirstSelection()
Return the first selection in the list. |
java.lang.Object |
getLastSelection()
Return the last selection in the list. |
java.util.Iterator |
getSelection()
Return an iterator over the selected objects. |
java.lang.Object[] |
getSelectionAsArray()
Return the contents of the selection as an array. |
int |
getSelectionCount()
Return the number of selected objects. |
int |
getSelectionMode()
Return the mode of the selection, either SINGLE_SELECTION or MULTIPLE_SELECTION. |
void |
removeSelection(java.lang.Object sel)
Remove an object from the selection. |
void |
removeSelectionListener(SelectionListener l)
Remove a listener from the list of listeners. |
void |
setSelectionMode(int mode)
Set the selection mode, either SINGLE_SELECTION or MULTIPLE_SELECTION. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BasicSelectionModel()
| Method Detail |
public void addSelectionListener(SelectionListener l)
addSelectionListener in interface SelectionModelpublic void addSelection(java.lang.Object sel)
addSelection in interface SelectionModelpublic void addSelections(java.lang.Object[] sels)
addSelections in interface SelectionModelpublic void clearSelection()
clearSelection in interface SelectionModelpublic boolean containsSelection(java.lang.Object sel)
containsSelection in interface SelectionModelpublic void dispatchSelectionEvent(SelectionEvent e)
public java.lang.Object getFirstSelection()
getFirstSelection in interface SelectionModelpublic java.lang.Object getLastSelection()
getLastSelection in interface SelectionModelpublic java.util.Iterator getSelection()
getSelection in interface SelectionModelpublic java.lang.Object[] getSelectionAsArray()
getSelectionAsArray in interface SelectionModelpublic int getSelectionCount()
getSelectionCount in interface SelectionModelpublic int getSelectionMode()
getSelectionMode in interface SelectionModelpublic void removeSelection(java.lang.Object sel)
removeSelection in interface SelectionModelpublic void removeSelectionListener(SelectionListener l)
removeSelectionListener in interface SelectionModelpublic void setSelectionMode(int mode)
setSelectionMode in interface SelectionModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||