Perforce JViews Framework Sample: Connection Points
Description
This simple sample shows the following:
- How to create a grapher and define connection points
for node links using
IlvGrapherPin
objects. - How to create a link between two nodes and edit grapher pins.
IlvGrapher
instance or grapher is a data structure
used to display any type of network.
How to Use the Sample
-
Buttons on the top left of the window are used for the following:
- Select nodes and links.
- Create a direct link.
- Create a polyline link.
-
Edit the grapher pins that control link connection points.
You can do the following edit operations:
- Visualize the pins attached to a given node by clicking the node.
- Move a pin by dragging it to a new location.
- Remove a pin by pressing
CTRL
when selecting a pin. - Add new pins by pressing the
CTRL
key and clicking on an area where there are no existing pins.
-
While adding or moving the pins, press the
ALT
key to snap the location of the pin to:- the closest point on the nodes bounding rectangle,
- the center of the node.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
grapherpin.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
- Interacting with a graph.
Installation Directory
The Connection Points sample is installed here.
Classes Involved
- ilog.views.IlvGrapher
- ilog.views.linkconnector.IlvPinLinkConnector
- ilog.views.linkconnector.IlvGrapherPin
- ilog.views.interactor.IlvMakeLinkInteractor
- ilog.views.interactor.IlvGrapherPinInteractor