Developing with the SDK > Using and Adding Renderers > Predefined Renderers > The Decoration Renderer

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:

  1. Give a name to each decoration.
  2. Attach the decorationNames property of the Decoration renderer to all the names collected at step 1.
  3. 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.

Code Sample 4.9 shows style rules that add a title and an image to the diagram.

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);
}

Code Sample 4.9 Adding a Title and Image to the Diagram with the Decoration Renderer

Table 4.2 lists the properties of the Decoration renderer.

Table 4.2 Global Properties of the Decoration Renderer
Property 
Type 
Default 
Description 
background 
Color 
white 
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 

 
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 ilog.views.sdm.renderer.IlvDecorationRenderer for more details.