Perforce JViews Diagrammer Code Example: Bus Layout (Java SDK Version)
Description
This sample shows how to use the Bus Layout algorithm
in a Java application.
It shows how to perform a Bus Layout and how to control its
layout parameters in Java code.
This sample uses the graphic framework, but it does not use
the IlvDiagrammer
component or CSS.
A version of the Bus Layout sample that uses CSS can be found here
How to Use the Code Example
- The Bus Layout algorithm is designed to display bus network topologies. That is, a set of nodes connected to a bus object. The algorithm takes into account the size of the nodes (no overlapping nodes) and provides several ordering options.
-
This application shows a manager view that displays a grapher read from an
IVL
file. You may change the grapher sample using the list at the top of the application. - The application also has interactor buttons on the top side: pan, select, zoom box, zoom in, zoom out, and show all (fit to contents).
- You may use the select interactor to select a nodes.
- On the bottom, the Layout button performs the Bus Layout algorithm. There are also checkboxes and choice menus that allow you to select different layout parameters.
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,
buslayout.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
- Bus Layout in Java Code
- Bus Layout Parameters
Detailed Description
A version of the Bus Layout sample that uses CSS can be found here
Installation Directory
The Bus Layout (Java SDK Version) code example is installed here.