Perforce JViews Diagrammer Code Example: Link Bundle (CSS Version)
Description
This sample illustrates a possible way to obtain bundles of links. It shows how to specify link bundles using CSS.
A version of the Link Bundle sample that does not use CSS can be found here
How to Use the Code Example
- This application shows a diagrammer with a couple of links. You can change the style sheet by using the Select CSS 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,
diagrammer-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
- Diagrammer.
- Graph Layout
- Multilink bundling
- Link Layout in CSS
- Mutable Style Sheet
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 (CSS Version) code example is installed here.
Classes Involved
- ilog.views.sdm.graphic.IlvSDMLinkBundle
- ilog.views.graphic.linkbundle.IlvLinkBundle
- ilog.views.graphic.linkbundle.IlvLinkBundleFrame
- ilog.views.graphic.linkbundle.IlvDefaultLinkBundleFrame
- ilog.views.graphlayout.link.IlvLinkLayout
- ilog.views.sdm.util.IlvSDMMutableStyleSheet
- ilog.views.diagrammer.IlvDiagrammer