Introducing JViews Maps > Architecture > Styling > JViews Diagrammer Style Sheets

Styling in JViews Diagrammer involves the following constructs:

JViews Diagrammer Style Rules

The StyleSheet renderer applies a style sheet to a data model. The style sheet contains style rules in CSS2 format that describe how the objects in the data model are displayed in the diagram.

A style rule consists of two parts:

When designing a notation, you create many style rules, each of them matching a particular case in the data model. You define rules that apply to objects represented as nodes, and rules that apply to objects represented as links.

The style rules are usually defined from the most generic to the most specific. The generic rules usually create the base symbol for each type of object. The more specific rules add new shapes, or change graphics properties for the symbol defined in the generic rule.

The style rules are also used to specify the options of a diagram. Such rules have no selector and the declarations customize the way the options operate.

The Designer for JViews Diagrammer is perfectly suited for creating style sheets that define the look-and-feel of diagrams. Within the Designer, styling takes place, but the CSS syntax is largely hidden: selectors are defined in a natural-language editor and declarations are defined by setting graphic properties through panels called Styling Customizers. The style sheet generated by the Designer can be loaded into your application at runtime.

Backgrounds and Maps

For applications that require a geographic map as a background, you can install a map renderer on your diagram that uses the ILOG JViews Maps facilities to read map formats--vector or raster--and to display nodes according to their latitude and longitude.