|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.dlsc.flexgantt.model.AbstractPropertiesOwner com.dlsc.flexgantt.model.gantt.DefaultTimelineObject<T>
T
- the type of the user / business object wrapped by the timeline
objectpublic class DefaultTimelineObject<T>
The default implementation of the ITimelineObject
interface. This
class provides all the information that is required to visualize the usage of
a time span via a horizontal bar. The object can be decorated with a label
and additional information about the object can be displayed in a popup /
annotation window. Most decisions made by policies are based on information
provided by this class.
DefaultTimelineObjectRenderer
,
DefaultTimelineObjectEditor
Constructor Summary | |
---|---|
DefaultTimelineObject()
Constructs a new timeline object with an undefined time span. |
|
DefaultTimelineObject(ITimeSpan timeSpan)
Constructs a new timeline object. |
|
DefaultTimelineObject(java.lang.String name)
Constructs a new timeline object with an undefined time span. |
|
DefaultTimelineObject(java.lang.String name,
ITimeSpan timeSpan)
Constructs a new timeline object. |
Method Summary | |
---|---|
void |
addChild(ITimelineObject child)
Adds another timeline object as a child to this timeline object. |
int |
compareTo(ITimelineObject tlo)
|
java.util.Iterator<ITimelineObject> |
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 object's line index. |
java.lang.Object |
getPopupObject(boolean extended)
Returns the object for the popup window. |
java.lang.Object |
getStatus()
Returns an object that represents some kind of status that the timeline object is in. |
ITimeSpan |
getTimeSpan()
Returns the time allocation of the timeline object. |
T |
getUserObject()
Returns the user object wrapped by 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 |
removeChild(ITimelineObject child)
Removes the given timeline object from the list of children of this timeline object. |
void |
setChildren(java.util.Collection<ITimelineObject> children)
Sets the given timeline objects as the children of this timeline object. |
void |
setChildren(ITimelineObject... children)
Sets the given timeline objects as the children of this timeline object. |
void |
setDeletable(boolean deletable)
Specifies whether the timeline object can be deleted by the user or not. |
void |
setDragActions(int actions)
Specifies the drag actions that can be performed on the timeline object. |
void |
setDurationChangeable(boolean changeable)
Determines whether or not the duration of the timeline object can be edited by the user. |
void |
setInPlaceEditable(boolean editable)
Specifies whether or not the timeline object can be edited with the help of an ITimelineObjectEditor instance. |
void |
setLabel(java.lang.String label,
LabelType type)
Sets a new label for the given label type. |
void |
setLineIndex(int index)
Specifies a line index. |
void |
setPopupObject(java.lang.Object object,
boolean extended)
Sets an object on the timeline object that will be used as input for the popup renderer. |
void |
setSelectable(boolean b)
Specifies whether the timeline object can be selected. |
void |
setStartTimeChangeable(boolean changeable)
Determines whether or not the start time of the timeline object can be edited by the user. |
void |
setStatus(java.lang.Object status)
Sets an object that represents some kind of status that the timeline object is in. |
void |
setTimeSpan(ITimeSpan span)
Sets the time allocation of the timeline object. |
void |
setUserObject(T obj)
Sets the user object on the timeline object. |
java.lang.String |
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.IPropertiesOwner |
---|
getProperty, setProperty |
Constructor Detail |
---|
public DefaultTimelineObject(java.lang.String name, ITimeSpan timeSpan)
name
- the name of the timeline object gets displayed in the status
bar, the tooltip and in the title section of the popup window
(except if separate values for those places have been
specified via the setLabel(String, LabelType)
methodtimeSpan
- the time span that is assigned to the timeline object (may be
undefined, see TimeSpan.UNDEFINED
).public DefaultTimelineObject(java.lang.String name)
name
- the name of the timeline object gets displayed in the status
bar, the tooltip and in the title section of the popup window
(except if separate values for those places have been
specified via the setLabel(String, LabelType)
methodTimeSpan.UNDEFINED
public DefaultTimelineObject(ITimeSpan timeSpan)
timeSpan
- the time span that is assigned to the timeline object (may be
undefined, see TimeSpan.UNDEFINED
).public DefaultTimelineObject()
TimeSpan.UNDEFINED
Method Detail |
---|
public void setUserObject(T obj)
obj
- the user object represented by the timeline objectgetUserObject()
public T getUserObject()
public ITimeSpan getTimeSpan()
ITimelineObject
getTimeSpan
in interface ITimelineObject
ITimelineObject.setTimeSpan(ITimeSpan)
public void setTimeSpan(ITimeSpan span)
ITimelineObject
setTimeSpan
in interface ITimelineObject
span
- the object's time allocationITimelineObject.getTimeSpan()
public int compareTo(ITimelineObject tlo)
compareTo
in interface java.lang.Comparable<ITimelineObject>
public void setLabel(java.lang.String label, LabelType type)
LabelType
enumerator specifies the context in which the label gets used: tooltip,
popup, status bar.
label
- the new label used for the given label typetype
- the label type designating where the label will be usedpublic java.lang.String getLabel(LabelType type)
ITimelineObject
getLabel
in interface ITimelineObject
type
- the type of label requested
ILabelPolicy.getLabel(Object, Object, IGanttChartModel, LabelType)
public boolean isStartTimeChangeable()
ITimelineObject
isStartTimeChangeable
in interface ITimelineObject
IEditTimelineObjectPolicy.isStartTimeChangeable(Object, Object,
IGanttChartModel)
public void setStartTimeChangeable(boolean changeable)
changeable
- if TRUE the start time can be modified interactively by the
userisStartTimeChangeable()
public boolean isDurationChangeable()
ITimelineObject
isDurationChangeable
in interface ITimelineObject
IEditTimelineObjectPolicy.isDurationChangeable(Object, Object,
IGanttChartModel)
public void setDurationChangeable(boolean changeable)
changeable
- if TRUE the duration can be modified interactively by the userisDurationChangeable()
,
IEditTimelineObjectPolicy.isDurationChangeable(Object, Object,
IGanttChartModel)
,
DefaultEditTimelineObjectPolicy
,
DefaultChangeTimelineObjectTimeSpanCommand
public java.lang.Object getPopupObject(boolean extended)
ITimelineObject
getPopupObject
in interface ITimelineObject
extended
- a flag that signals whether the user wants to see the standard
popup information or the extended version
PopupLayer
,
IPopupRenderer
,
DefaultPopupRenderer
,
IPopupPolicy.getPopupValue(Object, Object, IGanttChartModel,
boolean)
public void setPopupObject(java.lang.Object object, boolean extended)
extended
- a flag used to determine if the given object will be used as
for the standard or the extended popupobject
- the popup object that will be visualized by the popup layer
and rendererIPopupRenderer
,
PopupLayer
,
IPopupPolicy
public boolean isSelectable()
ITimelineObject
isSelectable
in interface ITimelineObject
ISelectionPolicy.isSelectable(Object, Object, IGanttChartModel)
public void setSelectable(boolean b)
ITimelineObjectLayerSelectionModel
of the layer
on which they are displayed at the time of their selection.
b
- if TRUE the timeline object can be selected by the userITimelineObjectLayerSelectionModel.isSelected(TimelineObjectPath)
,
ISelectionPolicy.isSelectable(Object, Object, IGanttChartModel)
public boolean isInPlaceEditable()
ITimelineObject
isInPlaceEditable
in interface ITimelineObject
IEditTimelineObjectPolicy.isInPlaceEditable(Object, Object,
IGanttChartModel)
,
ITimelineObjectEditor
public void setInPlaceEditable(boolean editable)
ITimelineObjectEditor
instance. These are user interface
components that are added directly to the layer container so that no
additional dialogs have to be opened.
editable
- if TRUE the timeline object can be edited with an user
interface component directly inside the layer containerLayerContainer.setTimelineObjectEditor(Class, ITimelineObjectEditor)
,
EditingLayer
public void setLineIndex(int index)
index
- the timeline object's line index, use -1 to have the object
not use a line but the hierarchy node's entire row heightgetLineIndex()
,
ILinePolicy.getLineIndex(Object, ITreeTableModel, Object)
,
IGanttChartNode.getLineCount()
,
IGanttChartNode.getLineLocation(int, int)
,
IGanttChartNode.getLineHeight(int, int)
public int getLineIndex()
getLineIndex
in interface ITimelineObject
setLineIndex(int)
,
ILinePolicy.getLineIndex(Object, ITreeTableModel, Object)
,
IGanttChartNode.getLineCount()
,
IGanttChartNode.getLineLocation(int, int)
,
IGanttChartNode.getLineHeight(int, int)
public void setDeletable(boolean deletable)
deletable
- if TRUE the object can be deleted by the userIEditTimelineObjectPolicy.isDeletable(Object, Object,
IGanttChartModel)
public boolean isDeletable()
ITimelineObject
isDeletable
in interface ITimelineObject
IEditTimelineObjectPolicy.isDeletable(Object, Object,
IGanttChartModel)
public java.lang.Object getStatus()
OverviewPalette
for example uses it
to color the timeline objects in different colors depending on their
current status.
getStatus
in interface ITimelineObject
public void setStatus(java.lang.Object status)
OverviewPalette
for example uses it
to color the timeline objects in different colors depending on their
current status.
status
- the application-specific status of the timeline objectpublic java.lang.String toString()
toString
in class java.lang.Object
public void addChild(ITimelineObject child)
child
- the child timeline objectisParent()
public void removeChild(ITimelineObject child)
child
- the child to removeisParent()
public void setChildren(ITimelineObject... children)
children
- the children timeline objectspublic void setChildren(java.util.Collection<ITimelineObject> children)
children
- the children timeline objectspublic boolean isParent()
ITimelineObject
isParent
in interface ITimelineObject
ITimelineObject.getChildren()
public java.util.Iterator<ITimelineObject> getChildren()
ITimelineObject
getChildren
in interface ITimelineObject
ITimelineObject.isParent()
public void setDragActions(int actions)
DnDConstants
. Possible values are:
DnDConstants.ACTION_COPY
DnDConstants.ACTION_MOVE
DnDConstants.ACTION_COPY_OR_MOVE
IGanttChartNode.getDropActions(Object, long)
.
actions
- the supported drag actions (move, copy, or both)DefaultDragAndDropCommand
,
IDragAndDropPolicy.getDragActions(Object, Object, IGanttChartModel)
public int getDragActions()
ITimelineObject
DnDConstants
. Possible values are:
DnDConstants.ACTION_COPY
DnDConstants.ACTION_MOVE
DnDConstants.ACTION_COPY_OR_MOVE
IGanttChartNode.getDropActions(Object, long)
.
getDragActions
in interface ITimelineObject
DefaultDragAndDropCommand
,
IDragAndDropPolicy.getDragActions(Object, Object, IGanttChartModel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |