« Back to University of Vienna - OMILAB

New graphical representation based on attached referenced model

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
I would like to change the graphical representation of a class in case another model is referenced in this class. Thus, if another model is connected to an element, a new icon should apper next to this element (e.g. connect a process task to a risk model, see the below picture). Additionally, it would be helpful if the icons stay at the same position (e.g. next to the upper right corner) in case an element is resized. Many thanks in advance.
Attachment

Attachments: Task-Model.png (18.9k)

RE: New graphical representation based on attached referenced model
aval table
Answer
11/27/13 9:57 AM as a reply to Natalia Sudakova.
The AVAL command is used for reading the value of an attribute and based on that value, the graphical representation will be changed.

The TABLE element is an assigning element used for re-sizeable objects. A table consists of columns and lines which each have either a fixed or a variable width or height. In our example, the GRAPHREP of the class "Task" already has a table defined in it and we have used the values tabx4, taby0 and taby3 for displaying some simple graphics and text.

 1AVAL set-default:"" str_refDocs:"Referenced Documents"
 2AVAL set-default:"" str_refDocModel:"Referenced Doc Model"
 3
 4IF (str_refDocs != "") {
 5  PEN color:red w:2pt
 6  ELLIPSE x: (tabx4 + 0.5cm) y: (taby0 + 0.3cm) rx:0.4cm ry:0.3cm
 7  TEXT "doc" x: (tabx4 + 0.5cm) y: (taby0 + 0.3cm) w:c h:c
 8}
 9
10IF (str_refDocModel != "") {
11  PEN color:green w:1pt
12  RECTANGLE x: (tabx4 + 0.1cm) y: (taby3 - 0.5cm) w:0.8cm h:0.5cm
13  TEXT "docs" x: (tabx4 + 0.15cm) y: (taby3 - 0.5cm) w:l
14}

The syntax of the TABLE element is described below:

TABLE [ x:xpos ] [ y:ypos ] [ w:width ] [ h:height ] cols:n rows:m
[ w1:width ] ... [ wn:width ] [ h1:height ] ... [ hm:height ]


From a TABLE element with n columns and m lines the following runtime variables are calculated/derived:
  • tabw1 to tabwn- column widths
  • tabh1 to tabhm- line heights
  • tabx0 to tabxn- x-positions of the columns
  • taby0 to tabym- y-positions of the columns
For more information on the TABLE element, please consult the ADOxx help, by pressing the F1 key in the Development Toolkit.