com.dlsc.flexgantt.model.gantt
Class DefaultActivityObject<T>

java.lang.Object
  extended by com.dlsc.flexgantt.model.AbstractPropertiesOwner
      extended by com.dlsc.flexgantt.model.gantt.DefaultTimelineObject<T>
          extended by com.dlsc.flexgantt.model.gantt.DefaultActivityObject<T>
Type Parameters:
T - the type of the wrapped user object
All Implemented Interfaces:
IActivityObject, ITimelineObject, IPropertiesOwner, java.lang.Comparable<ITimelineObject>

public class DefaultActivityObject<T>
extends DefaultTimelineObject<T>
implements IActivityObject

An activity object is a timeline object that represents a person's or a machine's work over a specified time span where the work is more or less complete. The completeness gets expressed by a percentage number.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
IEditActivityObjectPolicy

Constructor Summary
DefaultActivityObject()
          Constructs a new activity object with an undefined time span, no name and an initial work complete percentage of zero.
DefaultActivityObject(double percentageComplete)
          Constructs a new activity object with an undefined time span.
DefaultActivityObject(ITimeSpan timeSpan)
          Constructs a new activity object.
DefaultActivityObject(ITimeSpan timeSpan, double percentageComplete)
          Constructs a new activity object.
DefaultActivityObject(java.lang.String name)
          Constructs a new activity object with an undefined time span and a percentage complete value of zero.
DefaultActivityObject(java.lang.String name, double percentageComplete)
          Constructs a new activity object with an undefined time span.
DefaultActivityObject(java.lang.String name, ITimeSpan timeSpan)
          Constructs a new activity object.
DefaultActivityObject(java.lang.String name, ITimeSpan timeSpan, double percentageComplete)
          Constructs a new activity object.
 
Method Summary
 double getPercentageComplete()
          Returns the percentage complete value of the activity.
 boolean isPercentageChangeable()
          Returns TRUE if the percentage complete value can be edited.
 void setPercentageChangeable(boolean changeable)
          Specifies whether or not the user will be allowed to interactively edit the percentage complete value.
 void setPercentageComplete(double p)
          Changes the percentage complete value of the activity.
 
Methods inherited from class com.dlsc.flexgantt.model.gantt.DefaultTimelineObject
addChild, compareTo, getChildren, getDragActions, getLabel, getLineIndex, getPopupObject, getStatus, getTimeSpan, getUserObject, isDeletable, isDurationChangeable, isInPlaceEditable, isParent, isSelectable, isStartTimeChangeable, removeChild, setChildren, setChildren, setDeletable, setDragActions, setDurationChangeable, setInPlaceEditable, setLabel, setLineIndex, setPopupObject, setSelectable, setStartTimeChangeable, setStatus, setTimeSpan, setUserObject, toString
 
Methods inherited from class com.dlsc.flexgantt.model.AbstractPropertiesOwner
getProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.dlsc.flexgantt.model.gantt.ITimelineObject
getChildren, getDragActions, getLabel, getLineIndex, getPopupObject, getStatus, getTimeSpan, isDeletable, isDurationChangeable, isInPlaceEditable, isParent, isSelectable, isStartTimeChangeable, setTimeSpan
 
Methods inherited from interface com.dlsc.flexgantt.model.IPropertiesOwner
getProperty, setProperty
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

DefaultActivityObject

public DefaultActivityObject(java.lang.String name,
                             ITimeSpan timeSpan,
                             double percentageComplete)
Constructs a new activity object.

Parameters:
name - the name of the activity
timeSpan - the time span occupied by the activity
percentageComplete - the completeness expressed as a percentage value
Since:
1.0

DefaultActivityObject

public DefaultActivityObject(java.lang.String name,
                             ITimeSpan timeSpan)
Constructs a new activity object. The initial percentage complete value is zero.

Parameters:
name - the name of the activity
timeSpan - the time span occupied by the activity
Since:
1.0

DefaultActivityObject

public DefaultActivityObject(java.lang.String name,
                             double percentageComplete)
Constructs a new activity object with an undefined time span.

Parameters:
name - the name of the activity
percentageComplete - the completeness expressed as a percentage value
Since:
1.0
See Also:
TimeSpan.UNDEFINED

DefaultActivityObject

public DefaultActivityObject(java.lang.String name)
Constructs a new activity object with an undefined time span and a percentage complete value of zero.

Parameters:
name - the name of the activity
Since:
1.0
See Also:
TimeSpan.UNDEFINED

DefaultActivityObject

public DefaultActivityObject(ITimeSpan timeSpan,
                             double percentageComplete)
Constructs a new activity object.

Parameters:
timeSpan - the time span occupied by the activity
percentageComplete - the amount of work completed
Since:
1.0

DefaultActivityObject

public DefaultActivityObject(ITimeSpan timeSpan)
Constructs a new activity object.

Parameters:
timeSpan - the time span occupied by the activity
Since:
1.0

DefaultActivityObject

public DefaultActivityObject(double percentageComplete)
Constructs a new activity object with an undefined time span.

Parameters:
percentageComplete - the amount of work completed
Since:
1.0
See Also:
TimeSpan.UNDEFINED

DefaultActivityObject

public DefaultActivityObject()
Constructs a new activity object with an undefined time span, no name and an initial work complete percentage of zero.

Since:
1.0
See Also:
TimeSpan.UNDEFINED
Method Detail

getPercentageComplete

public double getPercentageComplete()
Description copied from interface: IActivityObject
Returns the percentage complete value of the activity. The value must be between 0 and 100.

Specified by:
getPercentageComplete in interface IActivityObject
Returns:
the object's percentage complete value
See Also:
IActivityObject.setPercentageComplete(double)

setPercentageComplete

public void setPercentageComplete(double p)
Description copied from interface: IActivityObject
Changes the percentage complete value of the activity. The value must be between 0 and 100.

Specified by:
setPercentageComplete in interface IActivityObject
Parameters:
p - the new percnetage complete value
See Also:
IActivityObject.getPercentageComplete()

setPercentageChangeable

public void setPercentageChangeable(boolean changeable)
Specifies whether or not the user will be allowed to interactively edit the percentage complete value.

Parameters:
changeable - if TRUE the user can edit the percentage complete
Since:
1.0

isPercentageChangeable

public boolean isPercentageChangeable()
Description copied from interface: IActivityObject
Returns TRUE if the percentage complete value can be edited.

Specified by:
isPercentageChangeable in interface IActivityObject
Returns:
TRUE if the object's percentage complete value can be edited
See Also:
IEditActivityObjectPolicy.isPercentageChangeable(Object, Object, IGanttChartModel)