Perforce JViews Diagrammer Code Example: Link Bundle (Java SDK Version)
Description
This sample illustrates a possible way to obtain bundles of links.
This sample uses the graphic framework, but it does not use
the IlvDiagrammer
component nor CSS.
A version of the Link Bundle sample that uses CSS can be found here
How to Use the Code Example
- This application shows a manager view that displays a grapher constructed by using code. You can change the grapher sample by using the Select Sample list at the top of the application. Move the mouse over individual sublinks in the bundles to show a tooltip specific to the sublink.
-
At the bottom are controls that allow you to make various customizations:
- Choose the link shape: orthogonal, direct, or straight.
- Indicate whether you want a unique connection point (for straight link style).
- Specify the offset between the links of the same bundle.
- Enable or disable the drawing of the bundle frame.
- Specify the margin of the bundle frame.
- Collapse or expand the bundles.
- You can also click onto a bundle to trigger a pop-up menu, that allows to expand or collapse the bundle.
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,
linkbundle.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
- Grapher
- Graph layout
- Multilink bundling
Detailed Description
Multilinks are links between the same pair of end nodes. They look nice if they appear as a bus of parallel links. This sample shows how such bundles of parallel links can be implemented by using a link bundle object. This sample used graph layout. However, note that layouts in Perforce JViews deal only with the global shape of the bundles. The shape of the individual links is computed by the link bundle object itself. Link bundles can be used even if no graph layout algorithm is used.
Installation Directory
The Link Bundle (Java SDK Version) code example is installed here.
Classes Involved
- ilog.views.graphic.linkbundle.IlvLinkBundle
- ilog.views.graphic.linkbundle.IlvLinkBundleFrame
- ilog.views.graphic.linkbundle.IlvDefaultLinkBundleFrame
- ilog.views.IlvGrapher
- ilog.views.IlvManagerView
- ilog.views.swing.IlvJScrollManagerView