Perforce JViews Gantt Sample: Activity Chart and Calendar
Description
This sample demonstrates the monthly and daily calendar view Gantt components.
How to Use the Sample
- Both daily and monthly calendar views display Gantt data model leaf activities and milestones. Views are automatically updated when activities are modified in the Gantt chart. Both views accept a static Gantt data model containing holidays. By default, holidays are rendered distinctly in green.
-
The following interactions are available when the Month
calendar tab is selected:
- Use the vertical scroll bar or mouse wheel to change the month currently being viewed.
- Press the control key while scrolling with the mouse wheel to advance or push back the calendar by year.
- As you scroll in the Month tab, the daily calendar view is updated to display the first day of the current month selected.
- Click a day in the Month tab to center the Gantt chart on that date. The daily calendar view is updated to display the corresponding date when you select the Day tab.
- Click an activity or milestone for it to be selected in the Gantt chart and the Day tab. Drag the mouse to move the activity or milestone to a different day.
- Use the Control key to toggle selection and the Shift key to select multiple activities or milestones.
- Double-click a day to switch to the Day tab for that date.
-
The following interactions are available when the Day
calendar tab is selected:
- Press the control key while using the mouse wheel to scroll by days. The monthly calendar view is updated so that the current month is displayed when the Month calendar tab is selected.
- Click an activity or milestone in the Day calendar tab for it to be selected in the Gantt chart. The Gantt chart is centered on the activity or milestone selected.
- Click and vertically drag an activity or milestone in the hourly sheet grid to move it to a different time of day.
- Use the Control key to toggle selection and the Shift key to select multiple activities or milestones.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
calendar-view.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
-
Using an
IlvMonthView
monthly calendar view component. -
Using an
IlvDayView
daily calendar view component. -
Adding interactions to an
IlvMonthView
. -
Adding interactions to an
IlvDayView
.
Detailed Description
This sample demonstrates the monthly and daily calendar view Gantt components on the right of the chart. The calendar view components display leaf activities of the data model being displayed by the Gantt chart. The sample also illustrates how to create custom mouse interactions for the calendar view components.
Installation Directory
The Activity Chart and Calendar sample is installed here.
Classes Involved
- ilog.views.gantt.swing.calendarview.IlvMonthView
- ilog.views.gantt.swing.calendarview.IlvMonthPanel
- ilog.views.gantt.swing.calendarview.IlvDayView
- ilog.views.gantt.swing.calendarview.IlvHourlyActivitySheet
- ilog.views.gantt.swing.calendarview.IlvDefaultActivityCalendarRenderer
- ilog.views.gantt.swing.calendarview.IlvDefaultMilestoneCalendarRenderer
Source Files
-
calendarView.CalendarViewExample
The main class of the sample.
-
calendarView.MonthPanelInteractor
The interactor installed on the month grid panel of the Monthly Calendar View.
-
calendarView.DayViewInteractor
The interactor installed on the Daily Calendar View.