Rogue Wave JViews TGO Sample: Network Component - Geographic Information


Description

This sample demonstrates how to implement load-on-demand of Rogue Wave JViews TGO objects based on data stored in a database server that supports load-on-demand, such as Oracle Spatial.

How to Use the Sample

The sample displays a view with a toolbar, a layer legend on the right-hand side, and the geographic coordinates of the spot pointed to with the mouse at the bottom.

The default interactor is the pan interactor, which allows you to move the content of the view.

The select interactor has been modified so that Shift-MouseDrag performs a panning of the view, as the pan interactor does.

The JViews TGO objects are added to the map after the 3rd zoom-in is performed from the startup perspective.

The added JViews TGO objects will start receiving alarm notifications in real time. The alarms are generated by a simulator which acts as the back-end application. It sends alarm updates in XML format to the JTGO data source.

The ability to zoom-in and zoom-out is controlled. This is done to:

  1. Provide a better user experience, given the map's level of detail
  2. Minimize the round trips to the server, if used connected to an Oracle database
For the precise contraints see network.css

Installation Requirements

You need the Rogue Wave JViews Maps Data DVD. This DVD contains the map data used by this sample (located in the DVD_DRIVE:\Shape directory).

You can run this sample either off the DVD, or move the data to an Oracle Spatial server and then use the data as stored on the server. In the latter case, you need Oracle Enterprise version 8.1.7 or higher and a JDBC driver that can be used to connect to the database. In which case you will have to:

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-gis.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

Rogue Wave JViews Maps provides three features for loading background maps on demand:

This sample makes use of the first two features, and renders loaded objects with JTGO objects that have the right look and feel for displaying network alarm states. This is done through a custom IlvFeatureRenderer that creates JTGO objects instead of Rogue Wave JViews objects.

A JTGO network component is used. It contains an IlvGrapher into which background and city layers are inserted. The background layers are ordinary Rogue Wave JViews Maps tiled layers. The city layers consist of a tiled layer that will never actually contain any IlvGraphic object; its sole purpose is to trigger the loading of JTGO objects. This is done by plugging a special IlvFeatureRenderer that creates an IlpObject instead of an IlvGraphic for each point contained in the map file/database.

The IlpObject is added to the data source, and the simulator is requested to send future alarm updates of the new object to the data source.

Performance Issues

The loading of a tile of JTGO objects (city layer) -- triggered by zooming or panning -- is currently slow and blocks the application until it is finished. We are working on multithreaded loading of tiles, that would allow the application to react to user's input while the tile loading is still in progress.

The class NetworkTileLoader is used to delay computation of automatic layout until the loading of a tile is complete.

Known Bug

When you select an area using the mouse-dragging gesture of the select interactor, sometimes only half of the objects inside the depicted rectangle get selected. Sometimes some objects outside this rectangle get selected as well.

Notes

The server that stores the spatial data might not be a common one, which would mean writing the connection to that server from scratch. In this particular case, only the first of the three Rogue Wave JViews Maps features (mentioned in the Introduction above) would be interesting for reuse, and therefore it would be simpler to implement a custom IlvTileLoader instead of a custom IlvFeatureRenderer. (In the Rogue Wave JViews Maps architecture, the tile loader fetches the map data from the file or server, and uses the feature renderer to create graphic objects. This could be done in one step here.)

When using the sample in oracle mode, there can be a delay when displaying the background and cities while the information is retrived from the database. The view gets automatically refreshed once all the information is available to the client. The actual delay depends on the network latency involved.

Installation Directory

The Network Component - Geographic Information sample is installed here.

Classes Involved

Source Files

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