Perforce JViews Diagrammer Sample: Working with JViews Maps


Description

This sample shows how to use the Perforce JViews Maps product together with Perforce JViews Diagrammer to display a diagram on top of a background map.

How to Use the Sample

How to Run the Sample as an Application

This sample can be run as an application. The installation directory contains an executable JAR file, diagrammer-map.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 Perforce 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 Perforce JViews Maps product together with Perforce JViews Diagrammer to display a diagram on top of a background map.
The diagram represents assets in various towns, connected by links. It could represent factories, power supplies, internet nodes, or any other georeferenced objects.
The background is a tiled, multiresolution map of the USA: it consists of many small bitmap files covering a region of the world. The tiles are loaded using the load-on-demand feature of Perforce JViews Maps: when you zoom the diagram in or out, more or less detailed bitmaps are loaded as needed according to the visible region.
The nodes of the diagram are georeferenced. That is, their positions are defined by the latitude and longitude properties instead of x and y. Perforce JViews Maps is used to project these geographic locations onto coordinates on the screen.
The bridge between Perforce JViews Diagrammer and Perforce JViews Maps is the Map pluggable renderer provided by the SDM engine. To use a background map, all you have to do is activate this renderer (using the Designer is the easiest way), and specify the file that contains the map definition.
Instead of using the example map that is provided with this example, you can build your own map using the Map Builder application of Perforce JViews Maps.
Note: You must have the Perforce JViews Maps product installed to run this example, and you must have a valid license for that product. The pluggable ilog.views.sdm.renderer.maps.IlvMapRenderer renderer object is used for the bridge between Perforce JViews Diagrammer and Perforce JViews Maps.

Installation Directory

The Working with JViews Maps sample is installed here.

Classes Involved

Source Files

Copyright © 2021 Rogue Wave Software, Inc., a Perforce company. All rights reserved. Legal terms.