Perforce JViews Charts Sample: Interactors


Description

This sample shows the interactors that are built-in in Perforce JViews Charts. It also contains their source code.

How to Use the Sample

A combo box for choosing an interactor is available above the chart. Depending upon the chosen interactor, the chart is also parametrized so that the interactor can operate on the chart; for example, when the 3-D interactor is chosen, the chart is put into 3-D mode.

How to Run the Sample as an Application

This sample can be run as an application. The installation directory contains an executable JAR file, interactor.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 customize and install interactors on a chart. An interactor is an object that reacts on particular input events (mouse or keyboard events) and performs some action depending on the events. For some interactors the input events can be specified, for example which mouse button is tracked. Some interactors perform hardcoded actions; others simply notify an event listener that is freely programmable.

Interactors often need to be customized by subclassing. For example, the chartConnected method needs to be overridden when you want some actions to be performed when the interactor is being connected to or detached from a chart. This sample shows some use cases.

This sample also contains the source code of the Perforce JViews Charts built-in interactors. It allows you to better understand the information flow inside an interactor and to significantly extend these interactors. The source code in this sample belongs to the package interactor, while the Perforce JViews Charts interactors are in the package ilog.views.chart.interactor. This allows you to make modifications to the interactors and test them immediately, without risking to disturb the functioning of the Perforce products.

Installation Directory

The Interactors sample is installed here.

Classes Involved

Source Files

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