You can customize the renderer for the network element type 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 is
renderer
as shown in the following example.
setting."ilog.tgo.model.IltNetworkElement.Type"[name=YOUR_NEW_TYPE_NAME] {
renderer: @+neRendererFactory0;
}
Subobject#neRendererFactory0 {
class: 'MyNERendererFactory';
}
In this example, the name of the renderer factory class that is
included in the search path is
MyNERendererFactory
.
Starting from an original image of type
java.awt.Image
corresponding to the Carrying Traffic base style without any
alarm, JViews TGO
automatically processes the range of representations
corresponding to other states and alarms.
Suppose that you want to define a new
network element with the following representation for the base
style Carrying Traffic with no alarms.
To define this new network element representation, all you have
to do is instantiate an
IltNEImageBaseRendererFactory and provide
the bitmap image as an argument to its constructor.
JViews TGO automatically
computes the various representations that this network element
can have according to its associated state and alarms.
The
first constructor has four arguments and enables you to
customize the way the different representations are computed.
The first parameter is of type
java.awt.Image
. It is the original image used to compute all other
representations.
The first and the second
int
are thresholds indicating which part of the original image
should be considered as details and drawn in the dark color.
The third
int
is the gray level that should be mapped to the normal alarm
color.
The
second constructor has the same parameters as the first one
and an additional boolean parameter that indicates whether an
additional dotted border should be drawn around the base.
The third constructor has only one argument, which is the
java.awt.Image
that should be used to compute the different representations
of the new type. It calls the constructor with four arguments,
with the image and 200 as the threshold for bright colors, 50
as the threshold for dark colors, and 128 as the gray level to
be mapped to the normal alarm color.
The following figure presents the four
base styles (rows) with their various representations
corresponding to alarms of different severity and loss of
connectivity (columns).