JViews Diagrammer style sheets

Styling in JViews Diagrammer involves the following constructs:
  • Style rules
  • Composite graphics
  • Backgrounds

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:
  • The condition part called the selector applies to the data model, and is used for pattern-matching.
  • The action part called the declarations applies to the corresponding graphic objects, and is used for rendering.
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 run time.

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 Rogue Wave JViews Maps facilities to read map formats—vector or raster—and to display nodes according to their latitude and longitude.