com.dlsc.flexgantt.model.calendar
Interface ICalendarModel<T,S>

Type Parameters:
S - the type of the calendar entries
T - the type of the hierarchy nodes
All Known Implementing Classes:
AbstractCalendarModel, AbstractEntryCalendarModel, TimeGranularityCalendarModel

public interface ICalendarModel<T,S>

A calendar model definition that can be used by the Gantt chart to visualize weekends, holidays, or any other special day based on the result of an on-the-fly computation. Objects returned by the model are often not explicitly added to the model first but computed on demand instead. Implementations of this interface have to make sure that they perform well.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
 void addCalendarListener(ICalendarModelListener l)
          Adds a calendar listener to the calendar model.
 java.util.Iterator<S> getCalendarEntries(IDatelineModel model, ITimeSpan span)
          Returns an iterator for iterating over all calendar entries within the given time span.
 java.util.Iterator<S> getCalendarEntries(IDatelineModel model, T node, ITimeSpan span)
          Returns an iterator for iterating over all calendar entries of the given node within the given time span.
 ITimeSpan getCalendarEntryTimeSpan(S entry)
          Returns the time span allocated to a calendar entry.
 void removeCalendarListener(ICalendarModelListener l)
          Removes the given calendar listener from the calendar model.
 

Method Detail

getCalendarEntries

java.util.Iterator<S> getCalendarEntries(IDatelineModel model,
                                         ITimeSpan span)
Returns an iterator for iterating over all calendar entries within the given time span. The currently used dateline model gets also passed to this method as computations performed in this method are often dependent on it. Calendar entries returned by this method have a global character and are valid for the entire chart (for example weekend days or company holidays).

Parameters:
model - the currently used dateline model
span - the time span for which to return calendar entries
Returns:
an iterator over all calendar entries within the given time span
Since:
1.0

getCalendarEntries

java.util.Iterator<S> getCalendarEntries(IDatelineModel model,
                                         T node,
                                         ITimeSpan span)
Returns an iterator for iterating over all calendar entries of the given node within the given time span. The currently used dateline model gets also passed to this method as computations performed in this method are often dependent on it. Calendar entries returned by this method are only relevant for the given node (example: a resource node might have entries indicating scheduled down time). This method should never return entries that are already returned by the more generic / global method getCalendarEntries(IDatelineModel, ITimeSpan).

Parameters:
model - the currently used dateline model
node - the tree node / Gantt chart node for which to return calendar entries
span - the time span for which to return calendar entries
Returns:
an iterator over all calendar entries within the given time span
Since:
1.0

getCalendarEntryTimeSpan

ITimeSpan getCalendarEntryTimeSpan(S entry)
Returns the time span allocated to a calendar entry.

Parameters:
entry - the entry for which to return a time span
Returns:
the calendar entry's time span allocation
Since:
1.0

addCalendarListener

void addCalendarListener(ICalendarModelListener l)
Adds a calendar listener to the calendar model. The listener will be informed whenever the calendar changes.

Parameters:
l - the listener that will be added to the calendar's event listener list
Since:
1.0

removeCalendarListener

void removeCalendarListener(ICalendarModelListener l)
Removes the given calendar listener from the calendar model.

Parameters:
l - the listener that will be removed from the calendar's event listener list
Since:
1.0