Class AdaptagramsRouting

java.lang.Object
org.vanted.plugins.layout.adaptagrams.edgerouting.AdaptagramsRouting

public class AdaptagramsRouting
extends Object
Author:
Tobias Czauderna
  • Constructor Summary

    Constructors
    Constructor Description
    AdaptagramsRouting()  
  • Method Summary

    Modifier and Type Method Description
    static void addBendPointForNodePosition​(ArrayList<Vector2d> edgeBends, int compareIndex, int addIndex, Vector2d nodePos)
    Adds an edge bend point for the node position.
    static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int routingType)
    Defines a ConnRef for an edge.
    static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType)
    Defines a ConnRef for an edge.
    static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
    Defines a ConnRef for an edge.
    static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
    Defines a ConnRef for an edge.
    static org.adaptagrams.ShapeRef defineShapeRef​(org.adaptagrams.Router router, View view, Node node)
    Defines a ShapeRef for a node.
    static void fixSourceBendPoints​(ArrayList<Vector2d> edgeBends, View view, Node node)
    Fixes the edge bend points at the source node.
    static void fixTargetBendPoints​(ArrayList<Vector2d> edgeBends, View view, Node node)
    Fixes the edge bend points at the target node.
    static ArrayList<Vector2d> getEdgeBends​(org.adaptagrams.ConnRef connRef)
    Returns the edge bend points for a connector.
    static ArrayList<Vector2d> getEdgeBends​(org.adaptagrams.ConnRef connRef, double radius)
    Returns the edge bend points for a connector.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdaptagramsRouting

      public AdaptagramsRouting()
  • Method Details

    • defineShapeRef

      public static org.adaptagrams.ShapeRef defineShapeRef​(org.adaptagrams.Router router, View view, Node node)
      Defines a ShapeRef for a node.
      Parameters:
      router - the router
      view - the current view
      node - the node
      Returns:
      Adaptagrams shape (ShapeRef)
    • defineConnRef

      public static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int routingType)
      Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.
      Parameters:
      router - the router
      view - the current view
      edge - the edge
      routingType - routing type (ConnType.ConnType_PolyLine or ConnType.ConnType_Orthogonal)
      Returns:
      Adaptagrams connector (ConnRef)
    • defineConnRef

      public static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
      Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.
      Parameters:
      router - the router
      view - the current view
      edge - the edge
      routingType - routing type (ConnType.ConnType_PolyLine or ConnType.ConnType_Orthogonal)
      avoidCheckpoints - Adaptagrams checkpoints (AvoidCheckpoints), list of checkpoints the connector (the edge) has to pass
      Returns:
      Adaptagrams connector (ConnRef)
    • defineConnRef

      public static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType, org.adaptagrams.AvoidCheckpoints avoidCheckpoints)
      Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.
      Parameters:
      router - the router
      view - the current view
      edge - the edge
      srcConnDirFlag - edge direction at source node (ConnDirFlag.ConnDirAll, ConnDirFlag.ConnDirUp, ConnDirFlag.ConnDirRight, ConnDirFlag.ConnDirDown, ConnDirFlag.ConnDirLeft or ConnDirFlag.ConnDirNone)
      tgtConnDirFlag - edge direction at target node (ConnDirFlag.ConnDirAll, ConnDirFlag.ConnDirUp, ConnDirFlag.ConnDirRight, ConnDirFlag.ConnDirDown, ConnDirFlag.ConnDirLeft or ConnDirFlag.ConnDirNone)
      routingType - routing type (ConnType.ConnType_PolyLine or ConnType.ConnType_Orthogonal)
      avoidCheckpoints - Adaptagrams checkpoints (AvoidCheckpoints), list of checkpoints the connector (the edge) has to pass
      Returns:
      Adaptagrams connector (ConnRef)
    • defineConnRef

      public static org.adaptagrams.ConnRef defineConnRef​(org.adaptagrams.Router router, View view, Edge edge, int srcConnDirFlag, int tgtConnDirFlag, int routingType)
      Defines a ConnRef for an edge. Start point is either the position of the source node or the docking position at the source node, end point is either the position of the target node or the docking position at the target node.
      Parameters:
      router - the router
      view - the current view
      edge - the edge
      srcConnDirFlag - edge direction at source node (ConnDirFlag.ConnDirAll, ConnDirFlag.ConnDirUp, ConnDirFlag.ConnDirRight, ConnDirFlag.ConnDirDown, ConnDirFlag.ConnDirLeft or ConnDirFlag.ConnDirNone)
      tgtConnDirFlag - edge direction at target node (ConnDirFlag.ConnDirAll, ConnDirFlag.ConnDirUp, ConnDirFlag.ConnDirRight, ConnDirFlag.ConnDirDown, ConnDirFlag.ConnDirLeft or ConnDirFlag.ConnDirNone)
      routingType - routing type (ConnType.ConnType_PolyLine or ConnType.ConnType_Orthogonal
      Returns:
      Adaptagrams connector (ConnRef)
    • getEdgeBends

      public static ArrayList<Vector2d> getEdgeBends​(org.adaptagrams.ConnRef connRef)
      Returns the edge bend points for a connector.
      Parameters:
      connRef - Adaptagrams connector (ConnRef)
      Returns:
      ArrayList of bend points
    • getEdgeBends

      public static ArrayList<Vector2d> getEdgeBends​(org.adaptagrams.ConnRef connRef, double radius)
      Returns the edge bend points for a connector.
      Parameters:
      connRef - Adaptagrams connector (ConnRef)
      radius - bend radius
      Returns:
      ArrayList of bend points
    • addBendPointForNodePosition

      public static void addBendPointForNodePosition​(ArrayList<Vector2d> edgeBends, int compareIndex, int addIndex, Vector2d nodePos)
      Adds an edge bend point for the node position.
      Parameters:
      edgeBends - ArrayList of bend points
      compareIndex - compare the node position with bend point at this index
      addIndex - add a bend point for the node position at this index
      nodePos - node position
    • fixSourceBendPoints

      public static void fixSourceBendPoints​(ArrayList<Vector2d> edgeBends, View view, Node node)
      Fixes the edge bend points at the source node. Only edge bend points outside the node are kept.
      Parameters:
      edgeBends - ArrayList of bend points
      view - the current view
      node - the node
    • fixTargetBendPoints

      public static void fixTargetBendPoints​(ArrayList<Vector2d> edgeBends, View view, Node node)
      Fixes the edge bend points at the target node. Only edge bend points outside the node are kept.
      Parameters:
      edgeBends - ArrayList of bend points
      view - the current view
      node - the node