Perforce JViews Diagrammer Sample: Graph Layout
Description
This demo illustrates some graph layout with simple data and settings
How to Use the Sample
- On the top of the window appears a graphical menu where you can choose the type of layout you want to see and manipulate. To choose a layout, click on its icon; it will result in scrolling it to the middle and displaying its name to indicate that it is selected.
- If the icon of the layout is not in the visible area of the menu you can scroll it either with the mouse wheel, or with the arrow keys (right/left or up/down).
- When a layout is choosen, a predefined set of nodes and links is created and the layout is applied. It is displayed in the central part of the window.
- On the left part, controls are displayed to change some predefined parametes of the layout. The changes are applied on the layout in real time, so that you can see the result
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
graphlayout-demo.jar
,
that allows you to execute the sample 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 sample 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 sample and type:
ant run
Topics Covered
- Graph layout
- Dashboards and symbols
Detailed Description
The demo allows you to choose a type of layout among several, and to interact with controls to modify some parameters of the choosen layout and to see the result
Installation Directory
The Graph Layout sample is installed here.
Classes Involved
-
ilog.views.diagrammer.IlvDiagrammer
For each layout a diagrammer is created with a set of nodes and links, and a layout is set on this diagrammer. The settings of this layout will be changed to test different configurations.
-
ilog.views.dashboard.IlvDashboardDiagram
The controls that are used to change setttings of layouts are symbols put in dashboards. Those dashboard are loaded in a IlvDashboardDiagram.
Source Files
-
GraphLayout
This is the main class of the demo. It creats the GUI and loads all needed images and data (graph and control panels).
-
GraphLayoutController
A controller performs modification on a layout, according to given property and value. It is the link between the contol panel (a dashboard) and the layout (on a diagrammer) to modify.
-
GraphLayoutControlPanel
A control panel displays a dashboard containing symbols used to modify the parameters of a layout
-
GraphLayoutDiagrammer
This is a diagrammer containing the graph to layout.