Rogue Wave JViews TGO Sample: Network Component - Bus Layout


Description

This sample shows how to use the bus layout features with 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 network elements and links connected to a bus object. It illustrates how to use the bus layout with a JTGO network component.

A network component has a default toolbar which provides a set of predefined interactors:



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-busLayout.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 configure it to display its objects positioned according to a bus layout configuration.

Bus topology is well known in network management and telecommunications fields. The Bus Layout can display these topologies nicely. It represents the "bus" as a "serpent" polyline. The width of the "serpent" is user-defined (via the width of the layout region parameter) and the height is computed so that enough space is available for all the nodes.

The Bus Layout places the nodes and reshapes the links, so that it is usually not necessary to specify an additional link layout to the network component. In order to have the business objects correctly laid out by the Bus Layout, the data source that is connected to the network component needs to contain a bus node connected with links to several other nodes. When you specify the Bus Layout in CSS, the data model must respect this condition.

In JTGO, the bus node is represented by an ilog.tgo.model.IltLinearGroup. The linear group object is added to the data source with a generic position. There are two steps to perform in the linear group configuration so that it can be used as a bus node by the layout:

The code of this sample can be found in the doSample method.

To create a network component, the sample includes the following steps:



Installation Directory

The Network Component - Bus Layout sample is installed here.

Classes Involved

Source Files

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