http://www.jpicedt.org

jpicedt.graphic
Class AbstractSelectionHandler

java.lang.Object
  extended by jpicedt.graphic.AbstractSelectionHandler
All Implemented Interfaces:
Iterable<Element>, Collection<Element>, SelectionHandler

public abstract class AbstractSelectionHandler
extends Object
implements SelectionHandler

Provides some basic implementation of the SelectionHandler interface. This implementation is based on invokations of Collection's methods. 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.

Since:
jpicedt 1.3.2
Version:
$Id: AbstractSelectionHandler.java,v 1.11 2013/03/27 07:07:37 vincentb1 Exp $
Author:
Sylvain Reynal

Constructor Summary
AbstractSelectionHandler()
           
 
Method Summary
 Element[] asArray()
          Return the selected elements wrapped in an array (may be a convenience call to asCollection)
 void delete(Drawing d)
          Delete all selected Element's from the given Drawing, and remove the reference to them from this SelectionHandler.
 void replace(Element e)
          Replace the current selection with the given element.
 void selectAll(Drawing d)
          Select 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, getCtrlPtSubset, replace
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractSelectionHandler

public AbstractSelectionHandler()
Method Detail

asArray

public Element[] asArray()
Return the selected elements wrapped in an array (may be a convenience call to asCollection)

Specified by:
asArray in interface SelectionHandler

selectAll

public void selectAll(Drawing d)
Select all Element's in the given drawing.

Specified by:
selectAll in interface SelectionHandler

replace

public void replace(Element e)
Replace the current selection with the given element.

Specified by:
replace in interface SelectionHandler

delete

public void delete(Drawing d)
Delete all selected Element's from the given Drawing, and remove the reference to them from this SelectionHandler.

Specified by:
delete in interface SelectionHandler

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org