Class EditPointMouseTransformFactory.SelectedPointsHandler

  • Enclosing class:
    EditPointMouseTransformFactory

    protected class EditPointMouseTransformFactory.SelectedPointsHandler
    extends java.lang.Object
    Helper class for SelectPointsInAreaTransform. This is a typesafe container for ONE Element and the indices of its selected-points

    Indices 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").

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      clears the state of this handler by removing the reference to the current Element and its selected points
      Element getElement()
      returns the current target Element
      int getSelectionSize()
      return the number of selected points for the current element
      java.util.Iterator indexIterator()
      return an Iterator over the set of selected-points indices (wrapped in Integer's)
      boolean isSelected​(int idx)
      Returns true if the point with the given index is selected.
      boolean isSelected​(HitInfo.Point hip)
      Return true if at least one point in the given HitInfo.Point is selected
      void selectPoint​(int idx)
      adds the given point index to the selection
      void setElement​(Element e)
      sets the current Element and clears the list of selected-points
      java.lang.String toString()  
      void unSelectPoint​(int idx)
      removes the given point index to the selection
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SelectedPointsHandler

        public SelectedPointsHandler()
    • 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:
        toString in class java.lang.Object