skip to main content
Programmers documentation > Styling > Using Cascading Style Sheets > Advanced customization of nodes
 
Advanced customization of nodes
To further customize the network and equipment node rendering, you may also:
*Use an IlvGraphic to generate an arbitrarily complex graphic representation ( IlvCompositeGraphic). For more information about composite graphics, see the section on graphic objects in Architecture of graphic components.
*Use a JComponent to generate a graphic representation and customize it using CSS.
How to use an IlvGraphic to generate a network node representation
IlvGraphic instances can be used to represent network and equipment nodes through the property 'class'. The given class must follow the JavaBeans™ pattern; its properties can be directly customized in CSS.
The following application is provided as part of the JViews TGO demonstration software at <installdir> /samples/network/compositeGraphic.
It illustrates how to use an IlvGraphic to generate a network node representation. This sample shows how to create a complex graphic representation using composite graphics that are fully customizable through CSS.
For information about how to use JavaBeans in CSS and how to use the class property, refer to Class property.
How to use a JComponent to generate a network or equipment node representation
In the following example, a JComponent is used to generate the network node representation of a user-defined class named Workstation. Business objects of this class are represented in the network component as a JButton with the given label and icon.
 
object."Workstation" {
  class: 'javax.swing.JButton;
  icon : @=icon;
  label: @name;
  foreground: black;
}
object."Workstation":selected {
  foreground: red;
}
Subobject#icon {
  class: 'javax.swing.ImageIcon';
  image: '@|image("workstation.png")';
}
The given class must follow the JavaBeans pattern; its properties can be customized directly in CSS (icon, label, foreground).
For information about how to use JavaBeans in CSS and how to use the class property, refer to Class property.

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