Perforce JViews Framework Code Example: Find In View
Description
This sample shows how to search for nodes in a grapher and how to center them in the manager view.
How to Use the Code Example
- The application displays a grapher containing a binary tree with 4095 nodes.
- If you enter a number between 1 and 4095 into the text field at the top, the application searches for the node with that number. If the node is found, the application centers the node in the view.
- The animation option adds an animation that scrolls the view from the old position to the new position.
How to Run the Code Example as an Application
This code example can
be run as an application.
The installation directory contains
an executable JAR file,
findinview.jar
,
that allows you to execute the code example 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 code example 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 code example and type:
ant run
Topics Covered
- Find objects in manager
- Center objects in view
- Scrolling animation in view
Installation Directory
The Find In View code example is installed here.
Classes Involved
- ilog.views.IlvGrapher
- ilog.views.IlvManagerView
- ilog.views.IlvLinkImage
- ilog.views.linkconnector.IlvClippingLinkConnector
- ilog.views.graphic.IlvZoomableLabel
- ilog.views.swing.IlvJScrollManagerView