From 02e3aab447c7ddd52134fcd77617aa10b28846ae Mon Sep 17 00:00:00 2001 From: Max Kasperowski Date: Tue, 12 Nov 2024 15:10:01 +0100 Subject: [PATCH] Update topdown layout test to handle the case when no approximators are set correctly. --- .../alg/topdown/test/TopdownLayoutTest.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/org.eclipse.elk.alg.topdown.test/src/org/eclipse/elk/alg/topdown/test/TopdownLayoutTest.java b/test/org.eclipse.elk.alg.topdown.test/src/org/eclipse/elk/alg/topdown/test/TopdownLayoutTest.java index 5a0081047..a17df44e6 100644 --- a/test/org.eclipse.elk.alg.topdown.test/src/org/eclipse/elk/alg/topdown/test/TopdownLayoutTest.java +++ b/test/org.eclipse.elk.alg.topdown.test/src/org/eclipse/elk/alg/topdown/test/TopdownLayoutTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2022 Kiel University and others. + * Copyright (c) 2022-2024 Kiel University and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -52,7 +52,9 @@ public void testTwoLevelLayoutHorizontalScaling() { toplevel.setProperty(CoreOptions.PADDING, new ElkPadding()); toplevel.setProperty(CoreOptions.SPACING_NODE_NODE, 0.0); // set size of node so that children will be scaled down - toplevel.setDimensions(20, 50); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH, 20.0); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO, 0.4); +// toplevel.setDimensions(20, 50); ElkNode child1 = ElkGraphUtil.createNode(toplevel); child1.setProperty(CoreOptions.TOPDOWN_LAYOUT, true); @@ -105,7 +107,9 @@ public void testTwoLevelLayoutVerticalScaling() { toplevel.setProperty(CoreOptions.PADDING, new ElkPadding()); toplevel.setProperty(CoreOptions.SPACING_NODE_NODE, 0.0); // set size of node so that children will be scaled down - toplevel.setDimensions(40, 30); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH, 40.0); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO, 1.33333); +// toplevel.setDimensions(40, 30); ElkNode child1 = ElkGraphUtil.createNode(toplevel); child1.setProperty(CoreOptions.TOPDOWN_LAYOUT, true); @@ -159,7 +163,9 @@ public void testScaleCap() { toplevel.setProperty(CoreOptions.PADDING, new ElkPadding()); toplevel.setProperty(CoreOptions.SPACING_NODE_NODE, 0.0); // set size of node so that children will be scaled down - toplevel.setDimensions(300, 300); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH, 300.0); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO, 1.0); +// toplevel.setDimensions(300, 300); ElkNode child1 = ElkGraphUtil.createNode(toplevel); child1.setProperty(CoreOptions.TOPDOWN_LAYOUT, true); @@ -212,7 +218,9 @@ public void testScaleCapBounded() { toplevel.setProperty(CoreOptions.PADDING, new ElkPadding()); toplevel.setProperty(CoreOptions.SPACING_NODE_NODE, 0.0); // set size of node so that children will be scaled down - toplevel.setDimensions(300, 300); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH, 300.0); + graph.setProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO, 1.0); +// toplevel.setDimensions(300, 300); ElkNode child1 = ElkGraphUtil.createNode(toplevel); child1.setProperty(CoreOptions.TOPDOWN_LAYOUT, true);