Page History
Warning |
---|
KIML has been discontinued and is replaced by the Eclipse Layout Kernel (ELK). |
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Related Publications:
Related Theses:
|
...
Contents
Table of Contents | ||
---|---|---|
|
...
- Install the "KIELER Layout for GMF" feature from our update site, see Downloads
- It includes the Java-based layout algorithms developed in the KLay project.
- Open a diagram and press the layout button or use the shortcut Ctrl+R L.
...
The primary API of KIML is the DiagramLayoutEngine, which is responsible for analyzing diagrams, creating a KGraph structure, configuring and executing the layout algorithms, and writing new position information back to the diagram. It is invoked with
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
DiagramLayoutEngine.INSTANCE.layout(workbenchPart, diagramPart) |
...
Each layout option that is registered in the extension point needs a corresponding constant in Java code, where the most relevant data is replicated with a Property constant for easy use in the implementation of layout algorithms. KIML comes with a large set of built-in layout options, which are all defined in LayoutOptions. Layout providers can access the layout option values using the IPropertyHolder interface:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
KShapeLayout nodeLayout = parentNode.getData(KShapeLayout.class); boolean isInteractive = nodeLayout.getProperty(LayoutOptions.INTERACTIVE); |
...
The layout option that is used in this example has a default value, thus it is guaranteed that the option always returns a valid value. This and the fact that properties are type-safe allows us to implicitly cast and unbox the returned value to a boolean
without checking for NullPointerExceptions or ClassCastExceptions.
...