Class AbstractSegmentHandlePart<N extends javafx.scene.Node>

Type Parameters:
N - The type of visual used by this handle. Needs to be a sub-type of Node.
All Implemented Interfaces:
Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>, IActivatable, IAdaptable, IAdaptable.Bound<IViewer>, IDisposable, IHandlePart<N>, IVisualPart<N>
Direct Known Subclasses:
CircleSegmentHandlePart, RectangleSegmentHandlePart, SquareSegmentHandlePart

public abstract class AbstractSegmentHandlePart<N extends javafx.scene.Node> extends AbstractHandlePart<N> implements Comparable<AbstractSegmentHandlePart<? extends javafx.scene.Node>>
An AbstractSegmentHandlePart is bound to a segment of a poly-bezier handle geometry, represented by an array of BezierCurves. The segmentIndex of the AbstractSegmentHandlePart identifies that segment (0, 1, 2, ...). The segmentParameter specifies the position of this handle part on the segment (0 = start, 0.5 = mid, 1 = end).
  • Constructor Details

    • AbstractSegmentHandlePart

      public AbstractSegmentHandlePart()
  • Method Details

    • compareTo

      public int compareTo(AbstractSegmentHandlePart<? extends javafx.scene.Node> o)
      Specified by:
      compareTo in interface Comparable<N extends javafx.scene.Node>
    • doRefreshVisual

      public void doRefreshVisual(N visual)
      Description copied from class: AbstractVisualPart
      Refreshes this part's visualization based on this part's content.
      Specified by:
      doRefreshVisual in class AbstractVisualPart<N extends javafx.scene.Node>
      Parameters:
      visual - This part's visual.
    • getBezierSegmentInParent

      protected BezierCurve getBezierSegmentInParent()
      Returns the BezierCurve at which this handle part is anchored (depending on segment index), or null if that BezierCurve cannot be determined.
      Returns:
      The BezierCurve at which this handle part is anchored, or null if that BezierCurve cannot be determined.
    • getConnectedFill

      protected javafx.scene.paint.Color getConnectedFill()
      Returns the Color that is used to fill connected handles.
      Returns:
      The Color that is used to fill connected handles.
    • getInsertFill

      protected javafx.scene.paint.Color getInsertFill()
      Returns the Color that is used to fill insertion handles.
      Returns:
      The Color that is used to fill insertion handles.
    • getMoveFill

      protected javafx.scene.paint.Color getMoveFill()
      Returns the Color that is used to fill movement handles.
      Returns:
      The Color that is used to fill movement handles.
    • getPosition

      protected Point getPosition(BezierCurve segment)
      Returns the position of this AbstractSegmentHandlePart on the given segment using the segment parameter that is assigned to this part.
      Parameters:
      segment - The BezierCurve on which the position is evaluated.
      Returns:
      The position of this part on the given segment using the segment parameter of this part.
    • getSegmentCount

      public int getSegmentCount()
      Returns the number of segments that are provided to this part.
      Returns:
      The number of segments that are provided to this part.
    • getSegmentIndex

      public int getSegmentIndex()
      The segmentIndex specifies the segment of the IGeometry provided by the handle geometry provider on which this selection handle part is positioned. For a shape geometry, segments are determined by the IShape.getOutlineSegments() method. For a curve geometry, segments are determined by the ICurve.toBezier() method. The exact position on the segment is specified by the segmentParameter.
      Returns:
      segmentIndex
    • getSegmentParameter

      public double getSegmentParameter()
      The segmentParameter is a value between 0 and 1. It determines the final point on the segment which this selection handle part belongs to.
      Returns:
      segmentParameter
    • getSegmentsInScene

      protected BezierCurve[] getSegmentsInScene()
      Returns the BezierCurves that are provided to this part in the coordinate system of the Scene.
      Returns:
      The BezierCurves that are provided to this part in the coordinate system of the Scene.
    • getStroke

      protected javafx.scene.paint.Color getStroke()
      Returns the Color that is used to stroke handles.
      Returns:
      The Color that is used to stroke handles.
    • setSegmentIndex

      public void setSegmentIndex(int segmentIndex)
      Sets the segment index and refreshes the visual.
      Parameters:
      segmentIndex - The segment index to set.
      See Also:
    • setSegmentParameter

      public void setSegmentParameter(double segmentParameter)
      Sets the segment parameter and refreshes the visual.
      Parameters:
      segmentParameter - The segment parameter to set.
      See Also:
    • setSegmentsProvider

      public void setSegmentsProvider(Provider<BezierCurve[]> segmentsProvider)
      Sets the Provider<BezierCurve[]> for this part to the given value.
      Parameters:
      segmentsProvider - The new Provider<BezierCurve[]> for this part.
    • updateLocation

      protected void updateLocation(N visual)
      Computes the location for this part and relocates its visual to that location. The visual is made invisible if this part has an invalid index (out of bounds), i.e. when no location can be computed.
      Parameters:
      visual - This part's visual for convenience.