Changes for page Infrastructure for Meta Layout (KIML)
Last modified by Richard Kreissig on 2023/09/14 10:13
Summary
-
Page properties (2 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. msp1 +XWiki.arl - Content
-
... ... @@ -1,4 +1,4 @@ 1 -{{panel title="Project Overview" borderStyle="dashed"}}1 +{{panel borderStyle="dashed" title="Project Overview"}} 2 2 Related Publications: 3 3 4 4 * Miro Spönemann, Hauke Fuhrmann, and Reinhard von Hanxleden. //Automatic Layout of Data Flow Diagrams in KIELER and Ptolemy II//. Technical Report 0914, Christian-Albrechts-Universität zu Kiel, Department of Computer Science, 2009. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/report-0914.pdf||shape="rect"]] / [[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=SpoenemannFvH09||shape="rect"]]) ... ... @@ -19,13 +19,13 @@ 19 19 20 20 {{toc maxLevel="2"/}} 21 21 22 -= Getting Started [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#GettingStarted||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] =22 += Getting Started = 23 23 24 24 This subproject deals with the automatic layout of graph-based models. KIML offers interfaces to connect layout algorithms to diagram editors and viewers. The focus is on flexible configurability, which is a crucial issue for creating good layouts for different graphical languages and in different circumstances. The term //meta layout// relates to the idea of specifying the layout of a diagram on an abstract level, while //concrete layout// information is computed by layout algorithms. 25 25 26 26 In order to use KIML with your own GMF-based editor, you need to do the following steps: 27 27 28 -1. Install the "//KIELER Layout for GMF//" feature from our update site, see [[Downloads>>url:http://www.informatik.uni-kiel.de/en/r tsys/kieler/downloads/||shape="rect"]]28 +1. Install the "//KIELER Layout for GMF//" feature from our update site, see [[Downloads>>url:http://www.rtsys.informatik.uni-kiel.de/en/research/kieler/||shape="rect"]] 29 29 1*. It includes the Java-based layout algorithms developed in the [[KLay project>>doc:Layout Algorithms (KLay)]]. 30 30 1. Open a diagram and press the layout button [[image:attach:kieler-arrange.gif]] or use the shortcut Ctrl+R L. 31 31 ... ... @@ -81,11 +81,11 @@ 81 81 82 82 * A singleton class for invoking layout algorithms on diagram viewers and editors. 83 83 84 -= User Interface [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#UserInterface||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] =84 += User Interface = 85 85 86 86 The main user interface element of KIML is the command to layout the current diagram. This command is available in the toolbar ([[image:attach:kieler-arrange.gif]]) or using the Ctrl+R L shortcut. Additionally, an entry in the context menu allows to layout only a selected part of the diagram. 87 87 88 -== Layout View [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#LayoutView||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] ==88 +== Layout View == 89 89 90 90 [[image:attach:layout_view.png]] 91 91 ... ... @@ -105,7 +105,7 @@ 105 105 106 106 The information button of the view toolbar can be used to display some useful details on the current selection, such as the edit part and domain model classes. 107 107 108 -== Preference Page [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#PreferencePage||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] ==108 +== Preference Page == 109 109 110 110 [[image:attach:preference_page.png]] 111 111 ... ... @@ -123,11 +123,11 @@ 123 123 124 124 Creating a new entry requires the selection of the type of related element and entering its class name or identifier. Class names of diagram parts and domain model elements can be explored using the information button of the layout view, while diagram type identifiers can be selected with the //Browse// button. After that, a layout option has to be selected from the list using the corresponding //Browse //button. Hitting //OK// creates an entry, and its value can then be set using the //Edit// button. 125 125 126 -= Programming Interface [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#InternalStructure||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] =126 += Programming Interface = 127 127 128 128 The primary API of KIML is the [[DiagramLayoutEngine>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml.service/src/de/cau/cs/kieler/kiml/service/DiagramLayoutEngine.java||shape="rect"]], which is responsible for analyzing diagrams, creating a [[KGraph>>doc:KGraph Meta Model]] structure, configuring and executing the layout algorithms, and writing new position information back to the diagram. It is invoked with 129 129 130 -{{code theme="Eclipse" language="java"}}130 +{{code language="java" theme="Eclipse"}} 131 131 DiagramLayoutEngine.INSTANCE.layout(workbenchPart, diagramPart) 132 132 {{/code}} 133 133 ... ... @@ -147,15 +147,15 @@ 147 147 148 148 KIML makes extensive use of the [[IPropertyHolder>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/properties/IPropertyHolder.java||shape="rect"]] interface; a //property holder// is an object that can give and receive values for specific properties. The key for specifying which property to access is [[IProperty>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/properties/IProperty.java||shape="rect"]], which is usually instanced exactly once for each property. The layout data classes [[KShapeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KShapeLayout.java||shape="rect"]] and [[KEdgeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KEdgeLayout.java||shape="rect"]] are property holders, which means that they can store layout option values for the graph elements they are connected with. 149 149 150 -== Connecting Layout Algorithms [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#ConnectingLayoutAlgorithms||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] ==150 +== Connecting Layout Algorithms == 151 151 152 -Layout algorithms must be connected by extending [[AbstractLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/AbstractLayoutProvider.java||shape="rect"]]. The input of [[t>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/AbstractLayoutProvider|| rel="nofollow"style="text-decoration: none;" shape="rect" class="missing wiki"]]he {{code language="none"}}doLayout{{/code}} method is an instance of the [[KGraph>>doc:KGraph Meta Model]], an [[EMF>>url:http://www.eclipse.org/modeling/emf/||shape="rect"]] based graph structure, together with a progress monitor ([[IKielerProgressMonitor>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/alg/IKielerProgressMonitor.java||shape="rect"]]). The graph is represented by a [[KNode>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core.kgraph/src/de/cau/cs/kieler/core/kgraph/KNode.java||shape="rect"]], which serves as top-level container. The contained graph elements initially have attached [[KShapeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KShapeLayout.java||shape="rect"]] or [[KEdgeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KEdgeLayout.java||shape="rect"]] with information on the original layout of the diagram as well as an abstract layout specified by layout options. The layout provider should consider layout options from the attached layout data, execute a layout algorithm, and write the concrete results back to the layout data. A good example for a layout provider implementation is [[LayeredLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.klay.layered/src/de/cau/cs/kieler/klay/layered/LayeredLayoutProvider.java||shape="rect"]].152 +Layout algorithms must be connected by extending [[AbstractLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/AbstractLayoutProvider.java||shape="rect"]]. The input of [[t>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/AbstractLayoutProvider||style="text-decoration: none;" rel="nofollow" shape="rect" class="missing wiki"]]he {{code language="none"}}doLayout{{/code}} method is an instance of the [[KGraph>>doc:KGraph Meta Model]], an [[EMF>>url:http://www.eclipse.org/modeling/emf/||shape="rect"]] based graph structure, together with a progress monitor ([[IKielerProgressMonitor>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/alg/IKielerProgressMonitor.java||shape="rect"]]). The graph is represented by a [[KNode>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core.kgraph/src/de/cau/cs/kieler/core/kgraph/KNode.java||shape="rect"]], which serves as top-level container. The contained graph elements initially have attached [[KShapeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KShapeLayout.java||shape="rect"]] or [[KEdgeLayout>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/klayoutdata/KEdgeLayout.java||shape="rect"]] with information on the original layout of the diagram as well as an abstract layout specified by layout options. The layout provider should consider layout options from the attached layout data, execute a layout algorithm, and write the concrete results back to the layout data. A good example for a layout provider implementation is [[LayeredLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.klay.layered/src/de/cau/cs/kieler/klay/layered/LayeredLayoutProvider.java||shape="rect"]]. 153 153 154 154 The {{code language="none"}}layoutProviders{{/code}} extension point is needed to register layout algorithms; one layout provider class may provide multiple layout algorithms by giving a parameter string in the extension point. The extension point allows to attach information on known layout options, supported diagram types, and supported graph features to a layout algorithm. The known layout options are those that are offered in the Layout view when the respective algorithm is selected. The supported diagram types are used to automatically select the most suitable algorithm for a specific diagram type: from all algorithms that state to support a given type, the one with the highest priority is taken. The supported graph features are used to state which special features that a graph can contain can be handled by the algorithm; examples for such features are edge labels, ports, or clusters. Furthermore, the extension point can be used to specify new layout options, layout types, and categories of layout algorithms. 155 155 156 156 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>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/properties/Property.java||shape="rect"]] constant for easy use in the implementation of layout algorithms. KIML comes with a large set of [[built-in layout options>>doc:KIML Layout Options]], which are all defined in [[LayoutOptions>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/options/LayoutOptions.java||shape="rect"]]. Layout providers can access the layout option values using the [[IPropertyHolder>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.core/src/de/cau/cs/kieler/core/properties/IPropertyHolder.java||shape="rect"]] interface: 157 157 158 -{{code theme="Eclipse" language="java"}}158 +{{code language="java" theme="Eclipse"}} 159 159 KShapeLayout nodeLayout = parentNode.getData(KShapeLayout.class); 160 160 boolean isInteractive = nodeLayout.getProperty(LayoutOptions.INTERACTIVE); 161 161 {{/code}} ... ... @@ -164,7 +164,7 @@ 164 164 165 165 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 {{code language="none"}}boolean{{/code}} without checking for NullPointerExceptions or ClassCastExceptions. 166 166 167 -== Connecting Diagram Editors [[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#ConnectingDiagramEditors||style="text-decoration:none;" title="Link to this section" shape="rect" class="anchor"]] ==167 +== Connecting Diagram Editors == 168 168 169 169 (% style="line-height: 1.4285715;" %)The transformation of input diagrams to [[KGraph>>doc:KGraph Meta Model]] instances as well as the transfer of computed layouts back to the input diagrams is done by (%%)[[IDiagramLayoutManager>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler/plugins/de.cau.cs.kieler.kiml.ui/src/de/cau/cs/kieler/kiml/ui/diagram/IDiagramLayoutManager.java||style="line-height: 1.4285715;" shape="rect"]](% style="line-height: 1.4285715;" %) implementations. For most diagram editors that are based on (%%)[[GMF>>url:http://www.eclipse.org/modeling/gmp/||style="line-height: 1.4285715;" shape="rect"]](% style="line-height: 1.4285715;" %) the generic (%%)[[GmfDiagramLayoutManager>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml.gmf/src/de/cau/cs/kieler/kiml/gmf/GmfDiagramLayoutManager.java||shape="rect"]](% style="line-height: 1.4285715;" %) can be used, while for (%%)[[Graphiti>>url:http://www.eclipse.org/graphiti/||style="line-height: 1.4285715;" shape="rect"]](% style="line-height: 1.4285715;" %) there is the generic (%%)[[GraphitiDiagramLayoutManager>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml.graphiti/src/de/cau/cs/kieler/kiml/graphiti/GraphitiDiagramLayoutManager.java||shape="rect"]](% style="line-height: 1.4285715;" %). However, some customized diagram editors do not work with the generic diagram layout managers and hence require their own specialized implementations, which can be contributed with the extension point {{code language="none"}}layoutManagers{{/code}}. 170 170
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 - 201537131 +37814389 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/ 20153713/Infrastructure for Meta Layout (KIML)1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/37814389/Infrastructure for Meta Layout (KIML)