Skip to content

Commit ef05733

Browse files
committed
Layered: Fix hierarchy handling problem. #735
Signed-off-by: le-cds <zephanya@web.de> (cherry picked from commit df30228)
1 parent 7f2803a commit ef05733

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

plugins/org.eclipse.elk.alg.layered/src/org/eclipse/elk/alg/layered/graph/transform/ElkGraphImporter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,10 @@ private void importHierarchicalGraph(final ElkNode elkgraph, final LGraph lgraph
407407
for (ElkNode elkChildGraphNode : elkGraphNode.getChildren()) {
408408
boolean usesElkLayered = !elkChildGraphNode.hasProperty(CoreOptions.ALGORITHM)
409409
|| elkChildGraphNode.getProperty(CoreOptions.ALGORITHM).equals(LayeredOptions.ALGORITHM_ID);
410+
boolean partOfSameLayoutRun = elkChildGraphNode.getProperty(LayeredOptions.HIERARCHY_HANDLING)
411+
== HierarchyHandling.INCLUDE_CHILDREN;
410412

411-
if (usesElkLayered) {
413+
if (usesElkLayered && partOfSameLayoutRun) {
412414
elkGraphQueue.add(elkChildGraphNode);
413415
}
414416
}

plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/options/HierarchyHandling.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public enum HierarchyHandling {
3636
INHERIT,
3737

3838
/**
39-
* Allows the node's children should be included in the current layout run. Which children are included in the
40-
* layout run is determined by their hierarchy handling setting. For a child to actually be included, its hierarchy
39+
* Allows the node's children to be included in the current layout run. Which children are included in the layout
40+
* run is determined by their hierarchy handling setting. For a child to actually be included, its hierarchy
4141
* handling must be set to either {@link #INHERIT} or {@link #INCLUDE_CHILDREN}.
4242
*/
4343
INCLUDE_CHILDREN,

test/org.eclipse.elk.alg.layered.test/src/org/eclipse/elk/alg/layered/issues/Issue700Test.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public List<AbstractResourcePath> testGraphs() {
4444
// The bug was introduced while fixing #665, so ensure that the fix for #700 does not return the favour...
4545
return Lists.newArrayList(
4646
new ModelResourcePath("tickets/layered/**").withFilter(new FileNameFilter("665.+\\.elkt")),
47-
new ModelResourcePath("tickets/layered/**").withFilter(new FileNameFilter("700.+\\.elkt")));
47+
new ModelResourcePath("tickets/layered/**").withFilter(new FileNameFilter("700.+\\.elkt")),
48+
new ModelResourcePath("examples/hierarchy/**"));
4849
}
4950

5051
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)