com.miginfocom.calendar.activity
Class ActivityList

java.lang.Object
  extended by com.miginfocom.util.dates.TimeSpanList
      extended by com.miginfocom.calendar.activity.ActivityList

public class ActivityList
extends TimeSpanList

A list of Activity objects.


Constructor Summary
ActivityList()
           
ActivityList(Activity[] acts)
          Constructor
ActivityList(java.util.Collection c)
          Constructor
ActivityList(int initialCapacity)
           
 
Method Summary
 boolean addMoveDateRanges(int field, int delta, boolean start, boolean end, DateRangeRounder dateRangeRounder)
          Set the date ranges of all date ranges in the list.
 TimeSpanList[] getActivityViewLists(javax.swing.JComponent parent, InteractionListener iListener, DateRangeI withinRange)
          Returns TimeSpanLists containing all views of the activities in this list that is overlapping withinRange divided into layers.
 TimeSpanList[] getActivityViewLists(javax.swing.JComponent parent, InteractionListener iListener, DateRangeI withinRange, Filter filter)
          Returns TimeSpanLists containing all views of the activities in this list that is overlapping withinRange divided into layers.
 TimeSpanList getActivityViews(javax.swing.JComponent parent, InteractionListener iListener, DateRangeI withinRange, Filter filter)
          Returns s TimeSpanList containing all views of the activities in this list that is overlapping withinRange.
 ImmutableDateRange[] getDateRanges()
          Returns an array of all date ranges in the list.
 Activity removeActivityById(java.lang.Object id)
          Remove an activity from the list.
 boolean setDateRanges(ImmutableDateRange[] ranges)
          Set the date ranges of all date ranges in the list.
 
Methods inherited from class com.miginfocom.util.dates.TimeSpanList
add, add, addAll, addAll, addAll, addAll, addTimeSpanListListener, addTimeSpanListListener, clear, cloneList, condense, contains, divideIntoRanges, fireDepositoryListChanged, fireTimeSpanListListener, get, getOverlapCluster, getOverlapCluster, getTotalDateSpan, hasOverlapping, indexOf, isTimeSpanInListOverlapping, remove, remove, removeAll, removeAll, removeAll, removeTimeSpanListListener, set, setIgnoreTimeSpanListChangeEvents, setSize, size, sort, sort, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivityList

public ActivityList()

ActivityList

public ActivityList(int initialCapacity)

ActivityList

public ActivityList(java.util.Collection c)
Constructor

Parameters:
c - Collection of Activity objects.

ActivityList

public ActivityList(Activity[] acts)
Constructor

Parameters:
acts - An array of Activity objects. Not null.
Method Detail

getActivityViewLists

public TimeSpanList[] getActivityViewLists(javax.swing.JComponent parent,
                                           InteractionListener iListener,
                                           DateRangeI withinRange)
Returns TimeSpanLists containing all views of the activities in this list that is overlapping withinRange divided into layers. If an ActivityView has not been created for the component the view will be created and the listener will be attached.

Note that one Activity can have multiple views in one context, if it is recurring.

The activity views are divided into layers and one list for every layer are returned. Layers a sorted so that the lowest level is first in the array.

Parameters:
parent - An object to identify in which context the views are to be returned for. Not null.
iListener - The listener to InteractionEvents. Can be null.
withinRange - All returned views will overlap this date range. Not null.
Returns:
An array of TimeSpanLists containing all views of the acivities in this list divided into layers. Some layers can be empty, but not null.
See Also:
Activity.getLayerIndex()

getActivityViewLists

public TimeSpanList[] getActivityViewLists(javax.swing.JComponent parent,
                                           InteractionListener iListener,
                                           DateRangeI withinRange,
                                           Filter filter)
Returns TimeSpanLists containing all views of the activities in this list that is overlapping withinRange divided into layers. If an ActivityView has not been created for the component the view will be created and the listener will be attached.

Note that one Activity can have multiple views in one context, if it is recurring.

The activity views are divided into layers and one list for every layer are returned. Layers a sorted so that the lowest level is first in the array.

Parameters:
parent - An object to identify in which context the views are to be returned for. Not null.
iListener - The listener to InteractionEvents. Can be null.
withinRange - All returned views will overlap this date range. Not null.
filter - A filter to filter in/out unwanted ActivityViews.
Returns:
An array of TimeSpanLists containing all views of the acivities in this list divided into layers. Some layers can be empty, but not null.
See Also:
Activity.getLayerIndex()

getActivityViews

public TimeSpanList getActivityViews(javax.swing.JComponent parent,
                                     InteractionListener iListener,
                                     DateRangeI withinRange,
                                     Filter filter)
Returns s TimeSpanList containing all views of the activities in this list that is overlapping withinRange. If an ActivityView has not been created for the component the view will be created and the listener will be attached.

Note that one Activity can have multiple views in one context, if it is recurring.

Parameters:
parent - An object to identify in which context the views are to be returned for. Not null.
iListener - The listener to InteractionEvents. Can be null.
withinRange - All returned views will overlap this date range. Not null.
filter - A filter to filter in/out unwanted ActivityViews.
Returns:
A TimeSpanLists containing all views of the acivities in this list.

removeActivityById

public Activity removeActivityById(java.lang.Object id)
Remove an activity from the list.

Parameters:
id - The activity to remove.
Returns:
The removed activity or null if non was found.

getDateRanges

public ImmutableDateRange[] getDateRanges()
Returns an array of all date ranges in the list.

Returns:
An array of all date ranges in the list. Never null.

addMoveDateRanges

public boolean addMoveDateRanges(int field,
                                 int delta,
                                 boolean start,
                                 boolean end,
                                 DateRangeRounder dateRangeRounder)
Set the date ranges of all date ranges in the list. Vetoed sets are silently ignored.

Note that the date ranges will be recreated.

Parameters:
field - see Calendar.add(int, int). E.g. Calendar.HOUR.
delta - see Calendar.add(int, int). E.g. -1.
start - If true the start date will change.
end - If true the end date will change.
dateRangeRounder - The object responsible for snapping/rounding time/date. Can be null.
Returns:
true if all changes was approved. false if one or more wasn't.
See Also:
Activity.setBaseDateRange(com.miginfocom.util.dates.ImmutableDateRange), DateRange.add(int, long, boolean, boolean, com.miginfocom.util.dates.DateRangeRounder)

setDateRanges

public boolean setDateRanges(ImmutableDateRange[] ranges)
Set the date ranges of all date ranges in the list. Vetoed sets are silently ignored.

Parameters:
ranges - An array of all date ranges. not null.
Returns:
true if all changes was approved. false if one or more wasn't.
See Also:
Activity.setBaseDateRange(com.miginfocom.util.dates.ImmutableDateRange)


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.