use of org.eclipse.elk.alg.layered.graph.LNode in project elk by eclipse.
the class TestGraphCreator method getInLayerEdgesGraph.
/**
* <pre>
* --*
* |
* *-+-*-*
* |
* --*
* .
* </pre>
*
* @return graph of the form above
*/
public LGraph getInLayerEdgesGraph() {
Layer leftLayer = makeLayer();
Layer middleLayer = makeLayer();
Layer rightLayer = makeLayer();
LNode leftNode = addNodeToLayer(leftLayer);
LNode[] middleNodes = addNodesToLayer(3, middleLayer);
LNode rightNode = addNodeToLayer(rightLayer);
// add east side ports first to get expected port ordering
eastWestEdgeFromTo(middleNodes[1], rightNode);
eastWestEdgeFromTo(leftNode, middleNodes[1]);
addInLayerEdge(middleNodes[0], middleNodes[2], PortSide.WEST);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.LNode in project elk by eclipse.
the class TestGraphCreator method getOnlyCorrectlyImprovedByBestOfForwardAndBackwardSweepsInSingleLayer.
/**
* <pre>
* ___
* | |\ *
* | |\\ /
* |_|-++-+*
* || \
* ====*
* </pre>
*
* left Node has fixed Port Order.
*
* @return Graph of the form above.
*/
public LGraph getOnlyCorrectlyImprovedByBestOfForwardAndBackwardSweepsInSingleLayer() {
LNode leftNode = addNodeToLayer(makeLayer());
setFixedOrderConstraint(leftNode);
LNode[] rightNodes = addNodesToLayer(3, makeLayer());
eastWestEdgeFromTo(leftNode, rightNodes[2]);
eastWestEdgeFromTo(leftNode, rightNodes[2]);
eastWestEdgeFromTo(leftNode, rightNodes[1]);
addInLayerEdge(rightNodes[0], rightNodes[2], PortSide.WEST);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.LNode in project elk by eclipse.
the class TestGraphCreator method getCrossFormedGraphConstraintsPreventAnySwitch.
/**
* <pre>
* this node must be.. -> * * <- and this node must be ...
* \/
* /\
* before this node -> * * <- before this node.
* .
* </pre>
*
* @return Graph of the form above.
*/
public LGraph getCrossFormedGraphConstraintsPreventAnySwitch() {
Layer leftLayer = makeLayer();
Layer rightLayer = makeLayer();
LNode topLeft = addNodeToLayer(leftLayer);
LNode bottomLeft = addNodeToLayer(leftLayer);
LNode topRight = addNodeToLayer(rightLayer);
LNode bottomRight = addNodeToLayer(rightLayer);
eastWestEdgeFromTo(topLeft, bottomRight);
eastWestEdgeFromTo(bottomLeft, topRight);
setInLayerOrderConstraint(topRight, bottomRight);
setInLayerOrderConstraint(topLeft, bottomLeft);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.LNode in project elk by eclipse.
the class TestGraphCreator method getCrossWithManySelfLoopsGraph.
/**
* Cross formed graph, but each node has three extra self loop edges.
*
* <pre>
* * *
* \/
* /\
* * *
* .
* </pre>
*
* @return Graph of the form above.
*/
public LGraph getCrossWithManySelfLoopsGraph() {
LGraph selfLoopCrossGraph = getCrossFormedGraph();
for (Layer layer : selfLoopCrossGraph) {
for (LNode node : layer) {
selfLoopOn(node, PortSide.EAST);
selfLoopOn(node, PortSide.EAST);
selfLoopOn(node, PortSide.EAST);
selfLoopOn(node, PortSide.WEST);
selfLoopOn(node, PortSide.WEST);
selfLoopOn(node, PortSide.WEST);
}
}
return selfLoopCrossGraph;
}
use of org.eclipse.elk.alg.layered.graph.LNode in project elk by eclipse.
the class TestGraphCreator method multipleEdgesAndSingleEdge.
/**
* <pre>
* *
* \\
* \\
* *---*
* .
* </pre>
*
* @return Graph of the form above.
*/
public LGraph multipleEdgesAndSingleEdge() {
Layer leftLayer = makeLayer();
Layer rightLayer = makeLayer();
LNode topLeft = addNodeToLayer(leftLayer);
LNode bottomLeft = addNodeToLayer(leftLayer);
LNode bottomRight = addNodeToLayer(rightLayer);
eastWestEdgeFromTo(topLeft, bottomRight);
eastWestEdgeFromTo(topLeft, bottomRight);
eastWestEdgeFromTo(bottomLeft, bottomRight);
setUpIds();
return graph;
}
Aggregations