Skip to content

Commit

Permalink
Update topdown layout test to handle the case when no approximators are
Browse files Browse the repository at this point in the history
set correctly.
  • Loading branch information
Eddykasp committed Nov 12, 2024
1 parent aef3166 commit 02e3aab
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 02e3aab

Please sign in to comment.