com.dlsc.flexgantt.swing.layer

## Class DefaultLayerContainerSelectionModel

- java.lang.Object
- - com.dlsc.flexgantt.swing.layer.DefaultLayerContainerSelectionModel

- All Implemented Interfaces:
    ILayerContainerSelectionModel

      public class DefaultLayerContainerSelectionModel
      extends Object
      implements ILayerContainerSelectionModel

  The default implementation of `ILayerContainerSelectionModel`.
  Since:
    1.0
  Version:
    $Revision: 1.7 $
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultLayerContainerSelectionModel()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener l)` Adds a listener to the selection model.
    `void` | `addSelectedTimeSpan(Object node, ITimeSpan span)` Adds a time span to the list of selected time spans of the given tree table node object.
    `void` | `clearSelectedTimeSpans()` Removes all selected time spans from the selection model.
    `void` | `clearSelectedTimeSpans(Object node)` Removes all of those selected time spans that belong to the given tree node object.
    `protected void` | `fireTimeSpansAdded(Object node, List<ITimeSpan> spans)` Sends a `TimeSpanSelectionEvent` to all listeners informing them that time spans have been added to the selection model.
    `protected void` | `fireTimeSpansRemoved(Object node, List<ITimeSpan> spans)` Sends a `TimeSpanSelectionEvent` to all listeners informing them that time spans have been removed from the selection model.
    `Iterator<ITimeSpan>` | `getSelectedTimeSpans(Object owner, ITimeSpan span)` Returns an iterator for iterating over the list of selected time spans of the given node within the given time span.
    `boolean` | `isEmpty()` Checks whether the selection model contains any selections at all.
    `boolean` | `isEmpty(Object node)` Checks whether the selection model contains any selections for the given tree node object.
    `boolean` | `isSelected(Object node, ITimeSpan span)` Returns TRUE if the given time span is currently selected on the given tree table node.
    `void` | `removeLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener l)` Removes a listener from the selection model.
    `void` | `removeSelectedTimeSpan(Object node, ITimeSpan removedSpan)` Removes a time span from the list of selected time spans of the given tree table node object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultLayerContainerSelectionModel

          public DefaultLayerContainerSelectionModel()

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `ILayerContainerSelectionModel`
      Checks whether the selection model contains any selections at all.
      Specified by:
        `isEmpty` in interface `ILayerContainerSelectionModel`
      Returns:
        TRUE if the selection model does not have any selections

    - #### isEmpty

          public boolean isEmpty(Object node)

      Description copied from interface: `ILayerContainerSelectionModel`
      Checks whether the selection model contains any selections for the given tree node object.
      Specified by:
        `isEmpty` in interface `ILayerContainerSelectionModel`
      Parameters:
        `node` - the node to check for selections
      Returns:
        TRUE if the selection model does not have any selections for the given tree node object

    - #### clearSelectedTimeSpans

          public void clearSelectedTimeSpans()

      Description copied from interface: `ILayerContainerSelectionModel`
      Removes all selected time spans from the selection model.
      Specified by:
        `clearSelectedTimeSpans` in interface `ILayerContainerSelectionModel`
      See Also:
        `ILayerContainerSelectionModel.clearSelectedTimeSpans(Object)`, `ILayerContainerSelectionModel.removeSelectedTimeSpan(Object, ITimeSpan)`

    - #### clearSelectedTimeSpans

          public void clearSelectedTimeSpans(Object node)

      Description copied from interface: `ILayerContainerSelectionModel`
      Removes all of those selected time spans that belong to the given tree node object.
      Specified by:
        `clearSelectedTimeSpans` in interface `ILayerContainerSelectionModel`
      Parameters:
        `node` - the tree table node object
      See Also:
        `ILayerContainerSelectionModel.clearSelectedTimeSpans()`, `ILayerContainerSelectionModel.removeSelectedTimeSpan(Object, ITimeSpan)`

    - #### addSelectedTimeSpan

          public void addSelectedTimeSpan(Object node,
                                          ITimeSpan span)

      Description copied from interface: `ILayerContainerSelectionModel`
      Adds a time span to the list of selected time spans of the given tree table node object.
      Specified by:
        `addSelectedTimeSpan` in interface `ILayerContainerSelectionModel`
      Parameters:
        `node` - the tree table node object
        `span` - the time span to add
      See Also:
        `ILayerContainerSelectionModel.removeSelectedTimeSpan(Object, ITimeSpan)`

    - #### removeSelectedTimeSpan

          public void removeSelectedTimeSpan(Object node,
                                             ITimeSpan removedSpan)

      Description copied from interface: `ILayerContainerSelectionModel`
      Removes a time span from the list of selected time spans of the given tree table node object.
      Specified by:
        `removeSelectedTimeSpan` in interface `ILayerContainerSelectionModel`
      Parameters:
        `node` - the tree table node object
        `removedSpan` - the time span to remove
      See Also:
        `ILayerContainerSelectionModel.addSelectedTimeSpan(Object, ITimeSpan)`

    - #### getSelectedTimeSpans

          public Iterator<ITimeSpan> getSelectedTimeSpans(Object owner,
                                                          ITimeSpan span)

      Description copied from interface: `ILayerContainerSelectionModel`
      Returns an iterator for iterating over the list of selected time spans of the given node within the given time span.
      Specified by:
        `getSelectedTimeSpans` in interface `ILayerContainerSelectionModel`
      Parameters:
        `owner` - the tree table node object
        `span` - the time span for which an iterator gets created
      Returns:
        a time span iterator

    - #### isSelected

          public boolean isSelected(Object node,
                                    ITimeSpan span)

      Description copied from interface: `ILayerContainerSelectionModel`
      Returns TRUE if the given time span is currently selected on the given tree table node. A time span is considered selected if it is completely contained within one of the selected time spans.
      Specified by:
        `isSelected` in interface `ILayerContainerSelectionModel`
      Parameters:
        `node` - the tree table node object
        `span` - the time span to check
      Returns:
        TRUE if the time span is currently selected
      See Also:
        `ITimeSpan.contains(ITimeSpan)`

    - #### addLayerContainerSelectionModelListener

          public void addLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener l)

      Description copied from interface: `ILayerContainerSelectionModel`
      Adds a listener to the selection model.
      Specified by:
        `addLayerContainerSelectionModelListener` in interface `ILayerContainerSelectionModel`
      Parameters:
        `l` - the listener to add
      See Also:
        `ILayerContainerSelectionModel.removeLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener)`

    - #### removeLayerContainerSelectionModelListener

          public void removeLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener l)

      Description copied from interface: `ILayerContainerSelectionModel`
      Removes a listener from the selection model.
      Specified by:
        `removeLayerContainerSelectionModelListener` in interface `ILayerContainerSelectionModel`
      Parameters:
        `l` - the listener to remove
      See Also:
        `ILayerContainerSelectionModel.addLayerContainerSelectionModelListener(ILayerContainerSelectionModelListener)`

    - #### fireTimeSpansAdded

          protected void fireTimeSpansAdded(Object node,
                                            List<ITimeSpan> spans)

      Sends a `TimeSpanSelectionEvent` to all listeners informing them that time spans have been added to the selection model.
      Parameters:
        `node` - the tree node on which time spans were added to the selection
        `spans` - the time spans that were added
      Since:
        1.0

    - #### fireTimeSpansRemoved

          protected void fireTimeSpansRemoved(Object node,
                                              List<ITimeSpan> spans)

      Sends a `TimeSpanSelectionEvent` to all listeners informing them that time spans have been removed from the selection model.
      Parameters:
        `node` - the tree node on which time spans were removed from the selection
        `spans` - the time spans that were removed
      Since:
        1.0

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