com.dlsc.flexgantt.policy.layer

## Class DefaultDragInfoPolicy

- java.lang.Object
- - com.dlsc.flexgantt.policy.AbstractPolicy
  - - com.dlsc.flexgantt.policy.layer.DefaultDragInfoPolicy

- All Implemented Interfaces:
    IPolicy, IDragInfoPolicy
  Direct Known Subclasses:
    TimeGranularityDragInfoPolicy

      public class DefaultDragInfoPolicy
      extends AbstractPolicy
      implements IDragInfoPolicy

  The default implementation of the drag info policy will simply create a string that contains the time span passed to the policy. This implementation is sufficient if for example the `SimpleGranularityDatelineModel` is in use.
  Since:
    1.0
  Version:
    $Revision: 1.3 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultDragInfoPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NumberFormat` | `getCapacityFormatter()` Returns the formatter that is being used to format the capacity used value into a nice text.
    `Object` | `getDragInfo(TimelineObjectPath path, IGanttChartModel model, IDatelineModel<?> datelineModel, 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).
    `Object` | `getDragInfo(TimelineObjectPath path, IGanttChartModel model, int rowHeight, int y, double capacityUsed)` Returns an object that can be used to show information while the user interactively changes the capacity used value.
    `Object` | `getDragInfo(TimelineObjectPath path, IGanttChartModel model, long timePoint, double percentageComplete)` Returns an object that can be used to show information while the user interactively changes the percentage complete value.
    `NumberFormat` | `getPercentageFormatter()` Returns the formatter that is being used to format the percentage complete value into a nice text.
    `void` | `setCapacityFormatter(NumberFormat formatter)` Sets the formatter that is being used to format the percentage complete value into a nice text.
    `void` | `setPercentageFormatter(NumberFormat formatter)` Sets the formatter that is being used to format the percentage complete value into a nice text.

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

    - #### DefaultDragInfoPolicy

          public DefaultDragInfoPolicy()

  - ### Method Detail

    - #### getDragInfo

          public Object getDragInfo(TimelineObjectPath path,
                                    IGanttChartModel model,
                                    IDatelineModel<?> datelineModel,
                                    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`
      Parameters:
        `path` - the path to the dragged timeline object
        `model` - the model to which the dragged timeline object belongs
        `datelineModel` - the model used by the dateline
        `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

    - #### getDragInfo

          public Object getDragInfo(TimelineObjectPath path,
                                    IGanttChartModel model,
                                    long timePoint,
                                    double percentageComplete)

      Description copied from interface: `IDragInfoPolicy`
      Returns an object that can be used to show information while the user interactively changes the percentage complete value.
      Specified by:
        `getDragInfo` in interface `IDragInfoPolicy`
      Parameters:
        `path` - the path to the dragged timeline object
        `model` - the model to which the dragged timeline object belongs
        `timePoint` - the current (grid adjusted) time at the cursor location
        `percentageComplete` - the percentage complete value of the activity object
      Returns:
        an arbitrary object that can contain information relevant for a drag info renderer

    - #### getDragInfo

          public Object getDragInfo(TimelineObjectPath path,
                                    IGanttChartModel model,
                                    int rowHeight,
                                    int y,
                                    double capacityUsed)

      Description copied from interface: `IDragInfoPolicy`
      Returns an object that can be used to show information while the user interactively changes the capacity used value.
      Specified by:
        `getDragInfo` in interface `IDragInfoPolicy`
      Parameters:
        `path` - the path to the dragged object
        `model` - the model to which the dragged timeline object belongs
        `rowHeight` - the height of the row in which the drag operation takes place
        `y` - the current y coordinate relative to the coordinate system of the row (0 = bottom of row)
        `capacityUsed` - the capacity used value of the capacity object
      Returns:
        an arbitrary object that can contain information relevant for a drag info renderer

    - #### getPercentageFormatter

          public NumberFormat getPercentageFormatter()

      Returns the formatter that is being used to format the percentage complete value into a nice text.
      Returns:
        the formatter for the percentage complete text
      Since:
        1.0
      See Also:
        `getDragInfo(TimelineObjectPath, IGanttChartModel, int, int, double)`

    - #### setPercentageFormatter

          public void setPercentageFormatter(NumberFormat formatter)

      Sets the formatter that is being used to format the percentage complete value into a nice text.
      Parameters:
        `formatter` - the formatter for the percentage complete text
      Since:
        1.0
      See Also:
        `getDragInfo(TimelineObjectPath, IGanttChartModel, long, double)`

    - #### getCapacityFormatter

          public NumberFormat getCapacityFormatter()

      Returns the formatter that is being used to format the capacity used value into a nice text.
      Returns:
        the formatter for the percentage complete text
      Since:
        1.0
      See Also:
        `getDragInfo(TimelineObjectPath, IGanttChartModel, int, int, double)`

    - #### setCapacityFormatter

          public void setCapacityFormatter(NumberFormat formatter)

      Sets the formatter that is being used to format the percentage complete value into a nice text.
      Parameters:
        `formatter` - the formatter for the percentage complete text
      Since:
        1.0
      See Also:
        `getDragInfo(TimelineObjectPath, IGanttChartModel, int, int, double)`

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