Styling > Customizing Off-Page Connectors > Customizing Off-Page Connector Types

In ILOG JViews TGO, the off-page connector type determines how the object base is represented. Each off-page connector type is associated with a specific base renderer that is in charge of drawing the object according to its type and alarm information.

In JViews TGO, you can extend the base representation of off-page connectors by using one of the predefined base renderer factory classes (IltOPCImageBaseRendererFactory or IltOPCSVGBaseRendererFactory), or by implementing your own subclass of IltOPCBaseRenderer for each new type of off-page connector that you want to create.

Customizing Existing Off-Page Connector Types

JViews TGO provides the following IltOffPageConnector types that you can use directly in your applications:

Table 11.1 Off_Page Connector Types and Their Graphic Representation
Type 
Representation 
Description 
Standard 
images/opcStandard.gif  
Standard off-page connector  
Managed 
images/opcManaged.gif  
The off-page connector represents a generic managed entity.  
SingleManaged 
images/opcSingleManaged.gif  
The off-page connector represents a single entity currently managed by the system.  
MultipleManaged 
images/opcMultipleManaged.gif  
The off-page connector represents multiple entities currently managed by the system.  
Unmanaged 
images/opcUnmanaged.gif  
The off-page connector represents a generic entity not managed by the system.  
SingleUnmanaged 
images/opcSingleUnmanaged.gif  
The off-page connector represents a single entity currently not managed by the system.  
MultipleUnmanaged 
images/opcMultipleUnmanaged.gif  
The off-page connector represents multiple entities currently not managed by the system.  

The following properties apply to all these predefined off-page connector types:

Table 11.2 CSS Properties for the Predefined Off-Page Connector Types
Property Name 
Type 
Default Value 
Description 
shapeWidth 
float 
19 
Denotes the width of an off-page connector. 
shapeHeight 
float 
19 
Denotes the height of an off-page connector. 
depressed 
boolean 
false 
Denotes whether the graphic representation of the off-page connector is displayed depressed or not. 
tiny 
boolean 
false in the network and equipment components 
true in the table and tree components 
Sets the off-page connector base to the tiny representation. The tiny representation is used mainly in the tree and table components. 
logical 
boolean 
false 
Sets the off-page connector base to the logical representation. In the logical representation, all off-page connector types have the same look, that is a rectangular shape. 

The following properties are mapped, that is, their value is computed automatically from the alarms set in the object (column Set). You can override the mapped values or customize their graphic representation even when the object does not carry states and alarms.

Table 11.3 Mapped CSS Properties for Off-Page Connectors
Property Name 
Type 
Set 
Default Value 
Description 
foreground 
Color 
Yes 
Denotes the foreground color of the object base. 
background 
Color 
Yes 
Transparent (null
Denotes the background color of the object base. 
fillStyle 
ilog.util.IlFillStyle 
Network node 
IlFillStyle.SOLID_COLOR for user-defined business objects 
IlFillStyle.PATTERN for predefined business objects 
Denotes the style used to fill the base of an object. 
Possible values are: 
IlFillStyle.NO_FILL 
IlFillStyle.SOLID_COLOR 
IlFillStyle.LINEAR_GRADIENT 
IlFillStyle.RADIAL_GRADIENT 
IlFillStyle.TEXTURE 
IlFillStyle.PATTERN 
fillTexture 
Image 
Network node 
null 
Denotes the texture used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.TEXTURE
fillPattern 
Pattern 
Yes 
null (Solid) 
Denotes the pattern used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.PATTERN
fillStart 
float 
Network node 
0f 
Returns the position where the gradient of an object starts, that is, where the color is the one defined by property foreground. This property is only used if fillStyle is set to IlFillStyle.RADIA_GRADIENT or IlFillStyle.LINEAR_GRADIENT
fillEnd 
float 
Network node 
1f 
Returns the position where the gradient of an object ends, that is, where the color is the one defined by property background. This property is only used if fillStyle is set to IlFillStyle.RADIA_GRADIENT or IlFillStyle.LINEAR_GRADIENT 
fillAngle 
float 
Network node 
0 
Returns the angle (in degrees) of the gradient used to fill the base of an object. This property is only used if fillStyle is set to IlFillStyle.RADIAL_GRADIENT or IlFillStyle.LINEAR_GRADIENT 
borderColor 
Color 
Yes 
10% gray 
Denotes the primary color of the base border. 
borderColor2 
Color 
Yes 
60% gray 
Denotes the secondary color of the base border. 
reliefThickness 
float 
No 
1 
Denotes the width of the relief on the base border. 

The following property is specific to the type IltOffPageConnector.Standard. This type determines the graphic representation of an off-page connector in the form of two nested relief diamonds.

Table 11.4 CSS Property Specific to the IltOffPageConnector.Standard Type
Property Name 
Type 
Default Value 
Description 
reliefDistance 
int 
4 
Denotes the distance between two nested reliefs diamonds. 

How to Customize Standard Off-Page Connectors

The following CSS extract shows how you can customize the graphic representation of standard off-page connectors. In this example, the size of the off-page connector is set to 21x21:

object."ilog.tgo.model.IltOffPageConnector"[type=Standard] {
   shapeWidth: 21;
   shapeHeight: 21;
}

Customizing New Off-Page Connector Types

The principle to create new types of off-page connectors is the same as to create new types of network elements. For details, please refer to Customizing Network Element Types.

How to Create a New Off-Page Connector Type from an Image (using the API)

The following code extract shows how to create a new IltOffPageConnector type and associate it with an image so that it be be displayed in the JViews TGO graphic components.

// Create the new OPC type
IltOffPageConnector.Type opcType = new IltOffPageConnector.Type("MyType");
 
// Retrieve the image and create the base renderer factory
Image img = IltSystem.GetDefaultContext().getImageRepository().getImage("type.png");
IltOPCImageBaseRendererFactory factory = new IltOPCImageBaseRendererFactory(img);
 
// Associate the new OPC type to the image base renderer factory
IltSettings.SetValue("OffPageConnector.Type.MyType.Renderer", factory);
How to Create a New Off-Page Connector Type from an Image (using CSS)

You can also create new off-page connector types by using global CSS settings (see Using Global Settings in Chapter 2, Using Cascading Style Sheets for more information):

setting."ilog.tgo.model.IltOffPageConnector"{
   types[0]: @+opcType0;
}
Subobject#opcType0 {
  class: 'ilog.tgo.model.IltOffPageConnector$Type'; 
  name: "MyType";
}

