Class AbstractLinkStrategy<T>

java.lang.Object
com.dlsc.gemsfx.treeview.link.AbstractLinkStrategy<T>
All Implemented Interfaces:
LinkStrategy<T>
Direct Known Subclasses:
ClockHandLinkStrategy, CurvedLineLink, LogarithmicLink, PolyLineLink, QuadCurveLink, SimpleCatmullRomLink, SineWaveDecayLink, StraightLineLink

public abstract class AbstractLinkStrategy<T> extends Object implements LinkStrategy<T>
  • Field Details

    • startX

      protected double startX
    • startY

      protected double startY
    • endX

      protected double endX
    • endY

      protected double endY
  • Constructor Details

    • AbstractLinkStrategy

      public AbstractLinkStrategy()
  • Method Details

    • calculateEndPoints

      protected void calculateEndPoints(TreeNodeView.LayoutDirection direction, javafx.geometry.Point2D parentPoint, double parentW, double parentH, javafx.geometry.Point2D childPoint, double childW, double childH, double nodeLineGap)
    • drawNodeLink

      public ArrayList<javafx.scene.Node> drawNodeLink(TreeNodeView.LayoutDirection direction, double maxDimensionInLine, TreeNode<T> parent, javafx.geometry.Point2D parentPoint, double parentW, double parentH, TreeNode<T> child, javafx.geometry.Point2D childPoint, double childW, double childH, double nodeLineGap, double vgap, double hgap)
      Description copied from interface: LinkStrategy
      Draw node/path connections
      Specified by:
      drawNodeLink in interface LinkStrategy<T>
      Parameters:
      maxDimensionInLine - max dimension in line; if left-to-right or right-to-left, it is width; if top-to-bottom or bottom-to-top, it is height
      parent - parent node
      parentPoint - parent node position
      parentW - parent node width
      parentH - parent node height
      child - child node
      childPoint - child node position
      childW - child node width
      childH - child node height
      nodeLineGap - node connections gap
      vgap - vertical gap: distance between parent and child
      hgap - horizontal gap: distance between child and child (same level/row)
      Returns:
      Node/Path connections; these nodes may be lines and arrows; (The returned nodes should have both layoutX and layoutY already set.)
    • drawLink

      protected abstract ArrayList<javafx.scene.Node> drawLink(TreeNodeView.LayoutDirection direction, double maxDimensionInLine, double startX, double startY, double endX, double endY, double vgap, double hgap)
    • createSimpleArrow

      protected javafx.scene.Node createSimpleArrow()
    • calculateAngle

      protected double calculateAngle()
      Returns:
      Calculate the angle of the line between the start and end points.
    • calculateAngle

      protected double calculateAngle(double p1X, double p1Y, double p2X, double p2Y)
      Returns:
      Calculate the angle of the line between the p1 and p2.
    • calculateAngle

      protected double calculateAngle(javafx.geometry.Point2D p1, javafx.geometry.Point2D p2)
      Returns:
      Calculate the angle of the line between the points.
    • calculateAngle

      protected double calculateAngle(javafx.scene.shape.LineTo lineTo1, javafx.scene.shape.LineTo lineTo2)
    • getTangentAngle

      protected double getTangentAngle(javafx.scene.shape.CubicCurve curve, double t)
      Returns:
      Calculate the angle of the tangent of the curve at the given t.
    • getTangentAngle

      protected double getTangentAngle(javafx.scene.shape.CubicCurveTo curveTo, double t)
      Returns:
      Calculate the angle of the tangent of the curve at the given t.
    • getTangentAngle

      protected double getTangentAngle(javafx.scene.shape.QuadCurve curve, double t)
      Returns:
      Calculate the angle of the tangent of the curve at the given t.