use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class TestGraphCreator method twoEdgesIntoSamePortResolvesCrossingWhenSwitched.
/**
* <pre>
* * *
* \/
* /\
* *--*<- Into same port
* </pre>
*
* .
*
* @return Graph of the form above.
*/
public LGraph twoEdgesIntoSamePortResolvesCrossingWhenSwitched() {
Layer leftLayer = makeLayer();
Layer rightLayer = makeLayer();
LNode topLeft = addNodeToLayer(leftLayer);
LNode bottomLeft = addNodeToLayer(leftLayer);
LNode topRight = addNodeToLayer(rightLayer);
LNode bottomRight = addNodeToLayer(rightLayer);
LPort topLeftPort = addPortOnSide(topLeft, PortSide.EAST);
LPort bottomLeftPort = addPortOnSide(bottomLeft, PortSide.EAST);
LPort bottomRightPort = addPortOnSide(bottomRight, PortSide.WEST);
addEdgeBetweenPorts(topLeftPort, bottomRightPort);
addEdgeBetweenPorts(bottomLeftPort, bottomRightPort);
eastWestEdgeFromTo(bottomLeft, topRight);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class InLayerEdgeTestGraphCreator method getInLayerOneLayerNoCrossings.
/**
* <pre>
* |---*
* |
* | --*
* | |
* | --*
* \
* \
* \
* *
* .
* </pre>
*
* @return Graph of the form above.
*/
public LGraph getInLayerOneLayerNoCrossings() {
Layer layer = makeLayer(getGraph());
LNode[] nodes = addNodesToLayer(4, layer);
addInLayerEdge(nodes[0], nodes[3], PortSide.WEST);
addInLayerEdge(nodes[1], nodes[2], PortSide.WEST);
return getGraph();
}
use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class InLayerEdgeTestGraphCreator method getInLayerEdgesWithFixedPortOrderAndNormalEdgeCrossings.
/**
* <pre>
* ___
* ---| |
* | | | <- switch this
* ---+--|_|
* | |
* *--|--* <- with this
* |
* ---*
* .
* </pre>
*
* With fixed Port PortOrder.
*
* @return Graph of the form above.
*/
public LGraph getInLayerEdgesWithFixedPortOrderAndNormalEdgeCrossings() {
Layer[] layer = makeLayers(2);
LNode leftNode = addNodeToLayer(layer[0]);
LNode[] rightNodes = addNodesToLayer(3, layer[1]);
setFixedOrderConstraint(rightNodes[0]);
eastWestEdgeFromTo(leftNode, rightNodes[0]);
addInLayerEdge(rightNodes[0], rightNodes[2], PortSide.WEST);
eastWestEdgeFromTo(leftNode, rightNodes[1]);
return getGraph();
}
use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class InLayerEdgeTestGraphCreator method getOneLayerWithInLayerCrossings.
/**
* <pre>
* --*
* |
* |/*
* /|
* | --*
* \
* \
* \
* *
* .
* </pre>
*
* @return Graph of the form above.
*/
public LGraph getOneLayerWithInLayerCrossings() {
Layer layer = makeLayer(getGraph());
LNode[] nodes = addNodesToLayer(4, layer);
addInLayerEdge(nodes[0], nodes[2], PortSide.WEST);
addInLayerEdge(nodes[1], nodes[3], PortSide.WEST);
return getGraph();
}
use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class InLayerEdgeTestGraphCreator method getInLayerEdgesDownwardGraphNoFixedOrder.
/**
* <pre>
*
* --*
* | ____
* |/| |
* /\| |
* | | |
* *-+-|__|
* |
* \
* *
* .
* </pre>
*
* Port order not fixed.
*
* @return Graph of the form above.
*/
public LGraph getInLayerEdgesDownwardGraphNoFixedOrder() {
Layer[] layers = makeLayers(2);
LNode leftNode = addNodeToLayer(layers[0]);
LNode[] rightNodes = addNodesToLayer(3, layers[1]);
eastWestEdgeFromTo(leftNode, rightNodes[1]);
addInLayerEdge(rightNodes[0], rightNodes[1], PortSide.WEST);
addInLayerEdge(rightNodes[1], rightNodes[2], PortSide.WEST);
return getGraph();
}
Aggregations