Package jline.io.tikz

Class TikZEdgeRouter

java.lang.Object
jline.io.tikz.TikZEdgeRouter

public class TikZEdgeRouter extends Object
Routes edges around nodes to achieve a planar graph layout. This is a general-purpose edge routing algorithm for queueing network diagrams. It handles: - Forward edges: routes around any intermediate nodes - Backward edges (feedback loops): routes around the entire network - Self-loops: routes above/below the node - Vertical edges: routes with horizontal offset - Multiple edges to same target: staggers entry points The algorithm ensures a planar layout where edges don't cross nodes and parallel edges are visually separated.
  • Constructor Details

    • TikZEdgeRouter

      public TikZEdgeRouter(Map<Node,double[]> positions, TikZOptions options)
  • Method Details

    • computeWaypoints

      public List<double[]> computeWaypoints(Node from, Node to, List<Node> allNodes)
      Computes waypoints for an edge to avoid overlapping nodes. Handles forward edges, backward edges, self-loops, and vertical edges.
      Parameters:
      from - Source node
      to - Target node
      allNodes - All nodes in the network
      Returns:
      List of waypoints (x, y pairs). Empty if straight line is OK.
    • isSelfLoop

      public boolean isSelfLoop(Node from, Node to)
      Checks if this edge is a self-loop.
    • renderRoutedEdge

      public static String renderRoutedEdge(String fromId, String toId, String fromAnchor, String toAnchor, List<double[]> waypoints, double prob, TikZOptions options)
      Generates TikZ code for a routed edge with waypoints.