Model

Views Styling is based the relationships between three entities:

  • a Stylable is a visible entity that can use styling to modify its appearance. For instance, the class IlvGadget is a Stylable.

This is implemented by the interface class IlvStylable.

  • a Style Sheet defines values for graphical attributes used to draw Stylable entities. The descriptions of [attribute / value] pairs and the Stylables they apply to are expressed with a style language in an external file.

This is implemented by the interface class .

  • a Stylist serves as intermediary between Style Sheets and Stylables. A Stylist provides an API allowing Stylable objects to obtain the graphical attribute values they request. For instance, the class IlvGadgetContainer is a Stylist.

This is implemented by the interface class IlvStylist.

When using Styling, keep the following in mind:

  • A Stylable relates to only one Stylist

  • A Stylist can manage several Style Sheets and are arranged in a hierarchy under a Stylable. The Stylable objects can query their Stylist hierarchy for a potential style to use.

  • The same Style Sheet can be attached to several Stylists.

  • A Stylist may have a parent Stylist. This hierarchy allows you to propagate the effects of a Style Sheet to child entities (also known as style cascading).