skip to main content
Programmers documentation > Styling > Customizing links > Customizing link technology
 
Customizing link technology
How to create a new link technology (using the API)
To create a new link technology, you must extend the IltLink.Technology enumeration.
You map the new technology to an icon and 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);
IltSettings.SetValue("Link.Technology.PacketSwitching.Color", new
                    Color(128,196,210));
How to create a new link technology (using CSS)
You can create new link technologies by using global CSS settings.
 
setting."ilog.tgo.model.IltLink" {
   technology[0]: @+linkTechnology0;
}
Subobject#linkTechnology0 {
   class: 'ilog.tgo.model.IltLink.Technology';
   name: "PacketSwitching";
}
For more information, see Using global settings.
Customizing link technologies
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:
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

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