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)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. msp1 +XWiki.uru - Content
-
... ... @@ -39,7 +39,7 @@ 39 39 40 40 //**Layout Graph**// 41 41 42 -* Internal representation of the graph structure of the current diagram, built on the [[KGraph>>doc:KIELER.KGraph Meta Model]] model. 42 +* Internal representation of the graph structure of the current diagram, built on the [[KGraph>>doc:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).KGraph Meta Model.WebHome]] model. 43 43 44 44 **//Layout Algorithm//** 45 45 ... ... @@ -129,7 +129,7 @@ 129 129 130 130 = Programming Interface = 131 131 132 -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:KIELER.KGraph Meta Model]] structure, configuring and executing the layout algorithms, and writing new position information back to the diagram. It is invoked with 132 +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:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).KGraph Meta Model.WebHome]] structure, configuring and executing the layout algorithms, and writing new position information back to the diagram. It is invoked with 133 133 134 134 {{code language="java" theme="Eclipse"}} 135 135 DiagramLayoutEngine.INSTANCE.layout(workbenchPart, diagramPart) ... ... @@ -153,7 +153,7 @@ 153 153 154 154 == Connecting Layout Algorithms == 155 155 156 -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:KIELER.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"]]. 156 +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:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).KGraph Meta Model.WebHome]], 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"]]. 157 157 158 158 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. 159 159 ... ... @@ -170,10 +170,10 @@ 170 170 171 171 == Connecting Diagram Editors == 172 172 173 -(% style="line-height: 1.4285715;" %)The transformation of input diagrams to [[KGraph>>doc:KIELER.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}}. 173 +(% style="line-height: 1.4285715;" %)The transformation of input diagrams to [[KGraph>>doc:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).KGraph Meta Model.WebHome]] 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}}. 174 174 175 175 (% style="line-height: 1.4285715;" %)The diagram layout manager implementation that is applicable to the currently selected diagram viewer is chosen based on the {{code language="none"}}supports(Object){{/code}} method: the first implementation that returns {{code language="none"}}true{{/code}} for the respective workbench part instance is selected. Implementations can be assigned a priority in the extension;(%%) diagram layout managers with higher priority are queried first. The object passed to supports(Object){{code language="none"}}{{/code}} can also be an element of the selection. For example, GEF-based editors report edit part instances to the Eclipse selection service. Which diagram layout manager to use for a selected edit part is determined by testing which implementation supports that edit part instance. 176 176 177 -Each diagram layout manager must be able to map the graph structure of its supported diagram viewers to the [[KGraph>>doc:KIELER.KGraph Meta Model]] format using the {{code language="none"}}buildLayoutGraph({{/code}}…{{code language="none"}}){{/code}} method. The result is stored in a [[LayoutMapping>>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/LayoutMapping.java||shape="rect"]], which stores a bidirectional map between graph elements and diagram elements and can be enriched with additional information. Such information is often required when the new computed layout is applied back to the diagram, which is done with {{code language="none"}}applyLayout({{/code}}…{{code language="none"}}){{/code}}. This method is also responsible for applying animation of the transition between the old layout and the new layout and for automatic zooming, if requested. 177 +Each diagram layout manager must be able to map the graph structure of its supported diagram viewers to the [[KGraph>>doc:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).KGraph Meta Model.WebHome]] format using the {{code language="none"}}buildLayoutGraph({{/code}}…{{code language="none"}}){{/code}} method. The result is stored in a [[LayoutMapping>>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/LayoutMapping.java||shape="rect"]], which stores a bidirectional map between graph elements and diagram elements and can be enriched with additional information. Such information is often required when the new computed layout is applied back to the diagram, which is done with {{code language="none"}}applyLayout({{/code}}…{{code language="none"}}){{/code}}. This method is also responsible for applying animation of the transition between the old layout and the new layout and for automatic zooming, if requested. 178 178 179 179 (% style="line-height: 1.4285715;" %)There are many ways to customize the configuration of graphs created by layout managers. These are documented in [[doc:KIELER.Home.Discontinued Projects.Infrastructure for Meta Layout (KIML).Configuring Automatic Layout.WebHome]].