use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class TestGraphCreator method getMoreComplexInLayerGraph.
/**
* <pre>
* ____
* / | |
* *-+--| |\
* | /| |-+-*
* *-++-|__| |
* || |
* || ___ |
* | \| | /
* *-+--| |/
* *-+--|_|
* \
* \
* *
* .
* </pre>
*
* Port order fixed.
*
* @return Graph of the form above.
*/
public LGraph getMoreComplexInLayerGraph() {
Layer[] layers = makeLayers(3);
LNode[] leftNodes = addNodesToLayer(4, layers[0]);
LNode[] middleNodes = addNodesToLayer(3, layers[1]);
LNode rightNode = addNodeToLayer(layers[2]);
setFixedOrderConstraint(middleNodes[0]);
setFixedOrderConstraint(middleNodes[1]);
eastWestEdgeFromTo(leftNodes[1], middleNodes[0]);
eastWestEdgeFromTo(leftNodes[3], middleNodes[1]);
eastWestEdgeFromTo(leftNodes[2], middleNodes[1]);
addInLayerEdge(middleNodes[0], middleNodes[1], PortSide.WEST);
eastWestEdgeFromTo(leftNodes[0], middleNodes[0]);
addInLayerEdge(middleNodes[0], middleNodes[2], PortSide.WEST);
addInLayerEdge(middleNodes[0], middleNodes[1], PortSide.EAST);
eastWestEdgeFromTo(middleNodes[0], rightNode);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.Layer 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(graph);
Layer rightLayer = makeLayer(graph);
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.Layer in project elk by eclipse.
the class TestGraphCreator method getFixedPortOrderGraph.
/**
* <pre>
* ____ *
* | |\/
* |__|/\
* *
* .
* </pre>
*
* Port order fixed.
*
* @return Graph of the form above.
*/
public LGraph getFixedPortOrderGraph() {
Layer leftLayer = makeLayer(graph);
Layer rightLayer = makeLayer(graph);
LNode leftNode = addNodeToLayer(leftLayer);
leftNode.setProperty(LayeredOptions.PORT_CONSTRAINTS, PortConstraints.FIXED_ORDER);
LNode rightTopNode = addNodeToLayer(rightLayer);
LNode rightBottomNode = addNodeToLayer(rightLayer);
eastWestEdgeFromTo(leftNode, rightBottomNode);
eastWestEdgeFromTo(leftNode, rightTopNode);
setUpIds();
return graph;
}
use of org.eclipse.elk.alg.layered.graph.Layer in project elk by eclipse.
the class TestGraphCreator method getInLayerEdgesGraph.
/**
* <pre>
* --*
* |
* *-+-*-*
* |
* --*
* .
* </pre>
*
* @return graph of the form above
*/
public LGraph getInLayerEdgesGraph() {
Layer leftLayer = makeLayer(graph);
Layer middleLayer = makeLayer(graph);
Layer rightLayer = makeLayer(graph);
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.Layer in project elk by eclipse.
the class TestGraphCreator method getTwoNodesNoConnectionGraph.
/**
* Creates two nodes with no connection between them.
*
* @return graph with two nodes with no connection between them.
*/
public LGraph getTwoNodesNoConnectionGraph() {
Layer layer = makeLayer(graph);
addNodeToLayer(layer);
addNodeToLayer(layer);
setUpIds();
return graph;
}
Aggregations