http://www.jpicedt.org

jpicedt.graphic
Interface SelectionHandler

All Superinterfaces:
Collection<Element>, Iterable<Element>
All Known Implementing Classes:
AbstractSelectionHandler, DefaultSelectionHandler

public interface SelectionHandler
extends Collection<Element>

a SelectionHandler allows to manage selection-related behaviours for a given instance of Drawing. Concrete implementation may generally want to store references on selected Element's here. This may be easily carried out by relying on Java's collection framework, hence we have specified some useful methods here for this purpose.

Since:
jpicedt 1.3.2
Version:
$Id: SelectionHandler.java,v 1.15 2013/03/27 07:00:33 vincentb1 Exp $
Author:
Sylvain Reynal

Method Summary
 Element[] asArray()
          Return the selected elements wrapped in an array (may be a convenience call to asCollection)
 boolean containsClass(Class<? extends Element> clazz)
          Returns whether this selection-handler contains objects that are of the same type of inherit from the given clazz.
<T extends Element>
ArrayList<T>
createFilteredCollection(Class<T> clazz)
          Returns a list containing elements in the selection that are of the same type or inherit the given clazz.
 void delete(Drawing d)
          Delete all selected Element's from the given Drawing
 CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg, BitSet czExtension)
           
 void replace(Element e)
          Replace the current selection with the given element.
 void replace(Element oldE, Element newE)
          Remplace l'élément oldE par l'élément newE lorsque oldE appartient à la sélection.
 void selectAll(Drawing d)
          Select all Element's belonging to the given Drawing.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

asArray

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


getCtrlPtSubset

CtrlPtSubset getCtrlPtSubset(ConvexZoneGroup csg,
                             BitSet czExtension)
Since:
jPicEdt 1.6
See Also:
jpicedt.graphic.model

selectAll

void selectAll(Drawing d)
Select all Element's belonging to the given Drawing.


replace

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


replace

void replace(Element oldE,
             Element newE)
Remplace l'élément oldE par l'élément newE lorsque oldE appartient à la sélection. Sans effet si newE est déjà dans la sélection. L'ordre dans la collection n'est pas conservé.

Parameters:
oldE - l'Element à remplacer.
newE - l'Element qui sert de remplacement.

delete

void delete(Drawing d)
Delete all selected Element's from the given Drawing


createFilteredCollection

<T extends Element> ArrayList<T> createFilteredCollection(Class<T> clazz)
Returns a list containing elements in the selection that are of the same type or inherit the given clazz.


containsClass

boolean containsClass(Class<? extends Element> clazz)
Returns whether this selection-handler contains objects that are of the same type of inherit from the given clazz.

Since:
jpicedt 1.4pre5

http://www.jpicedt.org

Submit a bug : syd@jpicedt.org