Class | Description |
---|---|
IlvSymbolDescriptor |
A descriptor of a graphic that is used as symbol.
|
IlvCompositeGraphic
).
In the palette, a symbol is essentially a CSS specification of a composite graphic. The palette contains also all resources (e.g., images, SVG files) that are referenced by this symbol CSS specification. The symbol specification hides the internals of the symbol from the outside world by a definition of a set of formal parameters of the symbol.
In the diagrammer, a symbol instance is the composite graphic that was
created from the symbol CSS specification.
Additionally, the composite graphic has a symbol descriptor
(class IlvSymbolDescriptor
) that describes the formal parameters
of the symbol at runtime.
The symbol is created by a CSS specification of the following form:
node { class: "@|symbolResource(symbolPath, symbolName)" param1 : value1; param2 : value2; ... }Here, param1, param2 ... are the formal parameters of the symbol.
To illustrate the concept of a symbol, consider a traffic light symbol. Assume the traffic light object contains of (at least) 3 pieces, one piece representing the red light, another one representing the orange light and another one representing the green light. The traffic light has a formal parameter "state" which can have the values "wait", "attention" and "go". In state "wait" the symbol must show a bright red color on the red piece, and dark colors on the orange and green piece, while in state "go", the symbol shows a bright green color on the green piece while the other pieces have darker color. The CSS of the symbol specifies the 3 pieces in detail and implements this logic, but the logic is hidden from the outside world. The traffic light symbol has only one formal parameter, the state parameter, which can have the values "wait", "attention" and "go". Therefore, using the symbol in an application CSS is as simple as this:
node { class: "@|symbolResource(mypackage/symbols/trafficLight.css, trafficLight)"; state : "go"; }The symbol itself makes sure that the right pieces have the right color in this case.
For experts: The Diagrammer Designer creates a lightly longer specification for symbols:
node { class: "@|symbolResource(mypackage/symbols/trafficLight.css, trafficLight, mypackage/palette.xml, roadsigns.jar)"; state : "go"; }This specification contains additional optional information about the location of the palette. The longer specification is generated by using
IlvPaletteSymbol.createClassDeclarationValue()
.
Symbols are organized as palettes in jar files. The definition of the symbol is inside the palette. From the definition of the symbol, you can create multiple instances of the symbol at runtime by specifying via CSS which symbol should be used to render an SDM model node. These instances are composite graphics. Here is an overview over the main classes:
IlvSymbolDescriptor
-
a descriptor attached to a composite
graphic instance at runtime. The descriptor allows to retrieve the symbol
definition and the current setting of the formal parameters.
IlvPalette
-
a palette is a collection of symbol definitions.
The palette can be organized into categories, and multiple palettes
can be loaded by a palette manager.
See ilog.views.symbology.palettes
for details.
IlvPaletteSymbol
-
the definition of the symbol inside the palette.
Distinguish this from the instances of the symbol at runtime.
The symbol definition exists only one, but it can create multiple
symbol instances. These instances are composite graphic objects
(IlvCompositeGraphic
)
and have a symbol descriptor attached.
ilog.views.symbology.palettes
.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.