GRAPHREP ​
The GRAPHREP
command initiates the definition of graphical representation of objects and relations.
Syntax ​
Syntax for "normal" modelling classes:
GRAPHREP [ layer:intValue ] [ sizing:SizingType ]
[ width-sizing:SizingType ] [ height-sizing:SizingType ]
[ smart-symbol-size ] [ icon-scale:realValue ]
{ GraphElement } .
SizingType : keep-aspect-ratio | symmetrical | asymmetrical .
GraphElement : # Any of the other commands allowed in a GraphRep.
Syntax for relation classes:
GRAPHREP [ layer:intValue ] [ rounded:measureValue ]
[ bridge-radius:measureValue ] [ bridge-seg-count:intValue ] [ no-edge ]
[ start-trans:measureValue ] [ end-trans:measureValue ]
[ icon-scale:realValue ]
{ GraphElement } .
GraphElement : # Any of the other commands allowed in a GraphRep.
Syntax for swimlanes (modelling classes):
GRAPHREP swimlane:SwimlaneType [ icon-scale:realValue ]
{ GraphElement } .
SwimlaneType : horizontal | vertical .
GraphElement : # Any of the other commands allowed in a GraphRep.
Parameters ​
Parameters for "normal" modelling classes:
layer
(measureValue, optional) - The major layer on which the objects are drawn. The default value is1
.sizing
(optional) - The behavior of both horizontal and vertical sizing. The value must bekeep-aspect-ratio
,symmetrical
orasymmetrical
. The default does not allow sizing.width-sizing
(optional) - The behavior of horizontal sizing. The value must bekeep-aspect-ratio
,symmetrical
orasymmetrical
. The default does not allow sizing.height-sizing
(optional) - The behavior of vertical sizing. The value must bekeep-aspect-ratio
,symmetrical
orasymmetrical
. The default does not allow sizing.smart-symbol-size
(modifier, optional) - Changes how the size of an object is determined, trying to adjust for notations with fixed and flexible parts.icon-scale
(realValue, optional) - The scale to use for icons based on this GraphRep. The default is1.0
for relation classes and0.33
for all other cases.
Parameters for relation classes:
layer
(measureValue, optional) - The major layer on which the objects are drawn. The default value is1
.rounded
(measureValue, optional) - Defines a "rounding" of the edges' corners at bend-points for relations. The default is0cm
.bridge-radius
(measureValue, optional) - The radius for drawing bridges when two connectors intersect. The default is1.5mm
.bridge-seg-count
(intValue, optional) - The amount of segments to use for drawing bridges. The default is5
.no-edge
(modifier) - Do not implicitly insert theEDGE
command for relations.start-trans
(measureValue, optional) - The gap between a connector and its source object. The default is0cm
, which leads to a gap of0.15cm
.end-trans
(measureValue, optional) - The gap between a connector and its source object. The default is0cm
, which leads to a gap of0.15cm
.icon-scale
(realValue, optional) - The scale to use for icons based on this GraphRep. The default is1.0
for relation classes and0.33
for all other cases.
Parameters for swimlanes (modelling classes):
swimlane
- Defines whether it is a horizontal or a vertical swimlane. The value must behorizontal
orvertical
.icon-scale
(realValue, optional) - The scale to use for icons based on this GraphRep. The default is1.0
for relation classes and0.33
for all other cases.
Details ​
Layer ​
layer
configures the order in which the objects will be drawn. The greater the value, the higher level at which the objects or relations of the particular class are situated. This takes precedence over the index
from an object's position, allowing to always force drawing objects behind other objects. Negative values are allowed for layer
.
Resizing ​
By default all the objects have fixed, unchangeable size. The sizing
, width-sizing
and height-sizing
parameters define whether and to what extent the size of an object can be changed. In case of sizing
a size changing type can be set that ensures that the relation between the sides stays constant (keep-aspect-ratio
). Changing the object's width then causes the height to be adjusted simultaneously - and vice versa. A symmetrical
change of size on the other hand means that if one side of an object is changed, the opposite side will automatically be influenced accordingly. If the right side of an object is pulled to the right the left side of the object moves to the left at the same time. In the case of an asymmetrical
change of size, then, an object's sides can be changed independently of each other.
The use of smart-symbol-size
is encouraged when creating resizable notations that have fixed and flexible parts as it changes how the object's size (bounding box) is determined. It can especially help if a resizable TABLE
is used and STRETCH
is turned off for other elements which are are aligned according to the table coordinates. The smart-symbol-size
also helps when visualizing text or attribute values outside of the normal shapes of the notation.
Connector Bridges ​
Intersections of connectors can be shown with bridges. The bridge-radius
parameter specifies the radius for these bridges, with bigger values leading to more exaggerated bridges. Through bridge-seg-count
also the amount of segments for a bridge can be specified.
Invisible Edges ​
The parameter no-edge
is also used only for relation classes. When it is set, the automatic insertion of an EDGE
element is prevented. This allows a relation to be invisible. Careful, as this makes interacting with the connectors very difficult if not impossible.
Endpoint Distances ​
The parameters start-trans
and end-trans
can move the starting or end points of an edge. If you would like the endpoint of an edge to be further away from the objects it joins, then you will need to enter a negative value. By default (at a value of 0cm
) the endpoints of the edges are 0.15cm
away from an object. This is the value you have to enter to ensure that the relations join up exactly with the objects they connect.
Swimlanes ​
A special kind of object represents the swimlanes. They are in the lowest level and adjust automatically to the drawing area. The important thing about a swimlane is not the GraphRep description but the fact that it's derived from a swimlane class (descendant of __D_swimlane__
or __S_swimlane__
). Within the GRAPHREP
element the attribute swimlane
determines, whether it is a horizontal
or a vertical
swimlane. Horizontal swimlanes are always as wide as the drawing area and their height can be changed. Vertical swimlanes always adapt to the height of the drawing area and their width can be changed.
See Also ​
Examples ​
Draw a rectangle that can be resized containing the word "Hello" in the center of it.
GRAPHREP sizing:asymmetrical
# Note: SHADOW is on by default.
# Note: STRETCH is on by default. This is fine for simple notations.
PEN color:"lightblue" w:0.08cm
FILL color:"white"
RECTANGLE x:-1cm y:-0.6cm w:2cm h:1.2cm
TEXT "Hello" w:c h:c
Draw a connector with a thicker lightblue line and which starts with a wavy line and ends with an arrow-head after a short gap.
GRAPHREP start-trans:-0.3cm end-trans:-0.5cm
# Note: SHADOW is on by default.
# Draw the basic edge line.
PEN color:"lightblue" w:0.08cm
EDGE
# Draw the wavy line at the start.
START
POLYLINE 4
x1:0cm y1:0cm
x2:-0.1cm y2:0.18cm
x3:-0.2cm y3:-0.18cm
x4:-0.3cm y4:0cm
# Draw the arrow-head at the end.
END
POLYLINE 3
x1:-0.4cm y1:0.15cm
x2:0cm y2:0cm
x3:-0.4cm y3:-0.15cm
The graphical notation for a horizontal swimlane where the background should be lightblue and use thin black lines as horizontal separators.
GRAPHREP swimlane:horizontal
SHADOW off
# Draw the background of the swimlane using a rectangle without an outline.
FILL color:"lightblue"
PEN style:null
RECTANGLE w:4cm h:4cm
# Draw horizontal separator lines at the top and the bottom.
PEN color:"black"
LINE x1:0cm y1:0cm x2:4cm y2:0cm
LINE x1:0cm y1:4cm x2:4cm y2:4cm
Versions and Changes ​
Available since ADOxx 1.3