ilog.views.gantt.model
Class IlvSimpleActivity

java.lang.Object
  extended by ilog.views.gantt.model.IlvAbstractActivity
      extended by ilog.views.gantt.model.IlvSimpleActivity
All Implemented Interfaces:
IlvActivity, IlvHierarchyNode, Serializable
Direct Known Subclasses:
IlvGeneralActivity, IlvNullActivity

public class IlvSimpleActivity
extends IlvAbstractActivity

IlvSimpleActivity is a relatively simple, memory-based implementation of the IlvActivity interface that can be extended in a straightforward manner for more complex needs. IlvSimpleActivity does not provide any connection to a persistent datastore itself.

Since:
JViews 5.5
See Also:
Serialized Form

Constructor Summary
IlvSimpleActivity(String id, String name, Date start, Date end)
          Creates a new IlvSimpleActivity from the specified ID, name, and time interval.
IlvSimpleActivity(String id, String name, Date start, IlvDuration duration)
          Creates a new IlvSimpleActivity from the specified ID, name, start time, and duration.
IlvSimpleActivity(String id, String name, IlvTimeInterval interval)
          Creates a new IlvSimpleActivity from the specified ID, name, and time interval.
 
Method Summary
protected  IlvTimeInterval computeTimeIntervalFromChildren()
          Calculates this activity's time interval from its children.
 boolean getAutoCalcTimeIntervalFromChildren()
          Returns whether this activity, if it has children, automatically calculates its time interval from its children.
 IlvUnaryPredicate getChildEventFilter()
          Returns a predicate that will be used to determine the events from this activity's children that should be dispatched to this activity's processChildEvent(ilog.views.gantt.event.ActivityEvent) method.
 String getID()
          Returns the ID string of the activity.
 String getName()
          Returns the name of the activity.
 IlvTimeInterval getTimeInterval()
          Returns the time span between the start time and end time of the activity as an interval.
 void processChildEvent(ActivityEvent event)
          This method is invoked by the Gantt data model for any events fired by the children of this activity and for which the predicate returned by getChildEventFilter() evaluates to true.
 void setAutoCalcTimeIntervalFromChildren(boolean flag)
          Sets whether this activity, if it has children, will automatically calculate its time interval from its children.
 void setGanttModelImpl(IlvGanttModel model)
          This method is invoked by IlvGanttModel when the activity is added or removed.
 void setID(String id)
          Sets the ID string of the activity.
 void setName(String name)
          Sets the name of the activity.
 void setTimeInterval(IlvTimeInterval interval)
          Sets the start time and end time of the activity.
 
Methods inherited from class ilog.views.gantt.model.IlvAbstractActivity
fireEvent, fireIDAboutToChange, fireIDChanged, fireNameAboutToChange, fireNameChanged, fireTimeIntervalAboutToChange, fireTimeIntervalChanged, getDuration, getEndTime, getGanttModel, getStartTime, paramString, setDuration, setEndTime, setStartTime, setTimeInterval, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlvSimpleActivity

public IlvSimpleActivity(String id,
                         String name,
                         IlvTimeInterval interval)
Creates a new IlvSimpleActivity from the specified ID, name, and time interval.


IlvSimpleActivity

public IlvSimpleActivity(String id,
                         String name,
                         Date start,
                         Date end)
Creates a new IlvSimpleActivity from the specified ID, name, and time interval.


IlvSimpleActivity

public IlvSimpleActivity(String id,
                         String name,
                         Date start,
                         IlvDuration duration)
Creates a new IlvSimpleActivity from the specified ID, name, start time, and duration.

Method Detail

getID

public String getID()
Returns the ID string of the activity.

Returns:
The activity ID.

setID

public void setID(String id)
Sets the ID string of the activity.

Parameters:
id - The activity's ID string.

getName

public String getName()
Returns the name of the activity.

Returns:
The activity name.

setName

public void setName(String name)
Sets the name of the activity.

Parameters:
name - A descriptive name for this activity.

getTimeInterval

public IlvTimeInterval getTimeInterval()
Returns the time span between the start time and end time of the activity as an interval.

Returns:
The activity time interval.

setTimeInterval

public void setTimeInterval(IlvTimeInterval interval)
Sets the start time and end time of the activity.

Parameters:
interval - The start and end times.

getAutoCalcTimeIntervalFromChildren

public boolean getAutoCalcTimeIntervalFromChildren()
Returns whether this activity, if it has children, automatically calculates its time interval from its children.


setAutoCalcTimeIntervalFromChildren

public void setAutoCalcTimeIntervalFromChildren(boolean flag)
Sets whether this activity, if it has children, will automatically calculate its time interval from its children.


computeTimeIntervalFromChildren

protected IlvTimeInterval computeTimeIntervalFromChildren()
Calculates this activity's time interval from its children.

Returns:
The computed time interval.
Since:
JViews 8.1

getChildEventFilter

public IlvUnaryPredicate getChildEventFilter()
Returns a predicate that will be used to determine the events from this activity's children that should be dispatched to this activity's processChildEvent(ilog.views.gantt.event.ActivityEvent) method. The Gantt data model applies the predicate to all ActivityEvent events fired by the children of this activity. If the predicate evaluates to true, then the Gantt data model dispatches the child's event to the processChildEvent() method. This allows you to easily implement a parent activity property that is automatically computed from one or more properties of its children.

If this activity automatically calculates its time interval from its children, then a predicate that asks to receive ActivityTimeIntervalEvents from this activity's children is returned. Otherwise, a predicate that always evaluates to false is returned.

Specified by:
getChildEventFilter in interface IlvActivity
Overrides:
getChildEventFilter in class IlvAbstractActivity
Returns:
The predicate used to filter events from the activity's children.

processChildEvent

public void processChildEvent(ActivityEvent event)
This method is invoked by the Gantt data model for any events fired by the children of this activity and for which the predicate returned by getChildEventFilter() evaluates to true. This allows you to easily implement a parent activity property that is automatically computed from one or more properties of its children.

Specified by:
processChildEvent in interface IlvActivity
Overrides:
processChildEvent in class IlvAbstractActivity
Parameters:
event - The child activity event.

setGanttModelImpl

public void setGanttModelImpl(IlvGanttModel model)
This method is invoked by IlvGanttModel when the activity is added or removed.

Warning: This method is considered to be part of an IlvActivity's internal implementation and is not a public API. You should only invoke this method directly if you have created your own IlvGanttModel implementation.

Specified by:
setGanttModelImpl in interface IlvActivity
Overrides:
setGanttModelImpl in class IlvAbstractActivity
Parameters:
model - The data model that this activity has been added to, or null if this activity has been removed from the data model.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.