Traps, like alarms, are represented in
the business objects using the following graphical cues:
A
color associated with the object base.
An
alarm count displayed on the object base.
A
colored alarm balloon displaying another alarm count.
A
colored outline displayed around the object base.
For information on how these graphical cues are used in
JViews TGO, refer to
Alarm states in the
Business
objects and data sources documentation.
When a new trap type is created, the
properties used to customize the graphical cues need to be
defined. These properties are:
A
short description used by the alarm count.
An expanded description used in the alarm balloon when the CSS
property
alarmBalloonCollapsed
is false.
A set
of colors to be defined subsequently.
These properties are set as part of the
JViews TGO look and feel,
which can be customized using
SetValue or global CSS settings.
The properties that affect the trap
types are:
Trap.Type.<type name>.Color
Trap.Type.<type
name>.BrightColor
Trap.Type.<type
name>.DarkColor
Trap.Type.<type
name>.Abbreviation
Trap.Type.<type
name>.Description
Trap.Type.<type name>.Icon
Trap.Type.Alert.Color
Trap.Type.Alert.BrightColor
Trap.Type.Alert.DarkColor
Trap.Type.Alert.Abbreviation
Trap.Type.Alert.Description
Trap.Type.Alert.Icon
(This property is optional.)
The following example shows how to
customize the new trap type using the API.
// Define the colors
Color myAlarmColor = new Color(127, 255, 212);
// aquamarine
Color myAlarmBrightColor = myAlarmColor.brighter();
Color myAlarmDarkColor = myAlarmColor.darker();
IltSettings.SetValue("Trap.Type.Alert.Color", myAlarmColor);
IltSettings.SetValue("Trap.Type.Alert.BrightColor", myAlarmBrightColor);
IltSettings.SetValue("Trap.Type.Alert.DarkColor", myAlarmDarkColor);
IltSettings.SetValue("Trap.Type.Alert.Abbreviation", "i");
IltSettings.SetValue("Trap.Type.Alert.Description", "Informational");
You can then retrieve these values using
GetValue.
The following example shows how to customize the new trap type
using global CSS settings. You must specify the full trap type
name, for example "
Trap.Type.Alert
" when matching the "
name
" attribute. The CSS properties to be customized are
color
,
darkColor
,
brightColor
,
abbreviation
,
description
,
icon
):
setting."ilog.tgo.model.IltTrap.Type"[name="Trap.Type.Alert"] {
color: orange;
darkColor: green;
brightColor: yellow;
abbreviation: "a";
description: "Alert";
icon: '@|image("icon1.png")';
}