com.dlsc.flexgantt.policy.layer

## Class DefaultLabelPolicy

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - 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
  Version:
    $Revision: 1.14 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultLabelPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DateFormat` | `getDateFormatter()` Returns the date formatter object that gets used by the policy to convert time points (millis) to strings.
    `String` | `getLabel(IRelationship relationship, IGanttChartModel model, LabelType type)` Returns a label for the given relationship object (usually a summary of the relationship meaning).
    `String` | `getLabel(TimelineObjectPath path, IGanttChartModel model, LabelType type)` Returns various types of labels for a given timeline object.
    `boolean` | `isLabelTypeVisible(TimelineObjectPath path, 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(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(TimelineObjectPath path,
                                            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:
        `path` - the path to 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(TimelineObjectPath, IGanttChartModel, LabelType)`

    - #### getLabel

          public String getLabel(TimelineObjectPath path,
                                 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:
        `path` - the path to 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(TimelineObjectPath, IGanttChartModel, LabelType)`

    - #### getLabel

          public String getLabel(IRelationship relationship,
                                 IGanttChartModel model,
                                 LabelType type)

      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
        `type` - the label type
      Returns:
        a label for the given relationship

    - #### getDateFormatter

          public 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(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

Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.