Styling > Customizing Network Elements > Customizing Network Element Families

This section describes how to create a new network element family. This operation, which is similar to adding a new function, involves the following steps:

  1. Extending the IltNetworkElement.Family enumeration.
  2. Mapping the new family with a label.

For example:

How to Create a Network Element Family (using the API)
IltNetworkElement.Family OC999 =
  new IltNetworkElement.Family("OC999");
IltSettings.SetValue("NetworkElement.Family.OC999.Label","999");
How to Create a Network Element Family (using CSS)

You can also create new network element families by using global CSS settings (see Using Global Settings in Chapter 2, Using Cascading Style Sheets for more information):

setting."ilog.tgo.model.IltNetworkElement"{
  families[0]: @+neFamily0;
}
Subobject#neFamily0 {
  class: 'ilog.tgo.model.IltNetworkElement.Family'; 
  name: "OC999";
}

The following properties are used to customize the display of network element families:

Table 3.12 CSS Properties for Network Element Families
Property Name 
Type 
Default Value 
Description 
familyVisible 
boolean 
true 
Determines whether the family label is displayed or not 
familyFont 
Font 
Helvetica 10 
Defines the font used to draw the family label 
familyForeground 
Color 
35% gray 
Defines the color of the family label text 
familyBackground 
Color 
transparent (null
Defines the color of the family label background, with a null value meaning a transparent background 
familyAntialiasing 
boolean 
false 
Determines whether the family label is displayed using antialiasing or not 

You can map network element families to labels by using the method IltSettings.SetValue. You can also associate a network element family with a resource that is retrieved from the JViews TGO resource bundle (see About Internationalization in the Context and Deployment Descriptor documentation).)

Example:

IltSettings.SetValue("NetworkElement.Family.OC999.Label","My_NetworkElement_Family_999");

You can obtain the same customization using global CSS settings. To do so, you need to specify the full path to the object to be customized, as well as the value of its name attribute in order to match the right object in the system. The CSS property to customize here is label.

setting."ilog.tgo.model.IltNetworkElement.Family"[name="OC192-UsrDf"] { 
   label: "My_NetworkElement_Family_999";
}

By default, network element families and resources are associated automatically. A label and a tooltip are displayed for the new network element family provided that the following resources have been declared in the JViews TGO resource bundle:

For the predefined network element families, you can edit the values directly in the JViews TGO resource bundle file.

For newly created network element families, the label and tooltip information will also be retrieved from this resource bundle. As you declare new network element families, register the corresponding entries into the resource bundle file.

Considering that you have created the network element family "OC999", you should declare the corresponding entries in the resource bundle file as follows: