use of org.eclipse.elk.core.RecursiveGraphLayoutEngine in project elk by eclipse.
the class Issue680Test method test.
@Test
public void test() {
Triple<ElkNode, ElkNode, ElkNode> nodes = testGraph();
new RecursiveGraphLayoutEngine().layout(nodes.getFirst(), new NullElkProgressMonitor());
assertThat(nodes.getSecond().getY(), closeTo(157.0, EPSILON));
assertThat(nodes.getThird().getY(), closeTo(57.0, EPSILON));
}
use of org.eclipse.elk.core.RecursiveGraphLayoutEngine in project elk by eclipse.
the class Issue682Test method test.
@Test
public void test() {
Triple<ElkNode, ElkNode, ElkLabel> uut = testGraph();
new RecursiveGraphLayoutEngine().layout(uut.getFirst(), new NullElkProgressMonitor());
// Label position
ElkLabel label = uut.getThird();
assertThat(label.getX(), closeTo(54.0, EPSILON));
assertThat(label.getY(), closeTo(21.0, EPSILON));
// Node dimension
assertThat(uut.getSecond().getWidth(), closeTo(label.getX() + label.getWidth() + 32, EPSILON));
// TODO the following line fails, it looks like the label's height is applied twice.
// assertThat(uut.getSecond().getHeight(), closeTo(label.getY() + label.getHeight() + 43, EPSILON));
}
use of org.eclipse.elk.core.RecursiveGraphLayoutEngine in project elk by eclipse.
the class ExperimentStatement method evaluate.
@Override
public void evaluate() throws Throwable {
createTestGraph();
// Create a test controller if we have whitebox tests and the layout algorithm
TestController testController = null;
if (!this.experimentRunner.getParentRunner().getWhiteboxTests().isEmpty()) {
TestAlgorithm algorithm = experimentRunner.getExperimentalObject().getLayoutAlgorithm();
testController = new TestController(algorithm.getAlgorithmData().getId());
testController.addLayoutExecutionListener(this);
}
// Let the recursive graph layout engine run the layout algorithm (if we have a test controller, that will
// automatically cause white box tests to run)
RecursiveGraphLayoutEngine layoutEngine = new RecursiveGraphLayoutEngine();
layoutEngine.layout(testGraph, testController, new BasicProgressMonitor());
// Stop listening to the test controller
if (testController != null) {
testController.removeLayoutExecutionListener(this);
}
// Run blackbox tests now that the layout algorithm has finished
runBlackboxTests();
// Cleanly handle all whitebox tests that did not execute because their processors didn't run
simulateWhiteboxTestsForNotifiers();
testGraph = null;
}
Aggregations