|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjpicedt.graphic.AbstractSelectionHandler
public abstract class AbstractSelectionHandler
Provides some basic implementation of the SelectionHandler interface.
This implementation merely targets methods that can access or modify the content
of the SelectionHandler via the asCollection()
method, hence the latter
method is left unimplemented here.
Besides, no storage mechanism is implemented in this abstract class.
Concrete implementation of this mechanism should be based on mutable Java Collection's, otherwise
selection operation will fail.
Finally, the content of the selection-handler is supposed to reflect the z-ordering of the
Drawing
it is
associated with. This abstract implementation does not take care of this.
Constructor Summary | |
---|---|
AbstractSelectionHandler()
|
Method Summary | |
---|---|
void |
addToSelection(Element e)
Add the given Element to the current selection. |
Element[] |
asArray()
Return the selected elements wrapped in an array. |
abstract Collection |
asCollection()
Return the selected elements wrapped in a Collection |
void |
delete(Drawing d)
Delete all selected Element's from the given Drawing, and remove the reference to them from this SelectionHandler. |
Iterator |
elements()
Return an iterator over the selected Element's. |
boolean |
isSelected(Element e,
boolean includeAncestors)
Return whether the given Element is selected or not. |
void |
replaceSelection(Element e)
Replace the current selection with the given element. |
void |
selectAll(Drawing d)
Select all Element's in the given drawing. |
int |
size()
Return the number of selected objects. |
void |
unSelect(Element e)
Unselect the given Element, i.e. |
void |
unSelectAll()
Unselect all Element's in the given drawing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jpicedt.graphic.SelectionHandler |
---|
containsClass, createFilteredCollection |
Constructor Detail |
---|
public AbstractSelectionHandler()
Method Detail |
---|
public int size()
asCollection()
.
size
in interface SelectionHandler
public Iterator elements()
asCollection()
.
elements
in interface SelectionHandler
public abstract Collection asCollection()
asCollection
in interface SelectionHandler
public Element[] asArray()
asCollection()
.
asArray
in interface SelectionHandler
public boolean isSelected(Element e, boolean includeAncestors)
asCollection()
.
isSelected
in interface SelectionHandler
includeAncestors
- if true, return true if this Element or one of its ancestors is selected.public void selectAll(Drawing d)
selectAll
in interface SelectionHandler
public void unSelectAll()
asCollection()
.
unSelectAll
in interface SelectionHandler
public void addToSelection(Element e)
asCollection()
.
addToSelection
in interface SelectionHandler
public void replaceSelection(Element e)
replaceSelection
in interface SelectionHandler
public void unSelect(Element e)
asCollection()
.
unSelect
in interface SelectionHandler
public void delete(Drawing d)
delete
in interface SelectionHandler
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |