|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface of the object which manages selected objects. If a class wants to modify the selection, it has to implement the tagging interface 'SelectionModifier'. Thus, a certain control over who modifies it can be maintained. Listeners can register themselves to be notified of selection changes (observer pattern).
Method Summary | |
void |
add(SelectionListener l)
Adds a listener |
void |
addElement(Component element,
SelectionModifier sm)
Adds a component to the selection |
void |
clear(SelectionModifier sm)
Removes all components from the selection. |
Component |
getSelectedComponent()
If exactly one component is selected, this component is returned, else null. |
Iterator |
getSelectionIterator()
Returns an iterator over the components in the selection. |
Shape |
getShape()
Returns the shape of the selection |
boolean |
hasElement(Component element)
Returns whether a certain component is contained in the selection |
void |
remove(SelectionListener l)
Removes a listener |
void |
removeElement(Component element,
SelectionModifier sm)
Removes a component from the selection |
void |
replaceWith(Component element,
SelectionModifier sm)
Replaces the current selection with another component |
Method Detail |
public void add(SelectionListener l)
l
- the listenerpublic void remove(SelectionListener l)
l
- the listenerpublic Iterator getSelectionIterator()
public Component getSelectedComponent()
public Shape getShape()
public void addElement(Component element, SelectionModifier sm)
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')public void removeElement(Component element, SelectionModifier sm)
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')public void replaceWith(Component element, SelectionModifier sm)
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')public void clear(SelectionModifier sm)
sm
- the object that wants to modify the selection (a small 'proof')public boolean hasElement(Component element)
element
- the component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |