The ARROW_DECORATION
mode
value delegates the responsibility for showing an arrow to a decoration.
IlvGeneralLink can help display a particular kind of arrow, for
example, the kind used in UML drawings.
The arrowhead is a simple shape (such as a circle, triangle,
or diamond), located at the end of the link. The link does not overlap
the shape, nor go to the middle of the shape, nor change at all. Whatever
the direction of the last link segment touching the target node, the
shape is always toward the link. Since the decorations are
IlvGraphic objects, that is, basically rectangular objects,
this special mode gives better results with orthogonal links.
You can only use this mode if the following conditions
are met:
The arrowMode
property
is set to ARROW_DECORATION
.
One of the link decorations has its
position set to 1.
This decoration sets the option DECORATION_OVER
.
This decoration sets one of the options DECORATION_xxx_RETRACT_AT_END
,
where xxx
can be FULL
, HALF
,
or NO
.
The following figure shows an example of two links in ARROW_DECORATION
mode,
connected to a square node. The horizontal link is ended by a circle;
the line continues to the middle of the circle. The vertical link
is ended by a diamond; the line stops at the beginning of the diamond.
The following code example shows the styling rules used
to generate the node, links and arrowheads.
Decorations as arrowheads on links to a node
/////////////
// A very simple node
node {
class : ilog.views.sdm.graphic.IlvGeneralNode
fillColor1 : pink;
foreground : gray;
}
////////////
// Link definition
link {
class : ilog.views.sdm.graphic.IlvGeneralLink;
oriented : true;
decorations[1] : @=arrow; // see Subobject#arrow
decorationPositions[1] : 1;
decorationOptions[1] : 'DECORATION_OVER|DECORATION_HALF_RETRACT_AT_END';
arrowMode : ARROW_DECORATION;
label : @id;
lineWidth : 1.5;
endCap : CAP_BUTT;
foreground : black;
}
Subobject#arrow {
class : ilog.views.sdm.graphic.IlvGraphicFactories$Ellipse;
IlvRect : 0,0,10,10; // a circle
}
///////////////
// The vertical link inherits from "link { ... }" rule, and
// overwrites some options
#link2 {
decorations[1] : @=arrow2; // see Subobject#arrow2
decorationOptions[1] : 'DECORATION_OVER|DECORATION_FULL_RETRACT_AT_END';
}
Subobject#arrow2 {
class : ilog.views.sdm.graphic.IlvGraphicFactories$Marker;
IlvRect : 5,5,5,5;
type : 2; // a diamond
}