|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.AbstractDrawer
y.layout.hierarchic.MedianLinearSegmentDrawer
public class MedianLinearSegmentDrawer
This class implements the third phase of the hierarchic layout algorithm (i.e., the assignment of nodes' coordinates).
Edges are represented as polyline segments with at most two bends per edge. The algorithm has linear running time and is based on the article [BK01]:
![]() |
![]() |
| Field Summary |
|---|
| Fields inherited from class y.layout.hierarchic.AbstractDrawer |
|---|
distanceToNextNode, dummyMap, edgeLengthKey, graph, minimalEdgeDistance, minimalLayerDistance, minimalMultiEdgeDistance, minimalNodeDistance |
| Fields inherited from interface y.layout.hierarchic.Drawer |
|---|
NODE_BORDER_BOTTOM, NODE_BORDER_LEFT, NODE_BORDER_RIGHT, NODE_BORDER_TOP, NODE_DISTANCE |
| Constructor Summary | |
|---|---|
MedianLinearSegmentDrawer()
Creates an instance of MedianLinearSegmentDrawer with default settings. |
|
| Method Summary | |
|---|---|
protected void |
assignCoordinates(NodeList[] layerLists,
DataProvider layerID)
Assigns the coordinates to the nodes of the given graph. |
protected void |
dispose()
Cleans up previously allocated structures. |
protected void |
horizontalCompaction(LayoutGraph graph,
double[] x,
NodeList[] layerLists)
Calculates the coordinates of the graph. |
protected void |
init(Graph graph,
NodeList[] layerLists)
Initializes the data structures for all runs. |
static void |
markConflicts(NodeList[] layerLists,
EdgeMap conflictMark,
NodeMap dummyMap,
int[] pos)
Marks conflicts occurred when a non-inner segment crosses an inner segment. |
protected void |
propagateCoordinates(LayoutGraph graph)
Propagates the calculated x-coordinates to the nodes of the graph. |
protected void |
reinit(Graph graph,
double[] x)
Initializes the data structures for one basic step. |
void |
verticalAlignment(LayoutGraph graph,
NodeList[] layerLists)
Calculates a vertical alignment. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MedianLinearSegmentDrawer()
MedianLinearSegmentDrawer with default settings.
| Method Detail |
|---|
protected void assignCoordinates(NodeList[] layerLists,
DataProvider layerID)
The procedure has three steps (see U. Brandes and B. Koepf, 2001):
This method is called by AbstractDrawer.assignCoordinates(LayoutGraph, NodeList[], DataProvider) after the
AbstractDrawer.initializeDistancesToNextNode(NodeList[]) has been called and can be overridden for custom calculation
of the horizontal node positions.
assignCoordinates in class AbstractDrawerlayerLists - an array of NodeLists containing nodes that belong to the same layerlayerID - the DataProvider that returns the zero-based index of the layer to which each node belongs
protected void init(Graph graph,
NodeList[] layerLists)
graph - the input graphlayerLists - the array of NodeLists each of which contains nodes that belong to the same layer
protected void reinit(Graph graph,
double[] x)
graph - the input graphx - the array in which the x-coordinates will be stored
public static void markConflicts(NodeList[] layerLists,
EdgeMap conflictMark,
NodeMap dummyMap,
int[] pos)
An inner segment is a segment between two dummy vertices. This method corresponds to Algorithm
1 in [BK01].
layerLists - the array of NodeLists each of which contains nodes that belong to the same layerconflictMark - the EdgeMap that returns a boolean value for each edge determining whether or not
an edge is marked as conflictdummyMap - the NodeMap that returns a boolean value for each node determining whether or not
the node is a dummy node (i.e., a node that corresponds to a bend)pos - an array indexed by the index of a node and returns the rank of
a node inside the layer to which it belongs
public void verticalAlignment(LayoutGraph graph,
NodeList[] layerLists)
This method corresponds to Algorithm 2 in [BK01].
graph - the input graphlayerLists - the array of NodeLists each of which contains nodes that belong to the same layer
protected void horizontalCompaction(LayoutGraph graph,
double[] x,
NodeList[] layerLists)
This method corresponds to Algorithm 3 in [BK01].
graph - the input graphx - the array in which the x-coordinates will be storedlayerLists - the array of NodeLists each of which contains nodes that belong to the same layerprotected void propagateCoordinates(LayoutGraph graph)
graph - the graphprotected void dispose()
dispose in class AbstractDrawer
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||