Styling > Customizing Links > Customizing Link Technology

This section shows how to create a new link technology. This operation is similar to adding a new media to links and involves three steps.

How to Create a New Link Technology (using the API)
  1. Extend the IltLink.Technology enumeration.
  2. Map the new technology to an icon.
  3. Map the new technology to a color.
IltLink.Technology pSwitching = new IltLink.Technology("PacketSwitching");
IlpContext context = IltSystem.GetDefaultContext();
IlpImageRepository imageRep = context.getImageRepository();
Image pSwitchingImage = imageRep.getImage("pSwitching.png");
IltSettings.SetValue("Link.Technology.PacketSwitching.Icon", 
                   pSwitchingImage);
Iltettings.SetValue("Link.Technology.PacketSwitching.Color", new
                    Color(128,196,210));
How to Create a New Link Technology (using CSS)

You can also create new link technologies by using global CSS settings, see Using Global Settings for more information):

setting."ilog.tgo.model.IltLink" {
   technology[0]: @+linkTechnology0;
}
Subobject#linkTechnology0 {
   class: 'ilog.tgo.model.IltLink.Technology';
   name: "PacketSwitching";
}

You can obtain the same customization as with the API by 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 properties to customize here are icon and color.

setting."ilog.tgo.model.IltLink.Technology"[name="PacketSwitching"] {
    icon: '@|image("pSwitching.png")';
    color: '#80C4D2';
}

The following properties allow you to customize the representation of link technology:

Table 5.6 CSS Properties for Link Technology
Property Name 
Type 
Default Value 
Description 
technologyIconVisible 
boolean 
false 
Defines whether the link technology icon is visible or not. 
technologyColorVisible 
boolean 
false 
Defines whether the link technology color is mapped to the link base or not. 
technologyIconBorder 
int 
1 
Defines a border around the technology icon, in pixels. 
technologyIcon 
Image 
The image defined for each technology value in IltSettings 
Defines the image to be used to represent the technology in a given link. 
technologyColor 
Color 
The color defined for each technology value in IltSettings 
Defines the color to be used to represent the technology in a given link. 

How to Show Link Technology

By default, the link technology is hidden, but you can show or hide it using the properties technologyIconVisible and technologyColorVisible as follows:

object."ilog.tgo.model.IltLink" {
   technologyIconVisible: true;
   technologyColorVisible: true;
}

Note that the primary state color of a link will override the technology color. You can force the link technology color by using the property baseStyleEnabled as follows:

object."ilog.tgo.model.IltLink" {
   baseStyleEnabled: false;
}
How to Customize the Link Technology Tooltip

The resource that applies to link technology is:

ilog.tgo.Link_Technology_<TECHNOLOGY NAME>_ToolTip: link technology tooltip

For the predefined link technology, you can edit this value directly in the JViews TGO resource bundle file.

For newly created technology values, the tooltip information will also be retrieved from this resource bundle. As you declare new technologies, register the corresponding entry into the resource bundle file so that tooltips can be automatically displayed.

Supposing that you have created the link technology PacketSwitching, you should declare the entry in the resource bundle file as follows:

ilog.tgo.Link_Technology_PacketSwitching_ToolTip=Packet Switching