Rogue Wave JViews TGO Sample: Network Component - Topological Layout


Description

This sample shows how to use the Node and the Link graph layouts in a JViews TGO network component to create topological views.

How to Use the Sample

The main view contains a basic network component with a series of links and network elements. The bottom control panel contains the controls used to configure the node and link layouts of the network.

You can select the various combinations of node and link layouts to compose a topological view.

Note: You are only allowed to move the nodes when there is no node layout set on the 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-topologicalLayout.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 use the node and link graph layouts to create topological views. This is generally done through the following steps:

In this sample, the data source business objects as well as the network component configuration are loaded as part of a project configuration file. When the project file is set, the following steps are performed:

The component configuration can also be specified in the network component constructor or later, through the method ilog.cpl.IlpNetwork.setStyleSheets, you can pass the name of a configuration file (network).

In this sample, besides the usual configuration, the component configuration file also illustrates how you can configure non-automatic multiple node layouts. This configuration can be verified in the GraphLayout rule present in file network. In this rule, the different graph layouts are created and set using the layouts property. As they should be performed when you select the node layout in the application panel, none of these layouts is selected to be executed automatically. To indicate this, property autoLayoutIndex is set to -1. The component configuration file also illustrates how you can customize per-object layout parameters for circular and tree layouts.



Installation Directory

The Network Component - Topological Layout sample is installed here.

Classes Involved

Source Files

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