Page History
...
KIML defines a whole set of standard layout options that many layout algorithms support. Whether an algorithm supports a layout option depends on the option and on the algorithm. When an option is supported by an algorithm, it that algorithm may change override the option's default value. Algorithms may also provide more specialized documentation for a given layout optionoptions.
Contents
Table of Contents | ||
---|---|---|
|
Overview
Beside a humanuser-readable friendly name, layout options are defined by the following properties:
- An ID to identify them.
- A type. One of Boolean, String, Int, Float, Enum, EnumSet (a
Set
set
over a given enumeration), or Object (a non-primitive Java object). The types Enum and EnumSet have to be further defined by an enumeration class. The Object type can be constricted to a certain Java class. - The kinds of graph objects the option applies to. At least one of Parents (nodes that have children, including the diagram root node), Nodes, Edges, Ports, and or Labels.
- An optional default value. If an option is not set on an object and if the option does not have a default value,
null
is returned when it is accessed.
...
- A default value may also be provided by the layout algorithm using the option, or by the modeling application you are using. In these cases the value given here is overridden.
Layout options can be assigned to two main categories: user options and programmatic options.
User Options
User options are those that you can see in the "Layout View" available in Eclipse if the KIML user interface is installed. That view is restricted to layout options that are supported by the currently active layout algorithm. Furthermore, some options are visible only when the Show Advanced Properties button is active in the view.
Option | ID | Type | Applies to | Default | ||||
---|---|---|---|---|---|---|---|---|
Alignment | de.cau.cs.kieler.alignment | Enum | Nodes | AUTOMATIC | ||||
Aspect Ratio | de.cau.cs.kieler.aspectRatio | Float | Parents | 0.0 | ||||
Bend Points | de.cau.cs.kieler.bendPoints | Object | Edges | |||||
Border Spacing | de.cau.cs.kieler.borderSpacing | Float | Parents | Comment Box | ||||
de.cau.cs.kieler.commentBox | Boolean | Nodes | false | Debug Mode | de.cau.cs.kieler.debugMode | Boolean | Parents | false |
Direction | de.cau.cs.kieler. | diagramTypedirection | StringEnum | Parents | Direction | |||
Edge Routing | de.cau.cs.kieler.directionedgeRouting | Enum | Parents | Edge Label Placement | ||||
Expand Nodes | de.cau.cs.kieler. | edgeLabelPlacementexpandNodes | EnumBoolean | LabelsParents | false | |||
Edge RoutingInteractive | de.cau.cs.kieler.edgeRoutinginteractive | EnumBoolean | Parents | false | Edge Type||||
Label Spacing | de.cau.cs.kieler. | edgeTypelabelSpacing | EnumFloat | Edges | NONE | Expand NodesNodes | ||
Layout Hierarchy | de.cau.cs.kieler.expandNodeslayoutHierarchy | Boolean | Parents | false | ||||
Layout Algorithm | de.cau.cs.kieler. | fontNamealgorithm | String | LabelsParents | ||||
Font SizeNode Label Placement | de.cau.cs.kieler.fontSizenodeLabelPlacement | IntEnumSet | LabelsNodes | Hypernode | ||||
Port Constraints | de.cau.cs.kieler. | hypernodeportConstraints | BooleanEnum | Nodes | falseInteractive | |||
Port Label Placement | de.cau.cs.kieler. | interactiveportLabelPlacement | BooleanEnum | ParentsNodes | falseOUTSIDE | |||
Port Spacing | de.cau.cs.kieler. | labelSpacingportSpacing | Float | EdgesNodes | ||||
Layout HierarchyPosition | de.cau.cs.kieler.layoutHierarchy | Boolean | Parents | false | Layout Algorithmposition | Object | Labels | |
Priority | de.cau.cs.kieler.algorithmpriority | IntString | Edges ParentsNodes | |||||
Minimal HeightRandomization Seed | de.cau.cs.kieler.minHeightrandomSeed | FloatInt | Nodes Parents | 0.0 | Minimal Width | |||
Separate Connected Components | de.cau.cs.kieler.minWidthseparateConnComp | Float | NodesBoolean | Parents | 0.0 | No Layout | ||
Size Constraint | de.cau.cs.kieler.noLayoutsizeConstraint | EnumSet | BooleanNodes | false | ||||
Node Label PlacementSize Options | de.cau.cs.kieler.nodeLabelPlacementsizeOptions | EnumSet | Nodes | Port Constraints | DEFAULT_MINIMUM_SIZE | |||
Spacing | de.cau.cs.kieler. | portConstraintsspacing | EnumFloat | Nodes | Port Label PlacementParents |
Programmatic Options
Programmatic options are such that are meant to be configured exclusively through the KIML API. They should not be visible in the user interface.
Option | ID | Type | Applies to | Default | ||
---|---|---|---|---|---|---|
Diagram Type | de.cau.cs.kieler. | portLabelPlacementdiagramType | EnumString | NodesParents | OUTSIDE | Port Offset|
Edge Label Placement | de.cau.cs.kieler. | offsetedgeLabelPlacement | FloatEnum | PortsLabels | ||
Port SideEdge Type | de.cau.cs.kieler.portSideedgeType | Enum | PortsEdges | NONE | ||
Port SpacingFont Name | de.cau.cs.kieler.portSpacingfontName | FloatString | NodesLabels | |||
Font Size | de.cau.cs.kieler. | positionfontSize | ObjectInt | Labels | Ports | |
Hypernode | de.cau.cs.kieler. | priorityhypernode | Int | EdgesBoolean | Nodes | falseRandomization |
SeedMinimal Height | de.cau.cs.kieler.randomSeedminHeight | FloatInt | Nodes | Separate Connected Components0.0 | ||
Minimal Width | de.cau.cs.kieler.separateConnCompminWidth | FloatBoolean | Nodes | Size Constraint0.0 | ||
No Layout | de.cau.cs.kieler.sizeConstraintnoLayout | EnumSetBoolean | Nodes | falseSize | ||
OptionsPort Offset | de.cau.cs.kieler.sizeOptionsoffset | EnumSetFloat | Nodes | DEFAULT_MINIMUM_SIZE | SpacingPorts | |
Port Side | de.cau.cs.kieler.spacingportSide | FloatEnum | ParentsPorts |
Detailed Documentation
The Most Important Options
While most layout options are used to affect how the active layout algorithm computes concrete coordinates for the graph elements, there are some layout options that have a special role in KIML.
Layout Algorithm
Anchor | ||||
---|---|---|---|---|
|
The option with identifier de.cau.cs.kieler.algorithm
specifies which layout algorithm to use for the content of a composite node. The value can be either the identifier of a layout algorithm or the identifier of a layout type. In the latter case the algorithm with highest priority of that type is applied.
...
- The KLay Project - Java implementations of standard layout approaches, augmented with special processing of graph features such as ports and edge labels.
- Randomizer - Distributes the nodes randomly; not very useful, but it can show how important a good layout is for understanding a graph.
Box Layout - Ignores edges, places all nodes in rows. Can be used to layout collections of unconnected boxes, such as Statechart regions.
- Fixed Layout - Does not compute a new layout, but leaves all nodes and edges where they are. If the Position and Bend Points options are set for the elements of the graph, the pre-defined layout is applied.
- OGDF (www.ogdf.net) - A self-contained C++ class library for the automatic layout of diagrams. The version that is shipped with KIELER is compiled as an executable that reads files in OGML format and outputs the computed concrete layout.
- Graphviz (www.graphviz.org) - An open source graph visualization tool with several graph layout programs, web and interactive graphical interfaces, auxiliary tools, libraries, and language bindings. Graphviz needs to be installed separately in order to be used within KIELER, since it is called in a separate process using the DOT language for communication.
Diagram Type
Anchor | ||||
---|---|---|---|---|
|
Diagram types are used to classify graphical diagrams for setting default layout option values for a set of similar diagrams. The diagram type of an element is specified with the layout option de.cau.cs.kieler.diagramType
. Layout algorithms can declare which diagram types they support well, and give a priority value for each supported type. KIML decides at runtime which layout algorithm has the highest priority for a given diagram, so that the most suitable algorithm is always used. Usual values for such priorities are between 1 and 10, where the highest value should only be assigned if the algorithm is especially designed for diagrams of the respective type, or if it has proven to be very adequate for them. Lower values should be given if the algorithm is able to draw the diagrams correctly, but with lower quality of the resulting layout.
...
- Layout Hierarchy (
de.cau.cs.kieler.layoutHierarchy
) - If this option is supported and active, the layout algorithm is requested to process the full hierarchy contained in the input node. This means that instead of executing another algorithm on each hierarchy level, all levels are arranged in a single algorithm execution. - Hypernode (
de.cau.cs.kieler.hypernode
) - A node that is marked as hypernode has a special role in the graph structure, since all its incident edges are treated as parts of the same hyperedge. Example: relation vertices in Ptolemy models. - Comment Box (
de.cau.cs.kieler.commentBox
) - A node that is marked as comment box is treated as a label that needs to be placed somewhere. This is different to normal node labels, which are usually regarded as fixed. - No Layout (
de.cau.cs.kieler.noLayout
) - Elements that are marked with this option are excluded from layout. This is used to identify diagram objects that should not be regarded as graph elements.
...
This section explains every layout option in more detail.
Edge Routing
Anchor | ||||
---|---|---|---|---|
|
This option influences the way in which edges are routed between the nodes they connect. The following settings are available:
...
TODO: Add an image illustrating the different routing styles.
Port Offset
Anchor | ||||
---|---|---|---|---|
|
The port offset is used to specify how much space a layout algorithm should leave between a port and the border of its node. This is usually zero, but doesn't have to be. If the offset is not defined for a given port, a layout algorithm can try to infer the offset from the port's coordinates and its node's size in the input graph. This of course requires both properties to be set to sensible values.
...