Developing with the SDK > Using and Adding Renderers > Using Renderers in the Style Sheet > Customizing a Renderer

To customize one of the renderers, you write a style rule with a selector that is the renderer name and declarations that set properties of the renderer. Each renderer is implemented by a JavaBean, and you can set any property of the Bean in the style rule.

For example, the LinkLayout renderer is implemented by the class ilog.views.sdm.renderer.graphlayout.IlvLinkLayoutRenderer. This class defines a property called performingLayoutOnZoom which requires the layout algorithm to be reapplied each time the view is zoomed in or out. Code Sample 4.2 shows a style rule that customizes the LinkLayout renderer to reapply the layout algorithm in this way.

LinkLayout {
   performingLayoutOnZoom : true;
}

Code Sample 4.2 Customizing a Renderer in the Style Sheet

Some renderers have a "default" property that you can set directly in the SDM rule instead of setting it in the renderer's customization rule. For example, the default parameter of the GraphLayout renderer is the name of the layout algorithm to apply. Code Sample 4.3 shows how to customize this renderer directly in the SDM rule.

SDM {
   GraphLayout : "Hierarchical";
}

Code Sample 4.3 Customizing a Renderer Directly

Direct customization in the SDM rule is a shortcut for the longer way, which is shown in Code Sample 4.4.

SDM {
   GraphLayout : true;
}
GraphLayout {
   graphLayout : "Hierarchical";
}

Code Sample 4.4 Customizing a Renderer the Longer Way