com.dlsc.flexgantt.model.gantt
Interface ITimelineObject

All Superinterfaces:
java.lang.Comparable<ITimelineObject>, IPropertiesOwner
All Known Subinterfaces:
IActivityObject, ICapacityObject, IEventlineObject
All Known Implementing Classes:
DefaultActivityObject, DefaultCapacityObject, DefaultEventlineObject, DefaultEventObject, DefaultTimelineObject

public interface ITimelineObject
extends IPropertiesOwner, java.lang.Comparable<ITimelineObject>

An interface for objects that can be placed on a timeline. The interface is being used in combination with the DefaultGanttChartModel and various default policy implementations. The model and the policies delegate many of their calls to the timeline object.

Since:
1.0
Author:
Dirk Lemmermann

Method Summary
<T extends ITimelineObject>
java.util.Iterator<T>
getChildren()
          Returns an iterator over all children timeline objects of this timeline object.
 int getDragActions()
          Returns the drag actions that can be performed on the timeline object.
 java.lang.String getLabel(LabelType type)
          Returns labels for various purposes depending on the given label type identifier.
 int getLineIndex()
          Returns the index of the line on which the timeline object is placed.
 java.lang.Object getPopupObject(boolean extended)
          Returns the object for the popup window.
 java.lang.Object getStatus()
          Returns a status object that can be used by the OverviewPalette to color the timeline objects in different colors based on some application specific information.
 ITimeSpan getTimeSpan()
          Returns the time allocation of the timeline object.
 boolean isDeletable()
          Determines whether the timeline object can be deleted or not.
 boolean isDurationChangeable()
          Returns TRUE if the duration of the object can be modified.
 boolean isInPlaceEditable()
          Returns TRUE if the object can be edited via a timeline object editor.
 boolean isParent()
          Determines whether the timeline object is a parent timeline object.
 boolean isSelectable()
          Returns TRUE if the timeline object can be selected.
 boolean isStartTimeChangeable()
          Returns TRUE if the start time of the object can be modified.
 void setTimeSpan(ITimeSpan span)
          Sets the time allocation of the timeline object.
 
Methods inherited from interface com.dlsc.flexgantt.model.IPropertiesOwner
getProperty, setProperty
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getLabel

java.lang.String getLabel(LabelType type)
Returns labels for various purposes depending on the given label type identifier.

Parameters:
type - the type of label requested
Returns:
a label for the given purpose
Since:
1.0
See Also:
ILabelPolicy.getLabel(Object, Object, IGanttChartModel, LabelType)

getPopupObject

java.lang.Object getPopupObject(boolean extended)
Returns the object for the popup window.

Parameters:
extended - a flag that signals whether the user wants to see the standard popup information or the extended version
Returns:
a title text for the poup
Since:
1.0
See Also:
PopupLayer, IPopupRenderer, DefaultPopupRenderer, IPopupPolicy.getPopupValue(Object, Object, IGanttChartModel, boolean)

isDeletable

boolean isDeletable()
Determines whether the timeline object can be deleted or not.

Returns:
TRUE if the object can be deleted
Since:
1.0
See Also:
IEditTimelineObjectPolicy.isDeletable(Object, Object, IGanttChartModel)

getTimeSpan

ITimeSpan getTimeSpan()
Returns the time allocation of the timeline object.

Returns:
the timeline's object time span
Since:
1.0
See Also:
setTimeSpan(ITimeSpan)

setTimeSpan

void setTimeSpan(ITimeSpan span)
Sets the time allocation of the timeline object.

Parameters:
span - the object's time allocation
Since:
1.0
See Also:
getTimeSpan()

isInPlaceEditable

boolean isInPlaceEditable()
Returns TRUE if the object can be edited via a timeline object editor.

Returns:
TRUE if the object can be edited
Since:
1.0
See Also:
IEditTimelineObjectPolicy.isInPlaceEditable(Object, Object, IGanttChartModel), ITimelineObjectEditor

isStartTimeChangeable

boolean isStartTimeChangeable()
Returns TRUE if the start time of the object can be modified.

Returns:
TRUE if the object can be modified
Since:
1.0
See Also:
IEditTimelineObjectPolicy.isStartTimeChangeable(Object, Object, IGanttChartModel)

isDurationChangeable

boolean isDurationChangeable()
Returns TRUE if the duration of the object can be modified.

Returns:
TRUE if the object can be modified
Since:
1.0
See Also:
IEditTimelineObjectPolicy.isDurationChangeable(Object, Object, IGanttChartModel)

getDragActions

int getDragActions()
Returns the drag actions that can be performed on the timeline object. Timeline objects can either be moved or copied or both. The desired behaviour can be specified by using the constants defined in DnDConstants. Possible values are: Declaring the drag actions is only half of the work needed for correct drag and drop behaviour. A timeline object might be draggable but it also needs a place where it can be dropped. The drop places are defined by IGanttChartNode.getDropActions(Object, long).

Returns:
the supported drag actions (move, copy, or both)
Since:
1.0
See Also:
DefaultDragAndDropCommand, IDragAndDropPolicy.getDragActions(Object, Object, IGanttChartModel)

isSelectable

boolean isSelectable()
Returns TRUE if the timeline object can be selected.

Returns:
TRUE if the timeline object can be selected
Since:
1.0
See Also:
ISelectionPolicy.isSelectable(Object, Object, IGanttChartModel)

getLineIndex

int getLineIndex()
Returns the index of the line on which the timeline object is placed. The return value will only be considered if the Gantt chart node on which the timeline object is placed supports (inner / nested) lines. A return value of -1 indicates that the timeline object is not placed on a line but on the entire row instead (uses the entire row height).

Returns:
the index of the line on which the timeline object gets displayed (-1 if entire row height shall be used)
Since:
1.0
See Also:
IGanttChartNode.getLineCount()

getStatus

java.lang.Object getStatus()
Returns a status object that can be used by the OverviewPalette to color the timeline objects in different colors based on some application specific information.

Returns:
an application specific status object
Since:
1.0

isParent

boolean isParent()
Determines whether the timeline object is a parent timeline object. A parent timeline object is associated with a list of children timeline objects. The time span of a parent is based on the overall time span of all of its children. Parent timeline objects often get visualized differently than their children.

Returns:
TRUE if the timeline object is a parent / contains children timeline objects
Since:
1.0
See Also:
getChildren()

getChildren

<T extends ITimelineObject> java.util.Iterator<T> getChildren()
Returns an iterator over all children timeline objects of this timeline object. This method will only get called on those timeline objects that are parent timeline objects. It is used to calculate the overall time span used by the parent.

Type Parameters:
T -
Returns:
an iterator over all children timeline objects
Since:
1.0
See Also:
isParent()