skip to main content
Maps > Programmer's documentation > Developing with the JViews Diagrammer SDK > Managing dynamic symbols > How to use a symbol in CSS
 
How to use a symbol in CSS
A symbol is used in a cascading style sheet (CSS) just like any other class. The symbol parameters are declared with the class in the CSS. The only difference is that the class declaration has another syntax:
 
class : @|symbolResource(<resource file>, <entry point>);
where:
*<resource file> is the path to a CSS file inside the palette, which must be reachable from the class path through java.lang.ClassLoader.getResource().
*<entry point> is the entry point in the CSS file, usually "Symbol".
Example:
 
node {
    class :
"@|symbolResource(ilog/views/palettes/shared/symbols/Rectangular.css,Symbol)";
    name : "no-name" ;
}
If the palette is not in the class path, it can be specified as an extra argument of the "class" declaration:
 
class : @|symbolResource(<resource file>, <entry point>, <package name>,
           <content file>, <palette URL>);
where:
*<package name> is the symbol package name in the palette.
*<content file> is the path of the palette content, usually palette.xml.
*<palette URL> is the URL of the palette.
Example:
 
node {
    class :
 "@|symbolResource(ilog/views/palettes/shared/symbols/
  Rectangular.css,Symbol,Symbols.Basic.Rectangular,ilog/views/palettes/shared/
  palette.xml,file:data/palettes/jviews-palette-shared-symbols.jar)";
    name : "no-name" ;
}
The symbol reference is resolved through getResource() first. The full version of the "class" declaration, which contains the palette URL, is needed only for editing purposes when the palette is not yet in the class path. For deployed applications, it is recommended to rely on the class path version, which means adding all the palettes in use in the class path.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.