Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 09c65bb489b531d4bda1239f65148a2dbae38497 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
\chapter{Automatic Diagram Layout with KIELER}

\section{Overview}

eTrice now provides a new feature of automatic layout of the ROOM diagrams in its graphical editors. This helps in improving the pragmatics of the diagrams and frees the user from the burden of manually lay-outing the diagrams on the canvas. 

The automatic lay-outing has been provided with the help of the well known KIELER framework, which focuses on the pragmatics of model-based system design, which can improve comprehensibility of diagrams, improve development and maintenance time, and improve the analysis of dynamic behavior.

This chapter will answer the following questions
\begin{itemize}
\item \hyperref[performLayout]{''How to perform automatic layout in the graphical editors of eTrice?''}
\item \hyperref[layoutOptions]{''What are layout options?''}
\item \hyperref[configureOptions]{''How to configure the layout options to alter the diagram layout as desired?''}
\end{itemize}

Moreover, some \hyperref[specialOptions]{''special layout options''} will also be discussed.

\section{\label{performLayout}Performing Automatic Layout} 
% h2(#performLayout). Performing Automatic Layout

Automatic layout could be performed in eTrice graphical editors using the command to layout the current diagram.

This command is available in
\begin{itemize}
\item The context menu of the diagrams
\item Using the \textit{Ctrl+R L} shortcut.
\end{itemize}

Additionally, an entry in the context menu allows to layout only a selected part of the diagram.

\section{\label{layoutOptions}Layout Options}
% h2(#layoutOptions). Layout Options

A layout option is a customization point for the layout algorithms, with a specific data type and optionally a default value, used to affect how the active layout algorithm computes concrete coordinates for the graph elements.

User-configurable layout options for a particular diagram object can be viewed and configured through the Layout View.The Layout View can be opened from the context menu of a selected diagram object by clicking the \textit{Show Layout View} entry. 

On opening the layout view, and selecting any layout option, a description of the layout option is available in the footer of eclipse SDK. This is shown below:

\includegraphics[width=0.8\textwidth]{images/043-LayoutOptionDescription.png}
% !images/043-LayoutOptionDescription.png!

\section{\label{configureOptions}Configuring Layout Options}
% h2(#configureOptions). Configuring Layout Options 

The values of the layout options for a particular diagram object (in the visible diagram) can be changed using the Layout View of that diagram object. The initial values are the predefined *default* values. These defaults can be changed using the context menu in Layout View as well as the Layout preference pages provided by eTrice.

\subsection{\label{layoutView}The Layout View}
% h3(#layoutView). The Layout View

\includegraphics[width=0.8\textwidth]{images/043-LayoutView.png}
% !images/043-LayoutView.png!

The Layout view allows flexible customization of layout options for the selected objects in the eTrice diagram. If no object is selected, the view shows the options for the top-level container of the diagram. Options are stored persistently in diagram file (*.structure file / *.behavior file) of the eTrice 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.

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 each algorithm supports only a subset of the available options. Furthermore, some options are only visible if the \textit{Show Advanced Properties} button in the view toolbar is activated. The group types can be hidden using the Show Categories button.

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.

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 current model file, thus resetting the option to its default value. The view menu has an entry Remove all Layout Options which resets all options of the current model by removing persistent data in the model file.

\includegraphics[width=0.8\textwidth]{images/043-ContextMenu.png}
% !images/043-ContextMenu.png!

The context menu for a specific layout option has different alternatives to set the currently active value as \textbf{default} value:
\begin{itemize}
\item \textit{Set as Default for this Diagram}: Changes the open diagram file so that the same value is applied to all similar objects (edit parts) of that diagram.

\item \textit{Set as Default for ... in this Context}: Applies the value to all similar objects that are displayed with the any of the eTrice editors (the option is linked to the edit part class of the selected object).

\item \textit{Set as Default for all ...}: Links the option value with the domain model element or the diagram type of the selected object (see the context menu depicted above).
\end{itemize}

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.

Tips:
\begin{itemize}
\item 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.
\item Default values for layout options can most easily be manipulated based on the eTrice domain model elements.
\end{itemize}

\subsection{\label{preferencePage}Preference Page}
% h3(#preferencePage). Preference Pages

The user-defined *default* values for layout options can also be set using the preference pages provided in eTrice. Three preference pages have been provided for this purpose
\begin{itemize}
\item \textit{Layout}: for general preferences regarding layout
\item \textit{Behavior}: for setting default values of layout options for eTrice behavior diagrams
\item \textit{Structure}: for setting default values of layout options for eTrice structure diagrams
\end{itemize}

These preference pages can be accessed via \textit{Windows > Preferences > eTrice > Layout}.

Note that the contents of these preference pages are in sync with the \textit{KIELER > Layout} preference page provided by the KIELER. Relevant entries in the \textit{KIELER > Layout} page are shown in the above preference pages.

\subsubsection{\textit{Layout} Preference Page}
% h4. _Layout_ Preference Page

The \textit{Layout} preference page is meant to configure general options regarding the layout. 

If \textit{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.

\subsubsection{\textit{Behavior} and \textit{Structure} Preference Page}
% h4. _Behavior_ and _Structure_ Preference Pages

The \textit{Behavior} and \textit{Structure} sub-preference pages help in setting up the default values of layout options in behavior and structure diagrams respectively.

The \textit{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.

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 can be explored using the information button of the layout view, while the class names for the domain model elements and the diagram type identifiers for the diagram types 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.

\includegraphics[width=0.8\textwidth]{images/043-PreferencePage.png}
% !images/043-PreferencePage.png!

Note that the \textit{Behavior} preference page will show only those entries which hold for the behavior diagrams. Moreover, it will allow setting default values of layout options for only those domain model elements and diagram types which could be present in the behavior editor diagrams. Similar thing holds for the \textit{Structure} preference page.

\section{\label{specialOptions}Special Layout Options}
% h2(#specialOptions). Special Layout Options

While most layout options are used to affect how the active layout algorithm computes concrete coordinates for the graph elements, there are some layout options that have a special role.

\subsection{Layout Algorithm}
% h3. Layout Algorithm

The option with identifier de.cau.cs.kieler.algorithm specifies which layout algorithm to use for the content of a composite node. The value can be either the identifier of a layout algorithm or the identifier of a layout type. In the latter case the algorithm with highest priority of that type is applied.

For the purpose of automatic diagram layout in eTrice, we use the \textit{Layered} algorithms which are meant for lay-outing hierarchical diagrams and are best suited for behavior and structure diagrams in eTrice. For the behavior diagrams we have used the \textit{Graphviz Dot} algorithm whereas for the structure diagrams we have used the \textit{KLay Layered} algorithm. Though the layout algorithm being used for performing layout can be changed at ones own will, it is recommended to use the defaults.  

\subsection{Diagram Type}
% h3. Diagram Type

Diagram types are used to classify graphical diagrams for setting default layout option values for a set of similar diagrams. The diagram type of an element is specified with the layout option de.cau.cs.kieler.diagramType. Thus, these help in 

The following diagram types have been defined and used in eTrice:
\begin{itemize}
\item \textit{General} - This type is automatically assigned to all diagrams for which no specific type is declared. (Predefined in KIELER)
\item \textit{eTrice Behavior Diagrams} - This type has been assigned to the diagram objects in eTrice Behavior Diagrams. 
\item \textit{eTrice Structure Diagrams} - This type has been assigned to the diagram objects in eTrice Structurer Diagrams.
\end{itemize}
Note that not all diagrams objects in the behavior and structure diagrams are assigned the last two diagram types. Only the top-level container and the visible bounding box has been assigned these diagram types in respective editors.

\section{Further References}
% h2. Further References

Most parts of the above documentation have been taken from the "KIML wiki":http://rtsys.informatik.uni-kiel.de/confluence/pages/viewpage.action?pageId=328078 and have been modified for automatic layout in eTrice. A more detailed description about the layout algorithms, predefined diagram types and the internal structure of KIELER Infrastructure for Meta-Layout(KIML) can be found at the "KIML wiki":http://rtsys.informatik.uni-kiel.de/confluence/pages/viewpage.action?pageId=328078 .

Back to the top