Perforce JViews TGO Sample: Network Component - Blinking
Description
This sample shows how to use the blinking features of the Perforce JViews TGO network component.
How to Use the Sample
When the select interactor is enabled, a pop-up menu is available and can be used to add, acknowledge or clear alarms of different severities on the selected objects. This sample illustrates how you can configure the business objects displayed in a network component to have a different alarm representation using blinking colors. In this sample, the object starts to blink when new alarms are added to the object.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
network-blinking.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Defining a blinking manager with a deployment descriptor
- Initializing a JTGO application using a deployment descriptor
- Creating an
IlpNetwork
- Loading a network component configuration which defines the blinking colors
Detailed Description
This sample shows how to use blinking colors with the network component. The code of this sample can be found in the doSample method. To use blinking colors with the network component, the sample includes the following steps:
- Define the blinking manager with the deployment descriptor. In this sample, the descriptor file is called deploy. It defines the blinking manager as follows:
<blinkingManager>
<offPeriod>1000</offPeriod>
<onPeriod>1000</onPeriod>
<blinkingManager>
- Initialize the application using the method ilog.tgo.IltSystem.Init and passing the deployment descriptor file. This file contains information about global settings for the application. In this sample, the deployment descriptor file contains the blinking manager configuration, and directories to be added to the search path to locate resources, data and configuration files.
- Create a network component.
- Load the network component configuration with blinking color definition.
-
alarmColor
-
alarmBrightColor
-
alarmDarkColor
-
alarmColorVisible
-
alarmBalloonVisible
-
alarmBalloonColor
-
alarmBalloonShadowColor
-
alarmBalloonTextForeground
-
alarmBalloonTextBackground
-
alarmBalloonTextFont
-
alarmBalloonTextAntialiasing
-
alarmBalloonCountAbbreviated
-
alarmBalloonCollapsed
-
alarmBalloonPosition
-
alarmCountVisible
-
alarmCountForeground
-
alarmCountBackground
-
alarmCountAbbreviated
-
alarmCountAntialiasing
-
alarmCountFont
-
alarmCountMultiline
-
alarmBorderColor
-
alarmBorderWidth
-
alarmBorderVisible
-
alarmAsMark
-
severityColor
: returns the color that is configured for a given alarm severity. -
severityBrightColor
: returns the bright color that is configured for a given alarm severity. -
severityDarkColor
: returns the dark color that is configured for a given alarm severity. -
blinkingcolor
: creates a blinking color.
Installation Directory
The Network Component - Blinking sample is installed here.
Classes Involved
-
ilog.tgo.IltSystem
The class that initializes a JViews TGO application.
-
ilog.tgo.datasource.IltDefaultDataSource
The default datasource implementation.
-
ilog.cpl.IlpNetwork
The network component.
-
ilog.tgo.model.IltObject
The predefined business object implementation.
-
ilog.tgo.grprim.IltBlinkingColor
The blinking color implementation.
-
ilog.tgo.css.function.IltBlinkingColorFunction
The CSS function that retrieves a blinking color
-
ilog.tgo.css.function.IltSeverityColorFunction
The CSS function that retrieves the alarm severity color configuration.
-
ilog.tgo.css.function.IltSeverityBrightColorFunction
The CSS function that retrieves the alarm severity bright color configuration.
-
ilog.tgo.css.function.IltSeverityDarkColorFunction
The CSS function that retrieves the alarm severity dark color configuration.
Source Files
-
blinking.Main
The entry point of the sample.
-
blinking.AlarmPopupMenuFactory
The factory that creates pop-up menus for the objects.