com.dlsc.flexgantt.swing.layer.system

## Class DefaultRelationshipSelectionModel

- java.lang.Object
- - com.dlsc.flexgantt.swing.layer.system.DefaultRelationshipSelectionModel

- All Implemented Interfaces:
    IRelationshipSelectionModel

      public class DefaultRelationshipSelectionModel
      extends Object
      implements IRelationshipSelectionModel

  The default implementation of a relationship selection model. This class is used by the `RelationshipLayer`.
  Since:
    2.0
  Author:
    Dirk Lemmermann

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultRelationshipSelectionModel()` Constructs a new selection model.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRelationshipSelectionModelListener(IRelationshipSelectionModelListener l)` Adds a listener to the model so that changes to the selection can be detected.
    `void` | `addSelection(Collection<IRelationship> relationships)` Adds several relationships to the selection.
    `void` | `clearSelection()` Removes all relationships from the model, hence deselecting them.
    `protected void` | `fireValueChanged(RelationshipSelectionEvent evt)` Sends the given event object to all listeners that are attached to this model.
    `Collection<IRelationship>` | `getSelection()` Returns all relationship model object that are currently selected.
    `boolean` | `isEmpty()` Returns TRUE if currently no relationships are selected.
    `boolean` | `isSelected(IRelationship relationship)` Returns TRUE if the given relationship object is selected.
    `void` | `removeRelationshipSelectionModelListener(IRelationshipSelectionModelListener l)` Removes a listener from the model.
    `void` | `removeSelection(Collection<IRelationship> relationships)` Removes several relationships from the selection.

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

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

- - ### Constructor Detail

    - #### DefaultRelationshipSelectionModel

          public DefaultRelationshipSelectionModel()

      Constructs a new selection model.
      Since:
        2.0

  - ### Method Detail

    - #### getSelection

          public Collection<IRelationship> getSelection()

      Description copied from interface: `IRelationshipSelectionModel`
      Returns all relationship model object that are currently selected.
      Specified by:
        `getSelection` in interface `IRelationshipSelectionModel`
      Returns:
        all selected relationships

    - #### addSelection

          public void addSelection(Collection<IRelationship> relationships)

      Description copied from interface: `IRelationshipSelectionModel`
      Adds several relationships to the selection.
      Specified by:
        `addSelection` in interface `IRelationshipSelectionModel`
      Parameters:
        `relationships` - the selected relationships

    - #### removeSelection

          public void removeSelection(Collection<IRelationship> relationships)

      Description copied from interface: `IRelationshipSelectionModel`
      Removes several relationships from the selection.
      Specified by:
        `removeSelection` in interface `IRelationshipSelectionModel`
      Parameters:
        `relationships` - the deselected relationships

    - #### clearSelection

          public void clearSelection()

      Description copied from interface: `IRelationshipSelectionModel`
      Removes all relationships from the model, hence deselecting them.
      Specified by:
        `clearSelection` in interface `IRelationshipSelectionModel`

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `IRelationshipSelectionModel`
      Returns TRUE if currently no relationships are selected.
      Specified by:
        `isEmpty` in interface `IRelationshipSelectionModel`
      Returns:
        TRUE if model does not know of any selected relationships

    - #### isSelected

          public boolean isSelected(IRelationship relationship)

      Description copied from interface: `IRelationshipSelectionModel`
      Returns TRUE if the given relationship object is selected.
      Specified by:
        `isSelected` in interface `IRelationshipSelectionModel`
      Parameters:
        `relationship` - the relationship to check for its selection state
      Returns:
        TRUE if the given relationship is selected

    - #### addRelationshipSelectionModelListener

          public void addRelationshipSelectionModelListener(IRelationshipSelectionModelListener l)

      Description copied from interface: `IRelationshipSelectionModel`
      Adds a listener to the model so that changes to the selection can be detected.
      Specified by:
        `addRelationshipSelectionModelListener` in interface `IRelationshipSelectionModel`
      Parameters:
        `l` - the model listener

    - #### removeRelationshipSelectionModelListener

          public void removeRelationshipSelectionModelListener(IRelationshipSelectionModelListener l)

      Description copied from interface: `IRelationshipSelectionModel`
      Removes a listener from the model.
      Specified by:
        `removeRelationshipSelectionModelListener` in interface `IRelationshipSelectionModel`
      Parameters:
        `l` - the model listener

    - #### fireValueChanged

          protected void fireValueChanged(RelationshipSelectionEvent evt)

      Sends the given event object to all listeners that are attached to this model.
      Parameters:
        `evt` - the selection event
      Since:
        2.0

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