Package jline.io.tikz
Class TikZEdgeRouter
java.lang.Object
jline.io.tikz.TikZEdgeRouter
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<double[]> computeWaypoints(Node from, Node to, List<Node> allNodes) Computes waypoints for an edge to avoid overlapping nodes.booleanisSelfLoop(Node from, Node to) Checks if this edge is a self-loop.static StringrenderRoutedEdge(String fromId, String toId, String fromAnchor, String toAnchor, List<double[]> waypoints, double prob, TikZOptions options) Generates TikZ code for a routed edge with waypoints.
-
Constructor Details
-
TikZEdgeRouter
-
-
Method Details
-
computeWaypoints
Computes waypoints for an edge to avoid overlapping nodes. Handles forward edges, backward edges, self-loops, and vertical edges.- Parameters:
from- Source nodeto- Target nodeallNodes- All nodes in the network- Returns:
- List of waypoints (x, y pairs). Empty if straight line is OK.
-
isSelfLoop
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.
-