Rogue Wave JViews TGO Sample: Network Component - Alarm


Description

This sample shows the different alarm types supported by the Rogue Wave JViews TGO predefined business objects and how they are graphically represented in the network component.

How to Use the Sample

The main frame contains a simple network component, with several different types of nodes and links displayed on a background map. A network component has a default toolbar which provides a set of predefined interactors:

When the select interactor is enabled, you can expand nodes that contain objects. The sample includes such a node: SubNetwork. To expand the node, click the icon at the top right of the node. To collapse the expanded node, click on the icon at the top left of the expanded node frame.
When you pass the mouve over a business object, its label is changed to be displayed with a different font and background color.

And finally, it is possible to see details about the business object by double-clicking on it. This action will trigger a dialog that displays information about the alarms that are present in the object.


How to Run the Sample as an Application

This sample can also be run as an application. The installation directory contains an executable JAR file, network-alarm.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 Rogue Wave JViews.

Then, go to the installation directory of the sample and type:

ant run

Topics Covered

Detailed Description

This sample shows how to create a network component and illustrates the different types of alarms that can be set to the JTGO predefined business objects. The code of this sample can be found in the doSample method.

JTGO defines a specific look and feel to represent states and alarms in the graphic representation of all predefined business objects. The main graphical cues for alarms are:

Besides the normal alarms, which are now called raw alarms, it is also possible to specify a second category of alarms, called impact alarms. Impact alarms are used to represent propagated alarms, which are represented on an equipment but are not generated by it. Impact alarms are graphically represented by a different alarm balloon and a different alarm count.

A business object can contain raw and impact alarms at the same time. The graphic representation depends on the alarm state that has the highest priority. The CSS property primaryAlarmState defines the alarm state that has priority in the object graphic representation.

This sample provides a pop-up menu that allows you to:

You can change the graphic representation of the business object according to the alarm state priority by using CSS. The network component configuration file network provides specific CSS selectors to define the value of property primaryAlarmState according to the presence of a custom pseudoclass, impactAlarm. This custom pseudoclass is added or removed from the network component when the specific pop-up menu action is triggered. For details, see alarm.AlarmPopupMenuFactory.

Another custom pseudoclass, hover, is also used to illustrate how you can trigger actions when the mouse enters and exits a business object. In this sample, when the mouse enters a business object its label font and background color are changed.



Installation Directory

The Network Component - Alarm sample is installed here.

Classes Involved

Source Files

Copyright © Rogue Wave Software, Inc. 1997, 2015. All rights reserved. Legal terms.