Last modified by Alexander Schulz-Rosengarten on 2023/07/11 10:33

From version 9.1
edited by cds
on 2013/09/12 13:02
Change comment: There is no comment for this version
To version 13.1
edited by cds
on 2013/09/16 19:36
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -94,7 +94,7 @@
94 94  
95 95  * {{code language="none"}}DefaultLayoutConfig{{/code}} – Sets fixed default values defined for layout options.
96 96  * {{code language="none"}}EclipseLayoutConfig{{/code}} – Users can define default layout options to be set on elements that meet certain criteria via the KIML preference page. This layout configuration takes these options and applies them.
97 -* {{code language="none"}}SemanticLayoutConfig{{/code}} – **DOCUMENT THIS**
97 +* {{code language="none"}}SemanticLayoutConfig{{/code}} – A configuration that bases its layout option values on the semantic objects represented by the KGraph elements.
98 98  * {{code language="none"}}GmfLayoutConfig{{/code}} / {{code language="none"}}GraphitiLayoutConfig{{/code}} – These configurations apply layout options set by the user in the layout view or stored in the notation model file of a diagram.
99 99  * {{code language="none"}}VolatileLayoutConfig{{/code}} – A configuration whose only purpose it is to make sure certain layout options are set on certain diagram elements in a particular layout run.
100 100  
... ... @@ -102,7 +102,7 @@
102 102  
103 103  == A Few Details on Layout Configurations ==
104 104  
105 -What we just learned is a bit of a simplification of what happens. The layout options manager not only asks each layout configuration to provide layout options for each graph element. Before we look at the details, let's take a look at the methods each layout configuration provides:
105 +What we just learned is a bit of a simplification of what happens. Before we look at the details, let's take a look at the methods each layout configuration provides:
106 106  
107 107  {{code language="java"}}
108 108  public interface ILayoutConfig {
... ... @@ -113,21 +113,31 @@
113 113  } 
114 114  {{/code}}
115 115  
116 -It is not hard to guess what {{code language="none"}}getPriority(){{/code}} does: it returns the priority a given layout configuration has. If two layout configurations set a layout option to different values on a given graph element, the value set by the configuration with lower priority gets overwritten. The other three methods look a bit more obscure, so we have to provide more details on what the options manager does, exactly.
116 +It is not hard to guess what {{code language="none"}}getPriority(){{/code}} does: it returns the priority a given layout configuration has. If two layout configurations set a layout option to different values on a given graph element, the value set by the configuration with higher priority wins. The other three methods look a bit more obscure, so we have to provide more details on what the options manager does, exactly.
117 117  
118 118  ENRICHING (+ WHAT IS A LAYOUT CONTEXT)
119 119  
120 -TRANSFERRING
120 +The {{code language="none"}}transferValues(...){{/code}} method is the main workhorse of the interface. This is where a KGraph element, identified by the given layout context, is equipped with the layout option values a layout configuration deems necessary. It thus becomes the most important part of a layout configuration that you absolutely have to implement, no excuses. If for example every {{code language="none"}}KNode{{/code}} should have its port constraints set to {{code language="none"}}FIXED_POS{{/code}}, this is the place to do it.
121 121  
122 -GETVALUE (for the layout view?)
122 +With all these layout configurations active, it's by no means clear which layout option values KGraph elements will end up with during the layout process. Enter the {{code language="none"}}getValue(...){{/code}} method. For a given element and layout option, it returns the value it would set on the element if {{code language="none"}}transferValues(...){{/code}} was called. This method is mainly used by the Layout view to inform the user about the layout option values of whatever graph element he (or she) has clicked on. It is also the method you can safely neglect to implement if your final product won't include the layout view anyway.
123 123  
124 124  == (% style="line-height: 1.4285715;" %)Implementing a Layout Configuration(%%) ==
125 125  
126 -(% style="line-height: 1.4285715;" %)deciding what options are applicable depending on the context object; setting the options;
126 +{{warning title="ToDo"}}
127 +deciding what options are applicable depending on the context object; setting the options;
128 +{{/warning}}
127 127  
130 +(% style="line-height: 1.4285715;" %)
128 128  
132 +
129 129  = (% style="line-height: 1.4285715;" %)Programmatically Setting Layout Options(%%) =
130 130  
135 +(% style="line-height: 1.4285715;" %)So with all these layout configurations available, how do you actually go about setting layout options programmatically? Well, as always: it depends.
136 +
137 +
138 +(% style="line-height: 1.4285715;" %)
139 +
140 +
131 131  {{warning title="ToDo"}}
132 132  Write this section. This will be about when to use the different kinds of layout configurations, mainly {{code language="none"}}SemanticLayoutConfig{{/code}} and {{code language="none"}}VolatileLayoutConfig{{/code}}.
133 133  {{/warning}}
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -7701010
1 +8650779
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/7701010/Configuring Automatic Layout
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/8650779/Configuring Automatic Layout