Perforce JViews Gantt Sample: Activity and Resource Charts
Description
This sample shows how to coordinate the display of an activity-oriented Gantt chart and a resource-oriented Schedule chart when both charts are bound to the same Gantt data model.
How to Use the Sample
-
The user interface of this sample consists of:
- A standard Gantt chart with its toolbar in the upper panel of a
horizontal
JSplitPane
. - A Schedule chart with its toolbar in the lower panel of the
JSplitPane
.
- A standard Gantt chart with its toolbar in the upper panel of a
horizontal
- Both charts are bound to the same data model. Modifications in one chart are dynamically reflected in the other. The vertical splitter and the horizontal scrolling behavior for both charts is synchronized.
-
This sample has the following keyboard accelerators:
- Ctrl+Z : zoom
- Ctrl+U : unzoom
- Ctrl+F : fit to view
- Ctrl+Enter : toggle selected row expand/collapse
- Ctrl+2 : increase row height
- Ctrl+Shift+2 : decrease row height
- Arrow Keys : scroll
-
For information about other actions, refer to the
Gantt Chart
sample.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
dual-chart.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
-
Creating a
IlvGanttChart
andIlvScheduleChart
bound to the same data model. - Coordinating horizontal time scrolling for both charts.
- Coordinating the vertical splitter for both charts.
Installation Directory
The Activity and Resource Charts sample is installed here.
Classes Involved
- ilog.views.gantt.IlvGanttChart
- ilog.views.gantt.IlvScheduleChart
- ilog.views.gantt.IlvTimeScrollController
Source Files
-
dualChart.DualChartExample
The main sample application is an extension of
AbstractExample
. -
shared.GanttCommand
Swing Actions used in the menus and toolbar.