com.dlsc.flexgantt.policy.layer
Class TimeGranularityDragInfoPolicy

java.lang.Object
  extended by com.dlsc.flexgantt.policy.AbstractPolicy
      extended by com.dlsc.flexgantt.policy.layer.DefaultDragInfoPolicy
          extended by com.dlsc.flexgantt.policy.layer.TimeGranularityDragInfoPolicy
All Implemented Interfaces:
IPolicy, IDragInfoPolicy

public class TimeGranularityDragInfoPolicy
extends DefaultDragInfoPolicy

A drag info policy that is being used when the currently used dateline model is an instance of TimeGranularityDatelineModel.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
TimeGranularityDragInfoPolicy()
           
 
Method Summary
 java.text.DateFormat getDateFormat()
          Returns the date formatting object used by the policy to create nicely formatted date strings for the date info.
 java.lang.Object getDragInfo(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model, java.lang.Object dropNode, ITimeSpan dropSpan)
          Returns an object that can be used to show information during a drag operation (e.g. time span over which the dragged timeline object hovers).
 void setDateFormat(java.text.DateFormat format)
          Sets the date formatting object used by the policy to create nicely formatted date strings for the date info.
 
Methods inherited from class com.dlsc.flexgantt.policy.layer.DefaultDragInfoPolicy
getCapacityFormatter, getDragInfo, getDragInfo, getPercentageFormatter, setCapacityFormatter, setPercentageFormatter
 
Methods inherited from class com.dlsc.flexgantt.policy.AbstractPolicy
assertClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeGranularityDragInfoPolicy

public TimeGranularityDragInfoPolicy()
Method Detail

getDragInfo

public java.lang.Object getDragInfo(java.lang.Object node,
                                    java.lang.Object timelineObject,
                                    IGanttChartModel model,
                                    java.lang.Object dropNode,
                                    ITimeSpan dropSpan)
Description copied from interface: IDragInfoPolicy
Returns an object that can be used to show information during a drag operation (e.g. time span over which the dragged timeline object hovers). The default implementation returns the timeline object itself.

Specified by:
getDragInfo in interface IDragInfoPolicy
Overrides:
getDragInfo in class DefaultDragInfoPolicy
Parameters:
node - the tree node that owns the timeline object
timelineObject - the dragged object
model - the model to which the dragged timeline object belongs
dropNode - the tree node over which the dragged object hovers
dropSpan - the span over which the dragged object hovers
Returns:
an arbitrary object that can contain information relevant for a drag info renderer

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the date formatting object used by the policy to create nicely formatted date strings for the date info.

Returns:
the date formatter used by the policy
Since:
1.0

setDateFormat

public void setDateFormat(java.text.DateFormat format)
Sets the date formatting object used by the policy to create nicely formatted date strings for the date info.

Parameters:
format - the date formatter used by the policy
Since:
1.0