Perforce JViews Diagrammer Sample: Extending a Designer Project


Description

This sample shows how to use the Perforce JViews Diagrammer SDK to extend a project built with Perforce JViews Diagrammer Designer.

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-extension.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 Diagrammer SDK to extend a project built with the Perforce JViews Diagrammer Designer.
The sample first loads a project created using Perforce JViews Diagrammer Designer. The project has a background bitmap representing a map of the USA with a network of cities connected by links. The cities have a size attribute and a status attribute. The links also have a size attribute. The project's style sheet defines rules so that the sizes of nodes and the widths of links depend on the size attribute. The colors of nodes depends on the status field.
The project file is stored in the data sub-directory of this sample.
Note: The background map is only a bitmap and does not contain any projection information. Therefore, this sample does not use the Perforce JViews Maps product; it can be run even if Perforce JViews Maps is not installed. Consequently, the positions of the city nodes are saved as x/y coordinates in pixels. See the Integration with JViews Maps sample to learn how to use Perforce JViews Maps to define real georeferenced diagrams with Perforce JViews Diagrammer.
The sample adds two interactions to the Perforce JViews Diagrammer Designer project:

Installation Directory

The Extending a Designer Project sample is installed here.

Classes Involved

Source Files

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