Likewise, you can customize the renderer 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 type of object in the system. The CSS property to customize here is renderer. In the example below, the name of the renderer factory class that is included in the search path is MyOPCRendererFactory.

setting."ilog.tgo.model.IltOffPageConnector.Type"[name="MyType"] {
   renderer: @+opcRendererFactory1;
}
Subobject#opcRendererFactory1 {
   class: 'MyOPCRendererFactory';
}
How to Create a New Off-Page Connector Type Using an Image per Base Style

Another way to represent a type with an image is to specify a source image and an alarm color level parameter for every required base style, directly in CSS. No other base style property or renderer parameter is needed, as a complete image is provided for every needed base style.

To create a new type of off-page connector using an image per base style, do the following:

  1. Create a new type of off-page connector
  2. Using the API:
IltOffPageConnector.Type opcType = new IltOffPageConnector.Type("MyType");
or, using global CSS settings:
setting."ilog.tgo.model.IltOffPageConnector"{
   types[0]: @+opcType0;
}
 
Subobject#opcType0 {
   class: 'ilog.tgo.model.IltOffPageConnector.Type';
   name: "MyType";
}
  1. Map an IltOPCDirectImageBaseRendererFactory to the new type
  2. Using the API IltSettings.SetValue:
IltSettings.SetValue("OffPageConnector.Type.MyType.Renderer", 
    new IltOPCDirectImageBaseRendererFactory());
or, using global CSS settings:
setting."ilog.tgo.model.IltOffPageConnector.Type"[name="MyType"] {
   renderer: @+opcRendererFactory1;
}
 
Subobject#opcRendererFactory1 {
   class: 'ilog.tgo.graphic.renderer.IltOPCDirectImageRendererFactory';
}
  1. Define an image and an alarm color or gray-level parameter in CSS for each required base style
object."ilog.tgo.model.IltOffPageConnector"["type"=MyType]["objectState.Bellcore.State"=EnabledIdle] {
  sourceImage: '@|image("OPCMyType_EnabledIdle.png")';
  alarmColorLevel: 128;
}
object."ilog.tgo.model.IltOffPageConnector"["type"=MyType]["objectState.Bellcore.State"=DisabledIdle] {
  sourceImage: '@|image("OPCMyType_DisabledIdle.png")';
  alarmColorLevel: 140;
}

For details about how to create image base renderers, refer to Customizing Network Element Types From Images.

The predefined off-page connector types have a label and a tooltip specified in the JViews TGO resource bundle (see About Internationalization in the Context and Deployment Descriptor documentation).

The resources that apply to off-page connector types are identified as:

You can edit the values directly in the JViews TGO resource bundle files.

When you create new off-page connector types, the label and tooltip information will also be retrieved from the same resource bundle to be displayed, for example, in a table cell. As you declare new types, register the corresponding entries into the resource bundle file, as follows:

Considering that you have created the following new off-page connector type:

IltOffPageConnector.Type opcType = new IltOffPageConnector.Type("MyType");

You should declare the following properties in the JTGOMessages.properties file: