com.dlsc.flexgantt.policy.gantt

## Class TimeGranularityStatusBarPolicy

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - com.dlsc.flexgantt.policy.gantt.AbstractStatusBarPolicy
    - - com.dlsc.flexgantt.policy.gantt.TimeGranularityStatusBarPolicy

- All Implemented Interfaces:
    IStatusBarPolicy, IPolicy

      public class TimeGranularityStatusBarPolicy
      extends AbstractStatusBarPolicy
      implements IStatusBarPolicy

  An implementation of the status bar policy used in situations where the dateline model is an instance of `TimeGranularityDatelineModel`. For more information on the purpose of the policy please refer to the documentation of `IStatusBarPolicy`.
  Since:
    1.0
  Version:
    $Revision: 1.5 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimeGranularityStatusBarPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DateFormat` | `getFormat()` Returns the date formatting object used by the policy methods to format the given time points and time spans.
    `String` | `getTimeNowString(IDatelineModel model, long time)` Returns a string representing the given time point, which represents time now.
    `String` | `getTimeSpanString(IDatelineModel model, ITimeSpan span)` Returns a string representing the given time span.
    `String` | `getTimeString(IDatelineModel model, long time)` Returns a string representing the given time point.
    `void` | `setFormat(DateFormat format)` Sets the date formatting object used by the policy methods to format the given time points and time spans.

    - ### Methods inherited from class com.dlsc.flexgantt.policy.gantt.AbstractStatusBarPolicy

      `addStatusBarFields, isStatusBarFieldVisible, removeStatusBarFields`

    - ### 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`

    - ### Methods inherited from interface com.dlsc.flexgantt.policy.gantt.IStatusBarPolicy

      `isStatusBarFieldVisible`

- - ### Constructor Detail

    - #### TimeGranularityStatusBarPolicy

          public TimeGranularityStatusBarPolicy()

  - ### Method Detail

    - #### getTimeNowString

          public String getTimeNowString(IDatelineModel model,
                                         long time)

      Description copied from interface: `IStatusBarPolicy`
      Returns a string representing the given time point, which represents time now.
      Specified by:
        `getTimeNowString` in interface `IStatusBarPolicy`
      Parameters:
        `model` - the dateline model currently used by the Gantt chart
        `time` - the time (now) point for which to return a string
      Returns:
        a text representation of the given time point

    - #### getTimeSpanString

          public String getTimeSpanString(IDatelineModel model,
                                          ITimeSpan span)

      Description copied from interface: `IStatusBarPolicy`
      Returns a string representing the given time span.
      Specified by:
        `getTimeSpanString` in interface `IStatusBarPolicy`
      Parameters:
        `model` - the dateline model currently used by the Gantt chart
        `span` - the time span for which to return a string
      Returns:
        a text representation of the given time span

    - #### getTimeString

          public String getTimeString(IDatelineModel model,
                                      long time)

      Description copied from interface: `IStatusBarPolicy`
      Returns a string representing the given time point.
      Specified by:
        `getTimeString` in interface `IStatusBarPolicy`
      Parameters:
        `model` - the dateline model currently used by the Gantt chart
        `time` - the time point for which to return a string
      Returns:
        a text representation of the given time point

    - #### getFormat

          public DateFormat getFormat()

      Returns the date formatting object used by the policy methods to format the given time points and time spans. The default formatter gets set via a call to `DateFormat.getInstance()`.
      Returns:
        the date formatting object
      Since:
        1.0
      See Also:
        `setFormat(DateFormat)`

    - #### setFormat

          public void setFormat(DateFormat format)

      Sets the date formatting object used by the policy methods to format the given time points and time spans. The default formatter gets set via a call to `DateFormat.getInstance()`.
      Parameters:
        `format` -
      Since:
        1.0

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