com.dlsc.flexgantt.policy.layer
Class DefaultLabelPolicy

java.lang.Object
  extended by com.dlsc.flexgantt.policy.AbstractPolicy
      extended by com.dlsc.flexgantt.policy.layer.DefaultLabelPolicy
All Implemented Interfaces:
IPolicy, ILabelPolicy

public class DefaultLabelPolicy
extends AbstractPolicy
implements ILabelPolicy

The default implmementation of the label policy. For a general description of this policy please refer to the policy interface ILabelPolicy.

Since:
1.0
Author:
Dirk Lemmermann

Constructor Summary
DefaultLabelPolicy()
           
 
Method Summary
 java.text.DateFormat getDateFormatter()
          Returns the date formatter object that gets used by the policy to convert time points (millis) to strings.
 java.lang.String getLabel(IRelationship relationship, IGanttChartModel model)
          Returns a label for the given relationship object (usually a summary of the relationship meaning).
 java.lang.String getLabel(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model, LabelType type)
          Returns various types of labels for a given timeline object.
 boolean isLabelTypeVisible(java.lang.Object node, java.lang.Object timelineObject, IGanttChartModel model, LabelType type)
          Determines whether or not a certain type of label will be shown for the given timeline object or not.
 void setDateFormatter(java.text.DateFormat format)
          Sets the date formatter object that gets used by the policy to convert time points (millis) to strings.
 
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

DefaultLabelPolicy

public DefaultLabelPolicy()
Method Detail

isLabelTypeVisible

public boolean isLabelTypeVisible(java.lang.Object node,
                                  java.lang.Object timelineObject,
                                  IGanttChartModel model,
                                  LabelType type)
Description copied from interface: ILabelPolicy
Determines whether or not a certain type of label will be shown for the given timeline object or not.

Specified by:
isLabelTypeVisible in interface ILabelPolicy
Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object for which the check gets performed
model - the data source that returned the node and timeline object
type - the type of the label (name, tooltip, description, etc...)
Returns:
TRUE if the label should be shown
See Also:
ILabelPolicy.getLabel(Object, Object, IGanttChartModel, LabelType)

getLabel

public java.lang.String getLabel(java.lang.Object node,
                                 java.lang.Object timelineObject,
                                 IGanttChartModel model,
                                 LabelType type)
Description copied from interface: ILabelPolicy
Returns various types of labels for a given timeline object.

Specified by:
getLabel in interface ILabelPolicy
Parameters:
node - the tree node that owns the timeline object
timelineObject - the timeline object for which a label gets requested
model - the data source that returned the node and timeline object
type - the type of the label (name, tooltip, description, etc...)
Returns:
a label for the given timeline object and label type
See Also:
ILabelPolicy.isLabelTypeVisible(Object, Object, IGanttChartModel, LabelType)

getLabel

public java.lang.String getLabel(IRelationship relationship,
                                 IGanttChartModel model)
Description copied from interface: ILabelPolicy
Returns a label for the given relationship object (usually a summary of the relationship meaning).

Specified by:
getLabel in interface ILabelPolicy
Parameters:
relationship - the relationship for which a label gets requested
model - the data source that returned the relationship object
Returns:
a label for the given relationship

getDateFormatter

public java.text.DateFormat getDateFormatter()
Returns the date formatter object that gets used by the policy to convert time points (millis) to strings.

Returns:
the date formatter object
Since:
1.0

setDateFormatter

public void setDateFormatter(java.text.DateFormat format)
Sets the date formatter object that gets used by the policy to convert time points (millis) to strings.

Parameters:
format - the date formatter object to use
Since:
1.0