Class PathBuilder


  • public class PathBuilder
    extends Object
    The path builder is used to compute path nodes for instances of type ActivityLink. It is only used by the LinksPane.
    Since:
    1.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PathBuilder.ArrowDirection
      An enum listing the various directions the arrow can be painted.
      static class  PathBuilder.TargetLocation
      An enumerator of possible locations that the target object can have relative to the source object.
    • Constructor Summary

      Constructors 
      Constructor Description
      PathBuilder()
      Constructs a new path calculator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathEndToEnd​(Rectangle2D sourceRect, Rectangle2D targetRect)
      Builds a path in the given graphics context from the end of the source rectangle to the end of the target rectangle.
      impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathEndToStart​(Rectangle2D sourceRect, Rectangle2D targetRect)
      Builds a path in the given graphics context from the end of the source rectangle to the start of the target rectangle.
      impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathStartToEnd​(Rectangle2D sourceRect, Rectangle2D targetRect)
      Builds a path in the given graphics context from the start of the source rectangle to the end of the target rectangle.
      impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathStartToStart​(Rectangle2D sourceRect, Rectangle2D targetRect)
      Builds a path in the given graphics context from the start of the source rectangle to the start of the target rectangle.
      double getCurve()
      Returns the radius of the curve.
      double getGap()
      The gap determines how far the line is drawn away from the bounds of the source or target timeline object.
      double getOffset()
      The offset determines the end location of the first segment of the calculated path.
      void setCurve​(double curve)
      Sets the radius for the curve.
      void setGap​(double gap)
      The gap determines how far the line is drawn away from the bounds of the source or target timeline object.
      void setOffset​(double offset)
      The offset determines the end location of the first segment of the calculated path.
    • Constructor Detail

      • PathBuilder

        public PathBuilder()
        Constructs a new path calculator.
        Since:
        1.0
    • Method Detail

      • buildPathStartToStart

        public impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathStartToStart​(Rectangle2D sourceRect,
                                                                                                      Rectangle2D targetRect)
        Builds a path in the given graphics context from the start of the source rectangle to the start of the target rectangle.
        Parameters:
        sourceRect - the source rectangle
        targetRect - the target rectangle
        Returns:
        the result path
        Since:
        1.0
      • buildPathEndToEnd

        public impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathEndToEnd​(Rectangle2D sourceRect,
                                                                                                  Rectangle2D targetRect)
        Builds a path in the given graphics context from the end of the source rectangle to the end of the target rectangle.
        Parameters:
        sourceRect - the source rectangle
        targetRect - the target rectangle
        Returns:
        the result path
        Since:
        1.0
      • buildPathStartToEnd

        public impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathStartToEnd​(Rectangle2D sourceRect,
                                                                                                    Rectangle2D targetRect)
        Builds a path in the given graphics context from the start of the source rectangle to the end of the target rectangle.
        Parameters:
        sourceRect - the source rectangle
        targetRect - the target rectangle
        Returns:
        the result path
        Since:
        1.0
      • buildPathEndToStart

        public impl.com.flexganttfx.skin.graphics.PathBuilder.PathBuilderResult buildPathEndToStart​(Rectangle2D sourceRect,
                                                                                                    Rectangle2D targetRect)
        Builds a path in the given graphics context from the end of the source rectangle to the start of the target rectangle.
        Parameters:
        sourceRect - the source rectangle
        targetRect - the target rectangle
        Returns:
        the result path
        Since:
        1.0
      • getOffset

        public final double getOffset()
        The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.
        Returns:
        the offset
        Since:
        1.0
      • setOffset

        public final void setOffset​(double offset)
        The offset determines the end location of the first segment of the calculated path. The first segment is used to move away from the start or end bounds before continuing to draw up or down.
        Parameters:
        offset - the offset in pixels
        Since:
        1.0
      • setCurve

        public final void setCurve​(double curve)
        Sets the radius for the curve. The radius can not be larger than the offset (see setOffset(double)). Setting this value to 0 results in corners instead of curves.
        Parameters:
        curve - the radius of the curve
        Since:
        1.0
      • getCurve

        public final double getCurve()
        Returns the radius of the curve.
        Returns:
        the curve radius
        Since:
        1.0
      • getGap

        public final double getGap()
        The gap determines how far the line is drawn away from the bounds of the source or target timeline object.
        Returns:
        the gap between line and timeline objects
        Since:
        1.0
      • setGap

        public final void setGap​(double gap)
        The gap determines how far the line is drawn away from the bounds of the source or target timeline object.
        Parameters:
        gap - the distance between line and timeline objects
        Since:
        1.0