| Developing with the SDK > Using and Adding Renderers > Using Renderers in the Style Sheet > Using Rendering Properties on Objects |
Using Rendering Properties on Objects |
INDEX
PREVIOUS
NEXT
|
In addition to the general rules for renderers, you can write specific rules to customize the behavior of a renderer on a per-object basis through rendering properties. Rendering properties can be seen as additional properties of the graphic objects which you can set to tell a renderer how it should handle a particular object.
For example, the GraphLayout renderer defines a rendering property called Fixed. When this property is set to true, the GraphLayout renderer will keep the position of the object unchanged. Code Sample 4.5 shows a style rule that sets the Fixed property.
node.participant { shapeType : "Ellipse"; Fixed : "true"; } |
This rule says that the nodes of type participant must not be moved when a graph layout is applied. As you can see, you can mix "real" properties of graphic objects (such as shapeType) with rendering properties (such as Fixed).
| Important |
| By convention, most rendering properties start with an uppercase letter, whereas the properties of graphic objects start with a lowercase letter. |
The following predefined renderers do not have rendering properties:
If a rendering property conflicts with a graphic object property (which should generally not happen), you can use the pseudo-class construct to restrict a rule to a specified renderer. As an example, suppose you have written a custom graphic object which also has a property called Fixed. Code Sample 4.6 shows a style rule which specifies that the property is to be set only in the renderer (not in the custom graphic object).
node.participant:renderer { Fixed : "true"; } |
The pseudo-class renderer is interpreted as the renderer which has the property called Fixed.
The pseudo-class specification can also be the name of the renderer with an initial lowercase letter, for example, graphLayoutRenderer.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |