20.08.2013 Views

A MagicUWE Extension for Semi-Automatic Layout ... - UWE - LMU

A MagicUWE Extension for Semi-Automatic Layout ... - UWE - LMU

A MagicUWE Extension for Semi-Automatic Layout ... - UWE - LMU

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6. Auxiliary Functions<br />

Like mentioned be<strong>for</strong>e, one of the main problems was the insufficient documen-<br />

tation of some parts of the OpenAPI and furthermore its restrictions in the GUI<br />

domain. Without any knowledge of the different kind of Views or even of their<br />

existance, the first steps of development produced no results at all.<br />

To give an example, the OpenAPI method getPresentationElements() is<br />

described in the javadoc as follows: ”Returns all children of this element”<br />

From one perspective, this is true, because this element returns the different and<br />

never mentioned parts of the current element, like the HeaderView (chapter 2,<br />

section 2.3). But the more intuitive way to understand this method, especially if<br />

these Views were never mentioned, is to get all children of our current element that<br />

have model elements.<br />

After some failed attempts, it was obvious that more in<strong>for</strong>mation was necessary<br />

to understand the inner mechanics of MagicDraw. To get this knowledge, Magic-<br />

Draw’s data structure had to be made visible. There<strong>for</strong>e a new class was created,<br />

in order to print this structure into a XML file.<br />

To get as much in<strong>for</strong>mation as possible, this class was extended to create two<br />

files simultaniously if necessary. In the end, AuxiliaryFunctions was able to print<br />

all PresentationElements of the active diagram, all selected elements or any given<br />

String in up to two files, given maximal flexibility to understand not only the data<br />

structure, but also the meaning of the different Views. Finally, it provided the<br />

ability to crosscheck any rearranging attempts in the hierarchy.<br />

Since this functionality was not a part of the requirements and especially useless<br />

to the user, there is no way to turn it on during runtime. To switch it on, the<br />

variable ”inTestMode” in the AutoAlignAction’s standard constructor has to be be<br />

set to ”true”. After this is done, the class will print all elements of the current<br />

diagram in a XML file called DiagramStructure. This file can be found in the<br />

folder ’TidyDiagram temp’, located in your operating system’s user folder. Every<br />

alteration of its functionality has to be hard coded, the javadoc will provide further<br />

in<strong>for</strong>mation if necessary.<br />

24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!