The
Decoration
renderer lets you add graphic objects in addition to the objects
that represent the nodes and links, and change the background color
or texture. You can use the
Decoration
renderer to display additional information such as titles or
annotation labels. The objects you add are static: they cannot
change in response to model object states.
You can load decoration objects from a
.ivl
file or define them in the style sheet, as follows:
- Give a name to each decoration.
- Attach the
decorationNames
property of theDecoration
renderer to all the names collected at step 1. - Add a style rule for each decoration, where the selector is an ID with the decoration name, and the declarations are what are needed to create and customize the decoration.
The following code example shows style rules
that add a title and an image to the diagram.
Adding a title and image to the diagram
with the Decoration renderer
SDM { Decoration : true ; } Decoration { decorationNames : 'title,logo' ; } #title { class : "ilog.views.sdm.graphic.IlvGraphicFactories$ShadowLabel"; IlvRect : '5,5,100,20'; font : "dialog-18-bold"; foreground : black; background : white ; label : 'The main window.'; } #logo { class : "ilog.views.sdm.graphic.IlvGraphicFactories$Icon"; IlvRect : '5,35,20,20'; imageLocation : url(images/company.gif); }
The following table lists the properties of the
Decoration
renderer.
Property
|
Type
|
Default
|
Description
|
---|---|---|---|
background
|
Color
|
white
|
The view background color, as defined in IlvManagerView.
|
backgroundFile
|
URL
|
Sets a URL that points to a
.ivl
,
.svg
,
.svgz
, or
.dxf
file. The file contains graphic objects that are added to the
diagram.
|
|
backgroundPatternLocation
|
URL
|
The view background pattern, as defined in IlvManagerView.
|
|
decorationNames
|
String[]
|
null
|
The names of the style rules that define
the decoration objects.
|
The
Decoration
renderer does not define any per-object rendering properties.
See the class IlvDecorationRenderer for more details.