Restrict the activity displacement/resize to a certain threshold to create a "snap" effect

Article ID: 2383
Last updated: 29 May, 2018
Article ID: 2383
Last updated: 29 May, 2018
Revision: 3
Views: 585
Posted: 13 Jul, 2007
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to restrict the activity displacement or resize to a certain threshold to create a "snap" effect?

Answer

There are two possible approaches:

  1. Using custom model classes

    This approach consists of subclassing the activity implementation and overriding the setTimeInterval method, where one would enforce the threshold at hand.

    Here is a sample that demonstrates this approach.

  2. Using listeners

    This approach consists of using an ActivityListener that would be installed in the IlvGanttModel and would override the new time interval of the ActivityTimeIntervalEvent to enforce the specified threshold.

    Here is a sample that demonstrates this approach.

The second approach (using ActivityListener) is the recommended one. This approach is also illustrated in the Vacation Activities sample in the product distribution (check the implementation of the method VacationSample.createGanttModel() for more information).

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2383
Last updated: 29 May, 2018
Revision: 3
Views: 585
Posted: 13 Jul, 2007 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category