Package jpicedt.graphic.toolkit
Class EditPointMouseTransformFactory.SelectedPointsHandler
- java.lang.Object
-
- jpicedt.graphic.toolkit.EditPointMouseTransformFactory.SelectedPointsHandler
-
- Enclosing class:
- EditPointMouseTransformFactory
protected class EditPointMouseTransformFactory.SelectedPointsHandler extends java.lang.ObjectHelper class for SelectPointsInAreaTransform. This is a typesafe container for ONE Element and the indices of its selected-pointsIndices are ALWAYS sorted in descending order : this helps e.g. RemovePointTransform removing curve's points starting from the end (this is made necessary so as to preserve the meaning of yet-to-be-removed points indices ; removing points starting from index "0" would surely lead to odd behaviour since ensuing indices would be shifted to the "left").
-
-
Constructor Summary
Constructors Constructor Description SelectedPointsHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()clears the state of this handler by removing the reference to the current Element and its selected pointsElementgetElement()returns the current target ElementintgetSelectionSize()return the number of selected points for the current elementjava.util.IteratorindexIterator()return an Iterator over the set of selected-points indices (wrapped in Integer's)booleanisSelected(int idx)Returns true if the point with the given index is selected.booleanisSelected(HitInfo.Point hip)Return true if at least one point in the given HitInfo.Point is selectedvoidselectPoint(int idx)adds the given point index to the selectionvoidsetElement(Element e)sets the current Element and clears the list of selected-pointsjava.lang.StringtoString()voidunSelectPoint(int idx)removes the given point index to the selection
-
-
-
Method Detail
-
clear
public void clear()
clears the state of this handler by removing the reference to the current Element and its selected points
-
setElement
public void setElement(Element e)
sets the current Element and clears the list of selected-points
-
getElement
public Element getElement()
returns the current target Element
-
selectPoint
public void selectPoint(int idx)
adds the given point index to the selection
-
unSelectPoint
public void unSelectPoint(int idx)
removes the given point index to the selection
-
isSelected
public boolean isSelected(int idx)
Returns true if the point with the given index is selected.
-
isSelected
public boolean isSelected(HitInfo.Point hip)
Return true if at least one point in the given HitInfo.Point is selected
-
getSelectionSize
public int getSelectionSize()
return the number of selected points for the current element
-
indexIterator
public java.util.Iterator indexIterator()
return an Iterator over the set of selected-points indices (wrapped in Integer's)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-