com.dlsc.flexgantt.policy.layer

## Interface IEditTimelineObjectPolicy

- All Superinterfaces:
    IPolicy
  All Known Implementing Classes:
    DefaultEditTimelineObjectPolicy

      public interface IEditTimelineObjectPolicy
      extends IPolicy

  A policy that is used for making various decisions regarding the editing behaviour of timeline objects.
  Since:
    1.0
  Version:
    $Revision: 1.6 $
  Author:
    Dirk Lemmermann

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ICommand` | `getChangeTimeSpanCommand(TimelineObjectPath path, IGanttChartModel model, ITimeSpan span, int dropAction)` Returns a command object that will perform the actual change of the timeline object's time span.
    `ICommand` | `getChangeTimeSpansCommand(IGanttChartModel model, List<TimelineObjectPath> timelineObjects, List<ITimeSpan> timeSpans, int dropAction)` Returns a command object that will perform the actual change of the timeline objects' time spans.
    `ICommand` | `getCreateCommand(Object node, IGanttChartModel model, ILayer layer, ITimeSpan span, int lineIndex)` Returns a command object that will perform the creation of a new timeline object.
    `ICommand` | `getDeleteCommand(IGanttChartModel model, Collection<TimelineObjectPath> timelineObjects)` Returns a command object that will perform the deletion of the given timeline objects.
    `boolean` | `isCreatable(Object node, IGanttChartModel model, ILayer layer, ITimeSpan span)` Decides whether a timeline object can be created for the given node, model, and time span.
    `boolean` | `isDeletable(TimelineObjectPath path, IGanttChartModel model)` Decides whether the timeline object may be deleted.
    `boolean` | `isDurationChangeable(TimelineObjectPath path, IGanttChartModel model)` Decides whether the duration of a timeline object may be edited / changed.
    `boolean` | `isInPlaceEditable(TimelineObjectPath path, IGanttChartModel model)` Decides whether a timeline object can be edited with an editor where the editor is usually an instance of `ITimelineObjectEditor`.
    `boolean` | `isStartTimeChangeable(TimelineObjectPath path, IGanttChartModel model)` Decides whether the start time of a timeline object may be edited / changed.

- - ### Method Detail

    - #### isInPlaceEditable

          boolean isInPlaceEditable(TimelineObjectPath path,
                                    IGanttChartModel model)

      Decides whether a timeline object can be edited with an editor where the editor is usually an instance of `ITimelineObjectEditor`.
      Parameters:
        `path` - the path to the timeline object that gets checked for its editing ability
        `model` - the model to which the timeline object belongs
      Returns:
        TRUE if the timeline object may be edited by the user
      Since:
        1.0

    - #### isStartTimeChangeable

          boolean isStartTimeChangeable(TimelineObjectPath path,
                                        IGanttChartModel model)

      Decides whether the start time of a timeline object may be edited / changed.
      Parameters:
        `path` - the path to the timeline object that gets checked for its time span editing ability
        `model` - the model to which the timeline object belongs
      Returns:
        TRUE if the start time of the timeline object may be edited
      Since:
        1.0

    - #### isDurationChangeable

          boolean isDurationChangeable(TimelineObjectPath path,
                                       IGanttChartModel model)

      Decides whether the duration of a timeline object may be edited / changed.
      Parameters:
        `path` - the path to the timeline object that gets checked for its time span editing ability
        `model` - the model to which the timeline object belongs
      Returns:
        TRUE if the duration of the timeline object may be edited
      Since:
        1.0

    - #### isDeletable

          boolean isDeletable(TimelineObjectPath path,
                              IGanttChartModel model)

      Decides whether the timeline object may be deleted.
      Parameters:
        `path` - the path to the timeline object that gets checked
        `model` - the model to which the timeline object belongs
      Returns:
        TRUE if the eventline object may be deleted
      Since:
        1.0

    - #### isCreatable

          boolean isCreatable(Object node,
                              IGanttChartModel model,
                              ILayer layer,
                              ITimeSpan span)

      Decides whether a timeline object can be created for the given node, model, and time span.
      Parameters:
        `node` - the tree node that will own the new timeline object
        `model` - the model to which the timeline object will be added
        `layer` - the layer where the timeline object will be added
        `span` - the time span where the new timeline object shall be created
      Returns:
        TRUE if the eventline object may be deleted
      Since:
        1.0

    - #### getChangeTimeSpanCommand

          ICommand getChangeTimeSpanCommand(TimelineObjectPath path,
                                            IGanttChartModel model,
                                            ITimeSpan span,
                                            int dropAction)

      Returns a command object that will perform the actual change of the timeline object's time span.
      Parameters:
        `path` - the path to the timeline object that receives a new time span
        `model` - the data source of the tree node and the timeline object
        `span` - the new time span for the timeline object
        `dropAction` - the type of drag that was executed by the user (COPY or MOVE, the possible values are listed in `DnDConstants`).
      Returns:
        a command that will modify the timeline object's time span
      Since:
        1.0

    - #### getChangeTimeSpansCommand

          ICommand getChangeTimeSpansCommand(IGanttChartModel model,
                                             List<TimelineObjectPath> timelineObjects,
                                             List<ITimeSpan> timeSpans,
                                             int dropAction)

      Returns a command object that will perform the actual change of the timeline objects' time spans. The command must be capable of changing the time spans of several timeline objects at the same time. The list of timeline objects and the list of time spans are in synch, which means that the first timeline object in the list of timeline objects belongs to the first time span in the list of time spans.
      Parameters:
        `model` - the data source of the tree node and the timeline object
        `timelineObjects` - the timeline objects that receives the new time span
        `timeSpans` - the new time spans for the timeline objects
        `dropAction` - the type of drag that was executed by the user (COPY or MOVE, the possible values are listed in `DnDConstants`).
      Returns:
        a command that will modify the timeline object's time span
      Since:
        1.1

    - #### getCreateCommand

          ICommand getCreateCommand(Object node,
                                    IGanttChartModel model,
                                    ILayer layer,
                                    ITimeSpan span,
                                    int lineIndex)

      Returns a command object that will perform the creation of a new timeline object.
      Parameters:
        `node` - the tree node that will own the new timeline object
        `model` - the data source of the tree node
        `layer` - the layer to which the newly created timeline object will be added
        `span` - the time span where the new timeline object will be placed
        `lineIndex` - the index of the line (see `ILinePolicy`) where the new timeline object gets created (-1 if no specific inner line is used)
      Returns:
        a command that will modify the timeline object's time span
      Since:
        1.0

    - #### getDeleteCommand

          ICommand getDeleteCommand(IGanttChartModel model,
                                    Collection<TimelineObjectPath> timelineObjects)

      Returns a command object that will perform the deletion of the given timeline objects. Only deletable timeline objects are passed to this method.
      Parameters:
        `timelineObjects` - the timeline objects that gets deleted
        `model` - the data source of the tree node and the timeline object
      Returns:
        a command that will modify the timeline object's time span
      Since:
        1.0

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