Changes for page Infrastructure for Meta Layout (KIML)
Last modified by Richard Kreissig on 2023/09/14 10:13
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,32 +1,26 @@ 1 1 {{panel title="Project Overview" borderStyle="dashed"}} 2 2 Responsible: 3 3 4 -* {{mentionreference="XWiki.msp"style="FULL_NAME"anchor="XWiki-msp-SVmBQ"/}}4 +* [[Miro Spönemann>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/msp/||shape="rect"]] 5 5 6 6 Related Publications: 7 7 8 -* 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"]]) 9 -* Hauke Fuhrmann, Miro Spönemann, Michael Matzen, and Reinhard von Hanxleden. Automatic layout and structure-based editing of UML diagrams. In //Proceedings of the 1st Workshop on Model Based Engineering for Embedded Systems Design// (M-BED'10), Dresden, 2010. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/mbed10.pdf||shape="rect"]] / [[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=FuhrmannSM+10||shape="rect"]]) 10 -* Christian Schneider, Miro Spönemann, and Reinhard von Hanxleden. Transient view generation in Eclipse. In //Proceedings of the First Workshop on Academics Modeling with Eclipse//, Kgs. Lyngby, Denmark, 2012. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/acme12.pdf||shape="rect"]] / [[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=SchneiderSvH12a||shape="rect"]]) 11 -* Miro Spönemann, Christoph Daniel Schulze, Christian Motika, Christian Schneider, and Reinhard von Hanxleden. KIELER: Building on Automatic Layout for Pragmatics-Aware Modeling (Showpiece). In //Proceedings of the IEEE Symposium on Visual Languages and Human-Centric Computing// (VL/HCC’13), San Jose, CA, USA, 15–19 September 2013. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/vlhcc13-showpiece.pdf||shape="rect"]] / [[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=SpoenemannSM+13||shape="rect"]]) 8 +* (% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %)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. ((% style="color: rgb(0,0,0);" %)[[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/report-0914.pdf||shape="rect"]](% style="color: rgb(0, 0, 0); color: rgb(0, 0, 0)" %) / (% style="color: rgb(0,0,0);" %)[[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=SpoenemannFvH09||shape="rect"]]) 9 +* (% style="color: rgb(0,0,0);" %)Hauke Fuhrmann, Miro Spönemann, Michael Matzen, and Reinhard von Hanxleden. Automatic Layout and Structure-Based Editing of UML Diagrams. In (% class="cmti-10" %)//Proceedings of the 1st Workshop on Model Based//(%%)// (% class="cmti-10" %)Engineering for Embedded Systems Design (M-BED'10)//(%%), Dresden, 2010. ((%%)[[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/papers/mbed10.pdf||shape="rect"]] (% style="color: rgb(0,0,0);" %)/ (%%)[[bib>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/cgi-bin/bibcgi.cgi?key=FuhrmannSM+10||shape="rect"]]) 12 12 13 13 Related Theses: 14 14 15 -* Björn Duderstadt, //Evolutionary Meta Layout for KIELER//, May 2011 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/theses/bdu-st.pdf||shape="rect" class="extTarget"]]) 13 +* (% style="color: rgb(0,0,0);" %)Björn Duderstadt, //Evolutionary Meta Layout for KIELER//, May 2011 ((%%)[[pdf>>url:http://rtsys.informatik.uni-kiel.de/~~biblio/downloads/theses/bdu-st.pdf||style="text-decoration: none;" shape="rect" class="extTarget"]](% style="color: rgb(0,0,0);" %)) 16 16 {{/panel}} 17 17 16 +This subproject deals with the automatic layout of graph-based models. The term //meta layout// relates to the idea of specifying the layout of a diagram on an abstract level, while //concrete layout// information is calculated by layout algorithms. 17 + 18 18 19 19 20 -===== Contents ===== 21 - 22 - 23 - 24 24 {{toc maxLevel="2"/}} 25 25 26 26 = 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"]] = 27 27 28 -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. 29 - 30 30 In order to use KIML with your own GMF-based editor, you need to do the following steps: 31 31 32 32 1. Install the "//KIELER Layout for GMF//" feature from our update site, see [[Downloads>>url:http://www.informatik.uni-kiel.de/en/rtsys/kieler/downloads/||shape="rect"]] ... ... @@ -33,147 +33,74 @@ 33 33 1*. It includes the Java-based layout algorithms developed in the [[KLay project>>doc:Layout Algorithms (KLay)]]. 34 34 1. Open a diagram and press the layout button [[image:attach:kieler-arrange.gif]] or use the shortcut Ctrl+R L. 35 35 36 - Similarly,the"//KIELER Layout for Graphiti//" featureprovidesthe KIML interfacetoGraphiti-basededitors.30 +For development with the KIML plug-ins, check out using team project sets: 37 37 38 -== Terminology == 32 +* [[(% class="icon" %) (%%)Project set for KIML with GMF>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/projectsets/de.cau.cs.kieler.kiml.gmf.psf||style="text-decoration: none;" shape="rect" class="ext-link"]] 33 +* [[(% class="icon" %) (%%)Project set for KIML with Graphiti>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/projectsets/de.cau.cs.kieler.kiml.graphiti.psf||style="text-decoration: none;" shape="rect" class="ext-link"]] 39 39 40 - //**LayoutGraph**//35 += Introduction = 41 41 42 - *Internal representation of the graph structure of the current diagram, built onthe [[KGraph>>doc:KGraph Meta Model]] model.37 +=== Terminology === 43 43 44 -**//Layout Algorithm//** 45 - 46 -* An algorithm that takes a layout graph as input and computes positions for all elements of the graph. 47 - 48 -**//Layout Provider//** 49 - 50 -* A component that provides one or more layout algorithms to KIML. 51 - 52 -**//Layout Option//** 53 - 54 -* A customization point for layout algorithms, with a specific data type and optionally a default value. 55 - 56 -**//Layout Configurator//** 57 - 58 -* A component that is responsible for retrieving specific layout option values for model elements. 59 - 60 -**//Layout Data//** 61 - 62 -* Concrete layout data (position and size) and abstract layout data (layout options) attached to elements of the layout graph using the [[KLayoutData>>doc:KLayoutData Meta Model]] model. 63 - 64 -//**Layout Meta Data**// 65 - 66 -* Meta information on layout algorithms, layout options, etc. gathered through extension points. 67 - 68 -//**Meta Layout**// 69 - 70 -* The process of creating abstract layout data (configuration of layout options) through layout configurators. In a more general sense, also used for the whole layout infrastructure. 71 - 72 -**//Layout Type//** 73 - 74 -* Classification of layout algorithms depending on their basic approach (e.g. layered, force, etc.). 75 - 76 -**//Diagram Type//** 77 - 78 -* Classification of graphical diagrams used to set default layout option values for all diagrams of a specific type (e.g. state machines, data flow diagrams, etc.). 79 - 80 -**//Diagram Layout Manager//** 81 - 82 -* The central interface for connecting diagram editors with layout algorithms. 83 - 84 -//**Diagram Layout Engine**// 85 - 86 -* A singleton class for invoking layout algorithms on diagram viewers and editors. 87 - 88 88 = 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"]] = 89 89 90 -The main user interface element of KIML is the command to layout the current diagram. This command is availab le 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.41 +The main user interface element of KIML is the command to layout the current diagram. This command is availabe in the main KIELER menu, 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. 91 91 92 -== 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"]] == 43 +=== 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"]] === 93 93 94 -[[image:attach:layout_view.png]] 45 +[[~[~[image:url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/raw-attachment/wiki/Projects/KIML/layout_view.png~]~]>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/attachment/wiki/Projects/KIML/layout_view.png||style="text-decoration: none;" shape="rect"]]The //Layout// view allows flexible customization of layout options for the selected objects in the diagram. If no object is selected, the view shows the options for the top-level container of the diagram. Options are stored persistently in the notation model of the diagram, so that they are still available after the next Eclipse restart. Of course this requires the diagram to be saved after an option was changed. 95 95 96 -The //Layout// view allowsflexible customization oflayoutoptionsforthe selected objectsin the diagram.If noobjectis selected,theviewshowsthe options for thetop-levelcontainerofthe diagram.Options are stored persistentlyin thenotationmodel ofthediagram, sothattheyarestillavailableafterthenextEclipserestart.Of course thisrequires thediagramtobesavedafter anoptionwaschanged.47 +The options are grouped according to the function of the selected objects. The group //Nodes// (respectively //Edges//, //Ports//, or //Labels//) contains options related to the object itself, such as its size or priority, while the group//Parents// contains options for the elements contained in the selected objects, such as the applied layout algorithm or the spacing between elements. Which layout options are displayed depends on the types of selected objects and the active layout algorithm, since such algorithms may not support all kinds of options. Furthermore, some options are only visible if the //Show Advanced Properties// button in the view toolbar is activated. The group types can be hidden using the //Show Categories// button. 97 97 98 -The options can be grouped according to the function of the selected object. The groups //Node,// //Edge//, //Port//, and //Label// contain options related to the object itself, such as its size or priority, while the groups //Graph// and// Subgraph// contain options for the elements contained in the selected object, such as the applied layout algorithm or the spacing between elements. Which layout options are displayed depends on the types of selected objects and the active layout algorithm, since each algorithm supports only a subset of the available options. Furthermore, some options are only visible if the //Show Advanced Properties// button in the view toolbar is activated. The group types can be hidden using the //Show Categories// button. 99 - 100 100 An option can be changed by selecting or entering a new value in the corresponding cell of the //Value// column. The most important option is //Layout Algorithm//, which is used to determine the layout algorithm for the contents of the selected element. Here either a specific layout algorithm or a layout type can be chosen; in the latter case, the most suitable layout algorithm of the given type is taken. By changing the active layout algorithm, the content of the layout view is updated to display only those options that are supported by the new layout algorithm. 101 101 102 -Selecting //Restore Default Value// in the context menu or the view toolbar removes any value for the currently selected option that is stored in the currentmodel file, thus resetting the option to its default value. The view menu has an entry //Remove all Layout Options// which resets all optionsof the current modelby removing persistent data in the model file.51 +Selecting //Restore Default Value// in the context menu or the view toolbar removes any value for the currently selected option that is stored in the open model file, thus resetting the option to its default value. The view menu has an entry //Remove all Layout Options// which resets all options by removing persistent data in the model file. 103 103 104 - Thestandard layout options defined inKIMLare documented in[[doc:KIML LayoutOptions]].However,layout algorithmsmay define additional layout options.53 +[[~[~[image:url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/raw-attachment/wiki/Projects/KIML/context_menu.png~]~]>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/attachment/wiki/Projects/KIML/context_menu.png||style="text-decoration: none;" shape="rect"]]The context menu for a specific layout option has different alternatives to set the current value as default value: //Set as Default for this Diagram// changes the open model file so that the same value is applied to all similar objects of that model. //Set as Default for ... in this Context// applies the value to all similar objects that are displayed with the same diagram editor (the option is linked to the //edit part// class of the selected object). Choosing //Set as Default for all ...// links the option value with the domain model element or diagram type of the selected object (see Figure [[context_menu>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/attachment/wiki/Projects/KIML/context_menu.png||style="text-decoration: none;" title="Attachment 'context_menu.png' in Projects/KIML" shape="rect" class="attachment"]](% class="noprint" %) [[~[~[image:url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/chrome/common/download.png~]~]>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/raw-attachment/wiki/Projects/KIML/context_menu.png||style="text-decoration: none;" title="Download" shape="rect" class="trac-rawlink"]](%%)). These four alternatives have different priorities: if present, the default value for the current diagram is taken first, then the default value for the edit part is checked, then the default value for the domain model element, and then the default value for the diagram type. 105 105 106 -[[image:attach:context_menu.png]] 107 - 108 -The context menu for a specific layout option has different alternatives to set the currently active value as default value: //Set as Default for this Diagram// changes the open model file so that the same value is applied to all similar objects of that model. //Set as Default for ... in this Context// applies the value to all similar objects that are displayed with the same diagram editor (the option is linked to the //edit part// class of the selected object). Choosing //Set as Default for all ...// links the option value with the domain model element or diagram type of the selected object (see the context menu depicted above). These four alternatives have different priorities: if present, the default value for the current diagram is taken first, then the default value for the edit part is checked, then the default value for the domain model element, and then the default value for the diagram type. 109 - 110 110 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. 111 111 112 -== 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"]] == 57 +=== 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"]] === 113 113 114 -[[image:attach :preference_page.png]]59 +[[~[~[image:url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/raw-attachment/wiki/Projects/KIML/preferences.png~]~]>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/attachment/wiki/Projects/KIML/preferences.png||style="text-decoration: none;" shape="rect"]]If //Set routing style of all edges to oblique// is active, all routing styles and smoothness settings of edges are removed when automatic layout is performed. Since most layouters compute the routing of edges as part of their algorithm, these styles usually do not yield the expected results. 115 115 116 -// Animate layout//enables animation of the transition of the old layout to the newlayoutwheneverthe layout isrecomputed.61 +The //Default Layout Option Values// table is used to manage the default setting for layout options, which can also be modified with the context menu of the layout view (see above). All user-defined settings are displayed here, and the buttons on the right of the table serve to create, edit, and remove entries. The //Type// column shows the type of element the option is linked with: either //edit part//,//model element//, or //diagram type//. The //Element// column shows the class name for options that relate to edit parts or domain model elements, and the diagram type name for options that relate to diagram types. //Option// is the name of the layout option, and //Value// is the currently set value of the option. 117 117 118 - Automaticzoomingcan be enabled with //Zoomto fit after layout//.63 +Creating a new entry requires the selection of the type of related element and entering its class name or identifier. Class names of edit 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. 119 119 120 -I f//Show layoutprogress//isactive,aprogressdialogis shownduringthecomputationoflayouts.65 +== Internal Structure[[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"]] == 121 121 122 - If //Obliqueedgerouting// is active, allrouting styles and smoothnesssettingsof edgesare removedwhen automatic layout isperformed on GMF editors.Sincemost layouters compute the routingof edges as part oftheiralgorithm, these styles usually do not yieldtheexpectedresults.67 +The central concept of the KIML implementation is the [[DiagramLayoutManager>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/ui/layout/DiagramLayoutManager.html||style="text-decoration: none;" shape="rect" class="javadoc"]], which is responsible for analyzing diagrams, creating a [[KGraph>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KGraph||style="text-decoration: none;" shape="rect" class="wiki"]] structure, creating a //layout configuration//, and writing new position information back to the diagram. Internally, GEF diagrams are composed of //figures// (responsible for drawing the diagram), //edit parts// (the controllers), //notation// model elements (holding concrete layout data), and //domain// model elements (holding semantic data). For each type of diagram, a specialized diagram layout manager implementation is needed, e.g. in [[de.cau.cs.kieler.kiml.gmf>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/browser/plugins/de.cau.cs.kieler.kiml.gmf||style="text-decoration: none;" shape="rect" class="source"]] for [[(% class="icon" %) (%%)GMF>>url:http://www.eclipse.org/modeling/gmp/||style="text-decoration: none;" shape="rect" class="ext-link"]] and in [[de.cau.cs.kieler.kiml.graphiti>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/browser/plugins/de.cau.cs.kieler.kiml.graphiti||style="text-decoration: none;" shape="rect" class="source"]] for [[(% class="icon" %) (%%)Graphiti>>url:http://www.eclipse.org/graphiti/||style="text-decoration: none;" shape="rect" class="ext-link"]]. Diagram layout managers provide [[IGraphicalFrameworkBridge>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/ui/IGraphicalFrameworkBridge.html||style="text-decoration: none;" shape="rect" class="javadoc"]]s to access features that are specific to the respective editing framework, and[[ILayoutConfig>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/ILayoutConfig.html||style="text-decoration: none;" shape="rect" class="javadoc"]]s to access layout options that are stored in the diagram files. Layout configurations may take different sources for assigning specific values to layout options, such as the notation model, user preferences, the de.cau.cs.kieler.kiml.layoutInfo extension point, or default values of layout providers or layout options. These configurations can then be used to transfer all relevant options to the layout graph using the [[KLayoutData>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KLayoutData||style="text-decoration: none;" shape="rect" class="wiki"]] structure and to display options in the Layout view. The singleton class [[LayoutDataService>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/LayoutDataService.html||style="text-decoration: none;" shape="rect" class="javadoc"]] is used to access the available layout algorithms, layout options, diagram types, layout types, and stored option values. 123 123 124 - The option //Debug graphoutput//isusedfordebugging, asthenamesuggests.Itwritesthe layout graph ofeachlayoutcomputationto a file inthecurrent user'shomedirectory.69 +[[~[~[image:url:http://rtsys.informatik.uni-kiel.de/~~~~kieler/files/documentation/kiml-structure.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/documentation/kiml-structure.png||style="text-decoration: none;" shape="rect"]] 125 125 126 - The//DefaultLayoutOptionValues//tableisusedtomanagethedefaultsettingfor layout options,whichcanalsobemodified withthecontextmenuofthelayoutview (seeabove).All user-definedsettingsaredisplayedhere,andthebuttonsontheright ofthetableservetocreate,edit,andremoveentries.The//Type//column showsthetypeof elementtheoptionis linkedwith:either//DiagramPart//, //Model Element//, or//Diagram Type//.The //Element//columnshowsthe classname for options that relatetodiagramparts(i.e.editparts)ordomainmodelelements,andthe diagramtype namefor optionsthatrelate todiagramtypes. //Option// isthenameofthelayoutoption,and//Value//isthe currently set valueof the option.71 +KIML makes extensive use of the [[IPropertyHolder>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/properties/IPropertyHolder.html||style="text-decoration: none;" shape="rect" class="javadoc"]] 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/~~kieler/doc/de/cau/cs/kieler/core/properties/IProperty.html||style="text-decoration: none;" shape="rect" class="javadoc"]], which is usually instanced exactly once for each property. The layout data classes [[KShapeLayout>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/klayoutdata/KShapeLayout.html||style="text-decoration: none;" shape="rect" class="javadoc"]] and [[KEdgeLayout>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/klayoutdata/KEdgeLayout.html||style="text-decoration: none;" shape="rect" class="javadoc"]] are property holders, which means that they can store layout option values for the graph elements they are connected with. Furthermore, [[ILayoutConfig>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/ILayoutConfig.html||style="text-decoration: none;" shape="rect" class="javadoc"]]s are property holders, which means that they can store layout options values to be transferred to the layout graph or to be displayed in the Layout view. [[AbstractLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/AbstractLayoutProvider.html||style="text-decoration: none;" shape="rect" class="javadoc"]]s are property holders for storage of default values that are specific to the layout provider. 127 127 128 -C reating anew entry requires the selectionof the typeof relatedelement and enteringits class nameoridentifier. Class namesof diagrampartsand domain model elementscan be explored using the information buttonof the layout view, whilediagram typeidentifiers can beselectedwith the//Browse// button. Afterthat, a layoutoptionhasto beselected fromthelist using thecorresponding //Browse//button. Hitting //OK// createsan entry,and itsvaluecanthenbesetusing the //Edit// button.73 +=== 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"]] === 129 129 130 - =ProgrammingInterface[[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"]] =75 +Layout algorithms must be connected by extending [[AbstractLayoutProvider>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/AbstractLayoutProvider.html||style="text-decoration: none;" shape="rect" class="javadoc"]] and using the de.cau.cs.kieler.kiml.layoutProviders extension point. The input of [[AbstractLayoutProvider?>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/AbstractLayoutProvider||rel="nofollow" style="text-decoration: none;" shape="rect" class="missing wiki"]] is an instance of the [[KGraph>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KGraph||style="text-decoration: none;" shape="rect" class="wiki"]], an [[(% class="icon" %) (%%)EMF>>url:http://www.eclipse.org/modeling/emf/||style="text-decoration: none;" shape="rect" class="ext-link"]] based graph structure, together with a progress monitor ([[IKielerProgressMonitor>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/alg/IKielerProgressMonitor.html||style="text-decoration: none;" shape="rect" class="javadoc"]]). The KGraph instance already has attached [[KLayoutData>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/KLayoutData||style="text-decoration: none;" shape="rect" class="wiki"]], which is initially set to the original layout of the diagram. The layout provider should read layout options from the attached layout data, execute a layout algorithm, and write the results back to the layout data. See the [[documentation of connected layouters>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML/Layouters||style="text-decoration: none;" shape="rect" class="wiki"]]. A good example for a layout provider implementation is [[LayeredLayoutProvider>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/browser/plugins/de.cau.cs.kieler.klay.layered/src/de/cau/cs/kieler/klay/layered/LayeredLayoutProvider.java||style="text-decoration: none;" shape="rect" class="source"]]. 131 131 132 -The primaryAPIofKIMLis 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 responsiblefor analyzingdiagrams, creatinga[[KGraph>>doc:KGraphMetaModel]]structure,configuringand executingthe layout algorithms,andwritingnewposition informationbacktothediagram. Itisinvokedwith77 +The layoutProviders 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. Furthermore, the extension point can be used to specify which layout options are understood and which diagram types are supported by the layout algorithm, and to define new layout options, layout types, and categories of layout algorithms. The priority value given with a supported diagram type is used to determine the most suitable layout algorithm for that diagram type; see the [[documentation of pre-defined diagram types>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML/DiagramTypes||style="text-decoration: none;" shape="rect" class="wiki"]]. 133 133 134 -{{code theme="Eclipse" language="java"}} 135 -DiagramLayoutEngine.INSTANCE.layout(workbenchPart, diagramPart) 136 -{{/code}} 79 +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/~~kieler/doc/de/cau/cs/kieler/core/properties/Property.html||style="text-decoration: none;" shape="rect" class="javadoc"]] constant for easy use in the implementation of layout providers. KIML comes with a large set of built-in layout options, which are all defined in [[LayoutOptions>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/options/LayoutOptions.html||style="text-decoration: none;" shape="rect" class="javadoc"]]. If a layout provider wants to override the default value of a layout option, it must set the corresponding properties for itself (which is a property holder) either in the constructor or in the initialization method, and it must use its own instance of the corresponding property. See for example the [[Properties>>url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/browser/plugins/de.cau.cs.kieler.klay.layered/src/de/cau/cs/kieler/klay/layered/Properties.java||style="text-decoration: none;" shape="rect" class="source"]] class for the KLay layered layouter, which defines its own copy of the OBJ_SPACING option using a specific default value. Layout providers can access the layout option values using the [[IPropertyHolder>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/properties/IPropertyHolder.html||style="text-decoration: none;" shape="rect" class="javadoc"]]interface: 137 137 138 -where {{code language="none"}}workbenchPart{{/code}} is the Eclipse editor part or view part whose content shall be processed, and {{code language="none"}}diagramPart{{/code}} is a further reference to which part of the diagram the layout shall be applied (may be {{code language="none"}}null{{/code}}). 81 +(% class="code" style="margin-left: 1.75em;" %) 82 +((( 83 +(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getData(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)class(% class="o" %));(% class="kt" style="color: rgb(68,85,136);" %)boolean(% class="o" %)=.(% class="na" style="color: rgb(0,128,128);" %)getProperty(% class="o" %)(.(% class="na" style="color: rgb(0,128,128);" %)INTERACTIVE(% class="o" %)); 139 139 140 -An overview of the internal structure of KIML is given in the following. 85 +{{{KShapeLayout nodeLayout parentNodeKShapeLayout 86 + isInteractive nodeLayoutLayoutOptions 87 +}}} 88 +))) 141 141 142 - [[~[~[image:attach:kiml-overview.png~]~]>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/files/documentation/kiml-structure.png||style="text-decoration:none;"shape="rect"]]90 +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 forNullPointerExceptions or ClassCastExceptions. 143 143 144 - Theinteractionwith the diagrameditoror viewer ishandled by //layout managers//, represented by[[IDiagramLayoutManager>>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/IDiagramLayoutManager.java||shape="rect"]] implementations,explainedwithmoredetailbelow.92 +=== 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"]] === 145 145 146 -The configuration of automaticlayoutis donebythe[[LayoutOptionManager>>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/LayoutOptionManager.java||shape="rect"]],whichiterates overallgraph elementsandappliesaset oflayoutconfigurators,representedbythe interface[[ILayoutConfig>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/config/ILayoutConfig.java||shape="rect"]].Layoutconfiguratorsanalyzethecontext ofeachgraph elementandsetspecific valuesfor somelayout options. Moreinformationon layoutconfigurationisavailableon[[doc:ConfiguringAutomaticLayout]].94 +The extension point de.cau.cs.kieler.kiml.layoutInfo is used to define diagram types and to assign default layout options to specific parts of a diagram. Layout options can be associated with elements of the domain model, where the qualified name of the model element interface must be given, or with edit parts of a specific diagram editor, where the qualified class name of the edit part must be given. The diagram type can be assigned by setting the predefined layout option de.cau.cs.kieler.layout.options.diagramType with the diagram type identifier as value. This helps KIML to find a suitable layout algorithm for a part of the diagram editor without the need of referencing a specific algorithm. 147 147 148 - Hierarchicallystructured graphs are handled by the[[RecursiveGraphLayoutEngine>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/RecursiveGraphLayoutEngine.java||shape="rect"]], whichexecutes layoutalgorithmsseparatelyoneachhierarchylevel,startingwith the innermost levels.The actuallayoutcomputations are performedbysubclasses of [[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"]],whichare registeredwiththe{{codelanguage="none"}}layoutProviders{{/code}} extension point.96 +KIML provides [[DiagramLayoutManager>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/ui/layout/DiagramLayoutManager.html||style="text-decoration: none;" shape="rect" class="javadoc"]] implementations for GMF and Graphiti. For diagram editors that are not compatible with those layout managers, a new implementation must be made. This includes specialized implementations of [[IGraphicalFrameworkBridge>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/core/ui/IGraphicalFrameworkBridge.html||style="text-decoration: none;" shape="rect" class="javadoc"]] and of[[ILayoutConfig>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/ILayoutConfig.html||style="text-decoration: none;" shape="rect" class="javadoc"]]. Diagram layout managers have to be registered using the de.cau.cs.kieler.kiml.ui.layoutManagers extension point. 149 149 150 - Thesingleton class[[LayoutMetaDataService>>url:http://rtsys.informatik.uni-kiel.de/fisheye/browse/kieler-pragmatics/plugins/de.cau.cs.kieler.kiml/src/de/cau/cs/kieler/kiml/LayoutMetaDataService.java||shape="rect"]] is usedtoaccessthe available layoutalgorithms,layoutoptions,diagramtypes, layouttypes,andstored optionvalues. Similarly, thereareotherserviceclasses foraccessing the meta data managed by KIML. Meta data are storedin XML format according to the extension points mechanism of Eclipse.98 +== Graph Analysis[[url:http://trac.rtsys.informatik.uni-kiel.de/trac/kieler/wiki/Projects/KIML#GraphAnalysis||style="text-decoration: none;" title="Link to this section" shape="rect" class="anchor"]] == 151 151 152 -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. 153 - 154 -== 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"]] == 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||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"]]. 157 - 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 - 160 -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: 161 - 162 -{{code theme="Eclipse" language="java"}} 163 -KShapeLayout nodeLayout = parentNode.getData(KShapeLayout.class); 164 -boolean isInteractive = nodeLayout.getProperty(LayoutOptions.INTERACTIVE); 165 -{{/code}} 166 - 167 - 168 - 169 -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. 170 - 171 -== 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"]] == 172 - 173 -(% 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}}. 174 - 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 - 177 -Each diagram layout manager must be able to map the graph structure of its supported diagram viewers to the [[KGraph>>doc: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. 178 - 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:Configuring Automatic Layout]]. 100 +KIML offers an interface for graph analysis, available with the [[image:attach:analyzediagram.gif]] button. Here a selection of analyses can be made, which refer to the structure or the drawing of the graph. After performing the analyses, the results are shown in a dialog and in the Analysis view. New analyses, which must implement [[IAnalysis>>url:http://rtsys.informatik.uni-kiel.de/~~kieler/doc/de/cau/cs/kieler/kiml/grana/IAnalysis.html||style="text-decoration: none;" shape="rect" class="javadoc"]], can be registered using the de.cau.cs.kieler.kiml.grana.analysisProviders extension point.
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 - 94715371 +885086 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/ 9471537/Infrastructure for Meta Layout (KIML)1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/885086/Infrastructure for Meta Layout (KIML)