Skip to content

Commit

Permalink
Commit all generated layout options and providers. (#1022)
Browse files Browse the repository at this point in the history
Meta compiler seems to die, we have to act.
  • Loading branch information
soerendomroes authored Apr 10, 2024
1 parent 7ca5178 commit e486c42
Show file tree
Hide file tree
Showing 36 changed files with 14,413 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ xtend-gen/
*.pdf
*_trace
*.sublime-workspace
/**/src-gen/**/*Options.java
/**/src-gen/**/*MetaDataProvider.java
docs/content/reference/algorithms/
docs/content/reference/options/
docs/content/reference/groups/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/**
* Copyright (c) 2017 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
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.elk.alg.common.compaction.options;

import java.util.EnumSet;
import org.eclipse.elk.core.data.ILayoutMetaDataProvider;
import org.eclipse.elk.core.data.LayoutOptionData;
import org.eclipse.elk.graph.properties.IProperty;
import org.eclipse.elk.graph.properties.Property;

@SuppressWarnings("all")
public class PolyominoOptions implements ILayoutMetaDataProvider {
/**
* Default value for {@link #POLYOMINO_TRAVERSAL_STRATEGY}.
*/
private static final TraversalStrategy POLYOMINO_TRAVERSAL_STRATEGY_DEFAULT = TraversalStrategy.QUADRANTS_LINE_BY_LINE;

/**
* Traversal strategy for trying different candidate positions for polyominoes.
*/
public static final IProperty<TraversalStrategy> POLYOMINO_TRAVERSAL_STRATEGY = new Property<TraversalStrategy>(
"org.eclipse.elk.polyomino.traversalStrategy",
POLYOMINO_TRAVERSAL_STRATEGY_DEFAULT,
null,
null);

/**
* Default value for {@link #POLYOMINO_LOW_LEVEL_SORT}.
*/
private static final LowLevelSortingCriterion POLYOMINO_LOW_LEVEL_SORT_DEFAULT = LowLevelSortingCriterion.BY_SIZE_AND_SHAPE;

/**
* Possible secondary sorting criteria for the processing order of polyominoes.
* They are used when polyominoes are equal according to the primary
* sorting criterion HighLevelSortingCriterion.
*/
public static final IProperty<LowLevelSortingCriterion> POLYOMINO_LOW_LEVEL_SORT = new Property<LowLevelSortingCriterion>(
"org.eclipse.elk.polyomino.lowLevelSort",
POLYOMINO_LOW_LEVEL_SORT_DEFAULT,
null,
null);

/**
* Default value for {@link #POLYOMINO_HIGH_LEVEL_SORT}.
*/
private static final HighLevelSortingCriterion POLYOMINO_HIGH_LEVEL_SORT_DEFAULT = HighLevelSortingCriterion.NUM_OF_EXTERNAL_SIDES_THAN_NUM_OF_EXTENSIONS_LAST;

/**
* Possible primary sorting criteria for the processing order of polyominoes.
*/
public static final IProperty<HighLevelSortingCriterion> POLYOMINO_HIGH_LEVEL_SORT = new Property<HighLevelSortingCriterion>(
"org.eclipse.elk.polyomino.highLevelSort",
POLYOMINO_HIGH_LEVEL_SORT_DEFAULT,
null,
null);

/**
* Default value for {@link #POLYOMINO_FILL}.
*/
private static final boolean POLYOMINO_FILL_DEFAULT = true;

/**
* Use the Profile Fill algorithm to fill polyominoes to prevent small polyominoes
* from being placed inside of big polyominoes with large holes. Might increase packing area.
*/
public static final IProperty<Boolean> POLYOMINO_FILL = new Property<Boolean>(
"org.eclipse.elk.polyomino.fill",
POLYOMINO_FILL_DEFAULT,
null,
null);

public void apply(final org.eclipse.elk.core.data.ILayoutMetaDataProvider.Registry registry) {
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.polyomino.traversalStrategy")
.group("polyomino")
.name("Polyomino Traversal Strategy")
.description("Traversal strategy for trying different candidate positions for polyominoes.")
.defaultValue(POLYOMINO_TRAVERSAL_STRATEGY_DEFAULT)
.type(LayoutOptionData.Type.ENUM)
.optionClass(TraversalStrategy.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.polyomino.lowLevelSort")
.group("polyomino")
.name("Polyomino Secondary Sorting Criterion")
.description("Possible secondary sorting criteria for the processing order of polyominoes. They are used when polyominoes are equal according to the primary sorting criterion HighLevelSortingCriterion.")
.defaultValue(POLYOMINO_LOW_LEVEL_SORT_DEFAULT)
.type(LayoutOptionData.Type.ENUM)
.optionClass(LowLevelSortingCriterion.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.polyomino.highLevelSort")
.group("polyomino")
.name("Polyomino Primary Sorting Criterion")
.description("Possible primary sorting criteria for the processing order of polyominoes.")
.defaultValue(POLYOMINO_HIGH_LEVEL_SORT_DEFAULT)
.type(LayoutOptionData.Type.ENUM)
.optionClass(HighLevelSortingCriterion.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.polyomino.fill")
.group("polyomino")
.name("Fill Polyominoes")
.description("Use the Profile Fill algorithm to fill polyominoes to prevent small polyominoes from being placed inside of big polyominoes with large holes. Might increase packing area.")
.defaultValue(POLYOMINO_FILL_DEFAULT)
.type(LayoutOptionData.Type.BOOLEAN)
.optionClass(Boolean.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* Copyright (c) 2017 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
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.elk.alg.disco.options;

import java.util.EnumSet;
import org.eclipse.elk.core.data.ILayoutMetaDataProvider;
import org.eclipse.elk.core.data.LayoutOptionData;
import org.eclipse.elk.graph.properties.IProperty;
import org.eclipse.elk.graph.properties.Property;

@SuppressWarnings("all")
public class DisCoMetaDataProvider implements ILayoutMetaDataProvider {
/**
* Default value for {@link #COMPONENT_COMPACTION_STRATEGY}.
*/
private static final CompactionStrategy COMPONENT_COMPACTION_STRATEGY_DEFAULT = CompactionStrategy.POLYOMINO;

/**
* Strategy for packing different connected components in order to save space
* and enhance readability of a graph.
*/
public static final IProperty<CompactionStrategy> COMPONENT_COMPACTION_STRATEGY = new Property<CompactionStrategy>(
"org.eclipse.elk.disco.componentCompaction.strategy",
COMPONENT_COMPACTION_STRATEGY_DEFAULT,
null,
null);

/**
* A layout algorithm that is to be applied to each connected component
* before the components themselves are compacted. If unspecified,
* the positions of the components' nodes are not altered.
*/
public static final IProperty<String> COMPONENT_COMPACTION_COMPONENT_LAYOUT_ALGORITHM = new Property<String>(
"org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm");

/**
* Access to the DCGraph is intended for the debug view,
*/
public static final IProperty<Object> DEBUG_DISCO_GRAPH = new Property<Object>(
"org.eclipse.elk.disco.debug.discoGraph");

/**
* Access to the polyominoes is intended for the debug view,
*/
public static final IProperty<Object> DEBUG_DISCO_POLYS = new Property<Object>(
"org.eclipse.elk.disco.debug.discoPolys");

public void apply(final org.eclipse.elk.core.data.ILayoutMetaDataProvider.Registry registry) {
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.disco.componentCompaction.strategy")
.group("componentCompaction")
.name("Connected Components Compaction Strategy")
.description("Strategy for packing different connected components in order to save space and enhance readability of a graph.")
.defaultValue(COMPONENT_COMPACTION_STRATEGY_DEFAULT)
.type(LayoutOptionData.Type.ENUM)
.optionClass(CompactionStrategy.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.disco.componentCompaction.componentLayoutAlgorithm")
.group("componentCompaction")
.name("Connected Components Layout Algorithm")
.description("A layout algorithm that is to be applied to each connected component before the components themselves are compacted. If unspecified, the positions of the components\' nodes are not altered.")
.type(LayoutOptionData.Type.STRING)
.optionClass(String.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.VISIBLE)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.disco.debug.discoGraph")
.group("debug")
.name("DCGraph")
.description("Access to the DCGraph is intended for the debug view,")
.type(LayoutOptionData.Type.OBJECT)
.optionClass(Object.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.HIDDEN)
.create()
);
registry.register(new LayoutOptionData.Builder()
.id("org.eclipse.elk.disco.debug.discoPolys")
.group("debug")
.name("List of Polyominoes")
.description("Access to the polyominoes is intended for the debug view,")
.type(LayoutOptionData.Type.OBJECT)
.optionClass(Object.class)
.targets(EnumSet.of(LayoutOptionData.Target.PARENTS))
.visibility(LayoutOptionData.Visibility.HIDDEN)
.create()
);
new org.eclipse.elk.alg.disco.options.DisCoOptions().apply(registry);
}
}
Loading

0 comments on commit e486c42

Please sign in to comment.