Rogue Wave JViews TGO Sample: Network Component - Geographic Positioning


Description

This sample shows how to place network elements on a background map. The locations of the network elements are indicated by geographic coordinates.

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.

You can interact with the objects through the selection interactor. For example, open the Information window attached to the "Helsinki" element.

You can also navigate through the map by using the scroll bars and the zoom buttons.

When you move the mouse over the map, the geographic coordinates corresponding to the mouse location are displayed in the lower right of the frame.

Note that the sample works in applet mode only when loaded from a local disk. It does not work through http URLs. This is a limitation.

Note that you can move the network elements on the map, but you should not move them further than the North Pole, nor further than the South Pole. The geographic position converter does not support invalid positions like these extreme cases. Note also that if you move network elements too far east or west, they will disappear and reappear on the opposite side of the map. This is a normal behavior, and reflects the topology of the earth surface.



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-geopositioning.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 place network elements on a background map. The locations of network elements are given by geographic coordinates. The code of this sample is contained in the doSample method. The sample includes the following steps:



Installation Directory

The Network Component - Geographic Positioning sample is installed here.

Classes Involved

Source Files

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