Perforce JViews Framework Code Example: Expand and Collapse Interactions
Description
This sample shows different ways to collapse and expand submanagers and link bundles.
How to Use the Code Example
-
This sample displays an
IlvManagerView
. The view contains several nested managers and link bundles that can be collapsed or expanded. - The collapsed representation of a manager is a single node, and the collapsed representation of a link bundle is a single link. There are several ways to expand or collapse the objects.
- Click on the handle at the expanded manager frame or link bundle frame to collapse a manager or link bundle. Click on the handle at the collapsed manager frame or link bundle frame to expand a manager or link bundle. This mechanism is available independently from the current view interactor, but might be unsuitable when the handles become too small because of a reduction in magnification.
- Right-click an object to show a pop-up menu with menu items to expand or collapse the object. Pop-up menus are a good choice when expand and collapse actions are not likely to be used very often.
- Use the expand/collapse interactor from the toolbar. This interactor allows you to expand and collapse objects by clicking the objects. This interactor is a good choice when expand and collapse actions are likely to be used regularly.
-
The buttons at the top of the sample are used as follows:
- Set Pan mode. In Pan mode you can pan the view by dragging the image.
- Set Selection mode. In Selection mode you can select, move, and edit objects.
- Zoom in on an area. You can select the area to magnify.
- Zoom in.
- Zoom out.
- Make the entire image visible.
- Use the expand/collapse interactor.
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,
expandinter.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
- Expand and Collapse of nested managers and link bundles
- Pop-up menu on graphic objects
Installation Directory
The Expand and Collapse Interactions code example is installed here.
Classes Involved
- ilog.views.interactor.IlvExpandCollapseInteractor
- ilog.views.IlvObjectWithSelection
- ilog.views.IlvManagerView
- ilog.views.IlvManager
- ilog.views.IlvDefaultManagerFrame
- ilog.views.graphic.linkbundle.IlvLinkBundle
- ilog.views.graphic.linkbundle.IlvDefaultLinkBundleFrame
- ilog.views.swing.IlvPopupMenuManager
- ilog.views.swing.IlvPopupMenuContext
- ilog.views.swing.IlvSimplePopupMenu
- ilog.views.swing.IlvJManagerViewControlBar
- ilog.views.accelerator.IlvIdentityAccelerator
- ilog.views.accelerator.IlvZoomOutAccelerator
- ilog.views.accelerator.IlvZoomInAccelerator