Class property

The class property name is a reserved keyword that indicates the class name of the generated graphic object. JViews TGO provides a predefined representation for the objects in all graphic components, which means that the class property is optional. It can be used when you want to replace the predefined representation.

How to use the Class property

The right side of a class declaration could contain:
  • The class name, loaded with the application context class loader.
    For example:
    object {
        class: ilog.views.sdm.graphic.IlvGeneralNode;
        foreground: red;
    }
    
  • A path name to a file. In fact, the class name is forwarded to the JavaBeans™ library with the method java.beans.Beans.instantiate() , so a serialized JavaBean is suitable. For example:
    object {
        class: data.beans.gauge;
        foreground: red;
    }
    
    The JavaBeans documentation states: “When using the beanName as a serialized object name, we convert the given beanName to a resource path name and add a trailing ‘.ser’ suffix. We then try to load a serialized object from that resource.”
    In the example given, the method Beans.instantiate() would try to read a serialized object from the resource data/beans/gauge.ser .
In the network and equipment components, the class declaration is applied only when a creation request occurs. When the model state changes, graphic components are customized by applying only new declarations from the matching rules in the CSS. The class declaration is ignored. To change the class, the object in the model must be removed and then added again.