Perforce JViews Diagrammer Sample: Creating Diagrams using the SDK


Description

This sample illustrates how to define and populate a data model, how to apply a style defined with Designer for JViews Diagrammer, and how to perform common management operations on the resulting diagram.

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, diagram-model.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

The JViews Diagrammer model is defined and created through the API. It uses JavaBean objects as instances of nodes and links. These beans do not have any particular dependency on JViews Diagrammer classes. They are merely used as information holders, with a common and simple access to their content. The style used to represent the various instances has been defined through the Designer using Symbols taken from the standard palette. The IDPR project file contains style rules. It uses a very basic XML file that contains only a few node and link samples to preview the styling specification. This XML file is not used in the application, since the data model is created by code. On the right-hand side, control buttons allow you to change visualization options, such as the level of detail, graph layout settings (by cascading a style sheet), and so on.

Installation Directory

The Creating Diagrams using the SDK sample is installed here.

Classes Involved

Source Files

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