Styling
Besides displaying activities and resources, your application will need to convey qualitative information on your business data.
JViews Gantt makes use of a powerful model-based styling mechanism that relies on style rules. Each
style rule defines conditions on the
data model that trigger graphical changes in the display. For example, you can define a rule that draws an activity bar shape with foreground color beige and label color black when the
state is
activity:leaf; and another rule that turns the foreground color to gray and the label color to red when the
state is
activity:leaf and the
tags property for user-defined type is
critical.
When you define a notation, you create the basic symbols to be used for default situations. Each basic symbol is defined by at least one style rule.
Once the basic symbols are created, you then need to modify or annotate them to reflect specific properties that you want to display. For each situation, you define a rule that may complement or override the graphics effects defined by more generic rules.
The styling mechanism is also used to declare and customize options to control the appearance of the chart as a whole or of its subcomponents, the table, the Gantt sheet, the time scale, the vertical grid, or the horizontal grid.
The set of style rules is stored in a
style sheet and you can dynamically load a new style sheet while keeping the same data and underlying data model. This facility is useful when you need to adapt the display to a particular situation or user profile.
The style sheet syntax conforms to the
CSS syntax — a Web standard — but you need not bother with the details of this syntax at this point.
JViews Gantt eases the process of defining a notation with a development tool called the Designer. Using the Designer, you define the conditions for a rule using naturalistic language and you define the styling effects of the rule through an intuitive panel, the Styling Customizer, that lets you change graphical properties. While you are modifying rules or adding new ones, you can select a rule in a tree view and see how the notation changes within a preview window.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.