Rogue Wave JViews TGO Sample: Network Component - Label Layout
Description
This sample shows how to use the label layout features of the Rogue Wave JViews TGO 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 with a set of predefined interactors:
- Select
- Pan
- Reset Zoom
- Zoom In
- Zoom Out
- Fit to Contents
The main frame contains a simple network component, with a "Layout Labels" button at the bottom.
Click this button to see how the label layout positions the labels in this network.
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-labelLayout.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
- Initializing a JTGO application using a deployment descriptor
- Creating a data source
- Creating a network component and configuring it using a CSS configuration file
- Associating the data source with the network component
- Reading data from an XML file into a data source
- Performing label layout in the network component
Detailed Description
This sample shows how to use the label layout. This is done in three steps:
- Create the
IltAnnealingLabelLayout
object. - Attach it to the network with the method
setLabelLayout
. - Perform the layout with ilog.tgo.graphic.graphlayout.labellayout.IltAnnealingLabelLayout.performLayout.
Installation Directory
The Network Component - Label Layout 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.graphic.graphlayout.labellayout.IltAnnealingLabelLayout
The label layout implementation.
Source Files
-
labelLayout.Main
The entry point of the sample.