Perforce JViews TGO Sample: Network Component - Composite Graphics
Description
This sample shows how to use custom business classes with the network component, and how to create your own graphic objects to represent your business objects and their attributes.
How to Use the Sample
The main frame also contains a panel that allows you to toggle the visibility of three attributes:
-
New alarms
: this attribute is graphically represented by an alarm balloon positioned at the top-right of the object. -
Test
: this attribute represents the test status of the object, and is graphically represented by an alarm balloon positioned at the bottom-right of the object. -
Contact
: this attribute represents the contact information, and is graphically represented as a line inside an Information window. The Information window also contains the representation of the "site" attribute.
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-compositeGraphic.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
- Basic initialization.
See thenetwork/basic
sample for details. - Creating custom business classes
See thenetwork/customClasses
sample for details. - Creating graphic objects to represent objects and attributes of custom classes.
- Mapping attributes of custom classes to graphic properties of network nodes and links using style sheets.
- Toggling the visibility of decorations by using style sheets and pseudoclasses.
Detailed Description
This sample differs from the customClasses
sample in that it shows objects created using custom graphics, and in that it allows you to toggle the visibility of some decorations.
The custom classes used in this sample are defined in customClasses.
The attributes of the custom classes are mapped to the graphic attributes of the network nodes by a set of style sheets declared in composite.
Installation Directory
The Network Component - Composite Graphics 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.views.graphic.composite.IlvCompositeGraphic
The composite graphic implementation.
-
ilog.views.graphic.composite.layout.IlvAttachmentLayout
The layout implementation to attach decorations in a composite graphic.
-
ilog.views.graphic.composite.layout.IlvAttachmentConstraint
The attachment contraint to place decorations in a composite graphic.
Source Files
-
compositeGraphic.Main
The entry point of the sample.
-
compositeGraphic.ToggleInfoWindowAction
The action to make the information window visible.