skip to main content
Programmer's documentation > Developing with the JViews Gantt SDK > Gantt charts > Interacting with the Gantt charts
 
Interacting with the Gantt charts
Describes the association between classes and interactors, explains how predefined interactors work and how to use them.
*Class associations for interactors
*Illustrates the associations between classes for interactors.
*Selecting activities and constraints
*Describes how to select activities and constraints and explains the API calls triggered by these actions.
*Moving activity and reservation graphics
*Explains what happens when you move graphics and the limitations involved in applying these actions.
*Duplicating reservation graphics
*Explains how to duplicate reservation graphics.
*Resizing activity and reservation graphics
*Explains how to resize a specific graphic using the GUI.
Class associations for interactors
The following figure shows the associations between classes for interactors.
Several predefined interactors are implemented in the Gantt sheet for the following purposes:
*Selecting activities and constraints
*Moving activity and reservation graphics
*Duplicating reservation graphics
*Resizing activity and reservation graphics
*Interacting with the Gantt sheet using the mouse
Selecting activities and constraints
Before you can manipulate a graphic object, you need to select it. The following figure shows a selected activity graphic and a selected constraint graphic.
The following figure shows the selected activity graphic and constraint graphic.
Installing the selection interactor
A predefined interactor, IlvGanttSelectInteractor, handles the graphic selection. To install this interactor, call the pushInteractor method of the Gantt sheet. When a new Gantt sheet is created the selection interactor is already pre-installed, so the user does not need to install it explicitly.
Selecting graphics
Once the selection interactor is installed in the Gantt sheet, there are three ways to select activity, reservation, or constraint graphics.
*To select a single graphic object, click it with the left mouse button. Any other previously selected object will be deselected.
*To select several graphic objects, you can also drag a selection rectangle around them using the left mouse button. Be careful not to click a graphic when you start dragging the rectangle. All the graphic objects inside the rectangle will be selected.
*To extend the selection when one object is already selected (multiple selection), Shift-click the next object you want to select. As long as you hold down the Shift key, each click a graphic switches it between selected and deselected.
To access selected graphics, call the method getSelectedGraphics of the class IlvHierarchyChart.
Moving activity and reservation graphics
You can move selected activity graphics or reservation graphics by dragging the mouse.
Activity graphic move interactor
When you begin dragging a selected graphic, the Gantt selection interactor calls the method getMoveSelectionInteractor of the class IlvGanttSelectInteractor to create a move interactor as an instance of the class IlvActivityGraphicMoveInteractor. The new move interactor is then attached to the Gantt sheet and becomes active. Note that the shape of the move cursor changes.
The move interactor will be detached from the Gantt sheet when you release the mouse button.
NOTE Constraint graphics cannot be moved in any direction.
Moving activity graphics
In a Gantt chart, activity graphics can only be moved horizontally. This means that you cannot move an activity graphic from one row to another.
The following figure shows how to move a selected activity graphic.
Moving reservation graphics
In a Schedule chart, reservation graphics can be moved horizontally or vertically.
*Moving a reservation graphic horizontally changes the start time and end time of the associated activity.
*Moving a reservation graphic vertically—that is, from one row to another—means dissociating the selected reservation from its current resource and assigning it to a new resource.
Duplicating reservation graphics
In a Schedule chart, you can duplicate reservation graphics.
To duplicate reservation graphics:
*Press ALT and drag the selected reservation graphic.
The mouse cursor turns into a hand and a copy of the selected reservation graphic is created when you release the mouse button.
The following figure shows the duplication of a reservation graphic.
*
TIP To cancel duplication while you are dragging the mouse, press ESCAPE.
Resizing activity and reservation graphics
A selected activity or reservation graphic is marked by two handles.
To resize a graphic:
1. Selected the graphic to resize.
2. Dragging any of the handles to the left or to the right to make the bar longer or shorter.
In doing so, you change the start time and/or end time of the associated activity.
The following figure show a selected activity graphic being resized.
3.

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.