com.dlsc.flexgantt.model.gantt
Class DefaultCapacityObject<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.DefaultCapacityObject<T>
Type Parameters:
T - the type of the wrapped user / business object
All Implemented Interfaces:
ICapacityObject, ITimelineObject, IPropertiesOwner, java.lang.Comparable<ITimelineObject>

public class DefaultCapacityObject<T>
extends DefaultTimelineObject<T>
implements ICapacityObject

A capacity object is a timeline object that provides additional information about the usage of a resource during a specified time interval. Capacity objects can be edited so that the capacity that they represent becomes larger or smaller. Capacity objects, just like other timeline objects, wrap so-called user or business objects. Capacity objects are the graphical representation of these user / business objects.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
DefaultCapacityObject()
          Constructs a new capacity object.
DefaultCapacityObject(double capacityUsed)
          Constructs a new capacity object.
DefaultCapacityObject(ITimeSpan timeSpan)
          Constructs a new capacity object.
DefaultCapacityObject(ITimeSpan timeSpan, double capacityUsed)
          Constructs a new capacity object.
DefaultCapacityObject(java.lang.String name)
          Constructs a new capacity object.
DefaultCapacityObject(java.lang.String name, double capacityUsed)
          Constructs a new capacity object.
DefaultCapacityObject(java.lang.String name, ITimeSpan timeSpan)
          Constructs a new capacity object.
DefaultCapacityObject(java.lang.String name, ITimeSpan timeSpan, double capacityUsed)
          Constructs a new capacity object.
 
Method Summary
 double getCapacityUsed()
          Returns the used capacity of the object.
 boolean isCapacityChangeable()
          Returns TRUE if the capacity used value can be edited.
 void setCapacityChangeable(boolean changeable)
          Specifies whether or not the capacity represented by the object can be interactively edited by the user.
 void setCapacityUsed(double c)
          Changes the capacity used by the object.
 
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

DefaultCapacityObject

public DefaultCapacityObject(java.lang.String name,
                             ITimeSpan timeSpan,
                             double capacityUsed)
Constructs a new capacity object.

Parameters:
name - the name of the capacity object gets used in various places in the user interface (e.g. tooltip, status bar)
timeSpan - the time interval occupied by the capacity object
capacityUsed - the used capacity represented by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(java.lang.String name,
                             ITimeSpan timeSpan)
Constructs a new capacity object. The initial value of the capacity used is zero.

Parameters:
name - the name of the capacity object gets used in various places in the user interface (e.g. tooltip, status bar)
timeSpan - the time interval occupied by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(java.lang.String name,
                             double capacityUsed)
Constructs a new capacity object. The object's time span gets initialized to TimeSpan.UNDEFINED.

Parameters:
name - the name of the capacity object gets used in various places in the user interface (e.g. tooltip, status bar)
capacityUsed - the used capacity represented by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(java.lang.String name)
Constructs a new capacity object. The object's time span gets initialized to TimeSpan.UNDEFINED and its capacity used value equals zero.

Parameters:
name - the name of the capacity object gets used in various places in the user interface (e.g. tooltip, status bar)
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(ITimeSpan timeSpan,
                             double capacityUsed)
Constructs a new capacity object.

Parameters:
timeSpan - the time interval occupied by the capacity object
capacityUsed - the used capacity represented by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(ITimeSpan timeSpan)
Constructs a new capacity object. The object's initial capacity used value equals zero.

Parameters:
timeSpan - the time interval occupied by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject(double capacityUsed)
Constructs a new capacity object. The object's time span gets initialized to TimeSpan.UNDEFINED

Parameters:
capacityUsed - the used capacity represented by the capacity object
Since:
1.0

DefaultCapacityObject

public DefaultCapacityObject()
Constructs a new capacity object.

Since:
1.0
Method Detail

getCapacityUsed

public double getCapacityUsed()
Description copied from interface: ICapacityObject
Returns the used capacity of the object.

Specified by:
getCapacityUsed in interface ICapacityObject
Returns:
the used capacity of the object
See Also:
ICapacityObject.setCapacityUsed(double)

setCapacityUsed

public void setCapacityUsed(double c)
Description copied from interface: ICapacityObject
Changes the capacity used by the object.

Specified by:
setCapacityUsed in interface ICapacityObject
Parameters:
c - the new capacity usage of the object
See Also:
ICapacityObject.getCapacityUsed()

setCapacityChangeable

public void setCapacityChangeable(boolean changeable)
Specifies whether or not the capacity represented by the object can be interactively edited by the user.

Parameters:
changeable - if TRUE the capacity can be edited
Since:
1.0
See Also:
IEditCapacityObjectPolicy.isCapacityChangeable(Object, Object, IGanttChartModel)

isCapacityChangeable

public boolean isCapacityChangeable()
Description copied from interface: ICapacityObject
Returns TRUE if the capacity used value can be edited.

Specified by:
isCapacityChangeable in interface ICapacityObject
Returns:
TRUE if the object's capacity used value can be edited
See Also:
IEditCapacityObjectPolicy.isCapacityChangeable(Object, Object, IGanttChartModel)