Perforce JViews TGO Sample: Network Component - Basic Editor


Description

This sample shows how to use the features of the Perforce JViews TGO to create a network component basic editor in a simple form with the basic editing functionality.

How to Use the Sample

The main panel on the right contains two main sectons:

The control panel on the left provides the following functionality:

The Menu options allows users to: Create a new, load and save a JViews TGO Project (*.itpr) Create a new network data container, load network data from disk, and save the contents of the network currently being displayed. Additionally it allows users to delete all the network data that is currently being displayed. Add new styles sheets to the network component; and remove all style sheets. In which case the default style sheets used by JViews TGO are loaded.

Important: The style sheets to be loaded should be targeted at styling the network objects. As opposed to a configurational style sheet for the network component itself. If you wish to change the configuration of the network component being edited, you need to directly edit the network configuration file located at configuration.network-configuration

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-editor.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 features of the Perforce JViews TGO to create a network component editor. The code of this sample can be found in the doSample method. To initialize JViews TGO and create the User Interface, the following steps are taken:

The following are the main types in this sample:

editor.Main and the editor.Main.PositionConverterHandler which have been described above.

editor.action.ActionProvider which serves as a repository for the actions that are available in this sample. It has a set of predefined actions that are accessed by the sample's UI controls.

editor.action.MakeNetworkElementAction the AbstractAction implementation that allows individuals to create Network Elements with the click of a button.

editor.action.MakeNetworkElementButton the IlpNetworkInteractorAction implementation that allows AbstractActions to be integrated as gestures in an IlpInteractor.

editor.util.BaseDirectoryPathResolver an IlvDefaultDataPathResolver customization that searches for all possible paths that can be built with a given file name, under a given base directory. It aids the JViews Maps in finding background files.

Installation Directory

The Network Component - Basic Editor sample is installed here.

Classes Involved

Source Files

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