Perforce JViews Gantt Sample: Nonlinear Time Scale
Description
This sample shows how to create a non-linear time converter that displays days in the weekend using a smaller column width than days in the working week.
How to Use the Sample
-
The drop-down list on the right side of the sample window allows you to
choose the time converter you want to apply to the chart.
The Default list item displays the chart using the default
linear time converter. All days are displayed using a uniform column
width.
The Working Days list item displays the chart using a non-linear time converter. Columns representing days in the weekend have a smaller width than days of the week. - By default, the chart is in unbounded horizontal scroll mode. This means that you can scroll the chart to any date. The Bounded scroll mode check box allows you to set the chart into bounded horizontal scroll mode. In this mode, horizontal scrolling of the chart is limited to one week before and one week following the current schedule.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
nonlinear-time-scale.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
- Developing a non-linear time scale for the Gantt Chart that displays weekend days with a smaller column width than work days.
Detailed Description
The user interface of this sample is similar to that of the Gantt Chart sample on which it is based. The Time Converter tab has been added to the customizer panel on the right side of the chart. A drop-down list allows you to select either the Default linear time converter or the Working Days time converter that shortens the column width for days in the weekend.
Installation Directory
The Nonlinear Time Scale sample is installed here.
Classes Involved
- ilog.views.gantt.graphic.IlvTimeConverter
- ilog.views.gantt.graphic.IlvLinearTimeConverter
- ilog.views.gantt.IlvTimeUtil
Source Files
-
nonlinearTimeScale.NonLinearTimeScaleExample
This sample is an extension of the Gantt Chart sample which illustrates the basics of creating and using
IlvGanttChart
objects. -
nonlinearTimeScale.WeekTimeConverter
The non-linear
IlvTimeConverter
implementation that displays weekend days at a reduced width.