|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.graphics.java2d.Component | +--fdda.graphics.java2d.Container | +--fdda.graphics.java2d.ComponentSelection
Implementation of the selection interface as a Container subclass.
Nested Class Summary | |
(package private) class |
ComponentSelection.SelectionIterator
An iterator on the selection, not allowing any modifications. |
Field Summary |
Fields inherited from class fdda.graphics.java2d.Container |
elements |
Fields inherited from class fdda.graphics.java2d.Component |
COLOR_NORMAL, COLOR_SELECTED, dirtyShape, selected, shape, x, y |
Fields inherited from interface fdda.graphics.Component |
SEL_ALL, SEL_EQUALS, SEL_MOVABLES, SEL_NOTHING |
Constructor Summary | |
ComponentSelection()
Constructor. |
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. |
protected void |
fireSelectionChanged()
Informs the listeners that the selection has changed |
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. |
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 |
Methods inherited from class fdda.graphics.java2d.Container |
addElement, calcShape, clear, clone, deselect, draw, flatten, getIterator, getSize, getX, getY, hasElement, isFlatteningAllowed, isMovable, move, removeElement, select, selectableWith, setGraphicalSystem, visit |
Methods inherited from class fdda.graphics.java2d.Component |
getGraphicalSystem, getShape, isSelected, recalculateShape, setGraphicalSystem, setXY |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fdda.graphics.Selection |
getShape, hasElement |
Methods inherited from interface fdda.graphics.Component |
getGraphicalSystem, getShape, isSelected, recalculateShape, setGraphicalSystem, setXY |
Constructor Detail |
public ComponentSelection()
Method Detail |
public void add(SelectionListener l)
Selection
add
in interface Selection
l
- the listenerpublic void remove(SelectionListener l)
Selection
remove
in interface Selection
l
- the listenerprotected final void fireSelectionChanged()
public Iterator getSelectionIterator()
Selection
getSelectionIterator
in interface Selection
public Component getSelectedComponent()
Selection
getSelectedComponent
in interface Selection
public void addElement(Component element, SelectionModifier sm)
Selection
addElement
in interface Selection
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')public void removeElement(Component element, SelectionModifier sm)
Selection
removeElement
in interface Selection
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')public void clear(SelectionModifier sm)
Selection
clear
in interface Selection
sm
- the object that wants to modify the selection (a small 'proof')public void replaceWith(Component element, SelectionModifier sm)
Selection
replaceWith
in interface Selection
element
- the componentsm
- the object that wants to modify the selection (a small 'proof')
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |