Skip to content

Commit

Permalink
Add a property that suppresses the mode order (#816)
Browse files Browse the repository at this point in the history
Signed-off-by: Soeren Domroes <sdo@informatik.uni-kiel.de>
  • Loading branch information
soerendomroes committed Apr 5, 2022
1 parent 108b8e2 commit bee4a3f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Expand Up @@ -189,6 +189,7 @@ algorithm layered(LayeredLayoutProvider) {
supports considerModelOrder.longEdgeStrategy
supports considerModelOrder.crossingCounterNodeInfluence
supports considerModelOrder.crossingCounterPortInfluence
supports considerModelOrder.noModelOrder
supports generatePositionAndLayerIds
}

Expand Down Expand Up @@ -939,6 +940,13 @@ group considerModelOrder {
default = OrderingStrategy.NONE
targets parents
}
option noModelOrder: boolean {
label "No Model Order"
description
"Set on a node to not set a model order for this node even though it is a real node."
default = false
targets nodes
}
option longEdgeStrategy: LongEdgeOrderingStrategy {
label "Long Edge Ordering Strategy"
description
Expand Down
Expand Up @@ -225,10 +225,11 @@ private void importFlatGraph(final ElkNode elkgraph, final LGraph lgraph) {
int index = 0;
for (ElkNode child : elkgraph.getChildren()) {
if (!child.getProperty(LayeredOptions.NO_LAYOUT)) {
if (elkgraph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY) != OrderingStrategy.NONE
if ((elkgraph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY) != OrderingStrategy.NONE
|| elkgraph.getProperty(LayeredOptions.CYCLE_BREAKING_STRATEGY)
== CycleBreakingStrategy.MODEL_ORDER
|| elkgraph.getProperty(LayeredOptions.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)) {
|| elkgraph.getProperty(LayeredOptions.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))
&& !child.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)) {
child.setProperty(InternalProperties.MODEL_ORDER, index);
index++;
}
Expand Down Expand Up @@ -304,10 +305,11 @@ private void importHierarchicalGraph(final ElkNode elkgraph, final LGraph lgraph
while (!elkGraphQueue.isEmpty()) {
ElkNode elknode = elkGraphQueue.poll();

if (elkgraph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY) != OrderingStrategy.NONE
if ((elkgraph.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_STRATEGY) != OrderingStrategy.NONE
|| elkgraph.getProperty(LayeredOptions.CYCLE_BREAKING_STRATEGY)
== CycleBreakingStrategy.MODEL_ORDER
|| elkgraph.getProperty(LayeredOptions.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER)) {
|| elkgraph.getProperty(LayeredOptions.CROSSING_MINIMIZATION_FORCE_NODE_MODEL_ORDER))
&& !elknode.getProperty(LayeredOptions.CONSIDER_MODEL_ORDER_NO_MODEL_ORDER)) {
// Assign a model order to the nodes as they are read
elknode.setProperty(InternalProperties.MODEL_ORDER, index++);
}
Expand Down

0 comments on commit bee4a3f

Please sign in to comment.