com.dlsc.flexgantt.model.gantt

## Class TimelineObjectPath<T>

- java.lang.Object
- - javax.swing.tree.TreePath
  - - com.dlsc.flexgantt.model.gantt.TimelineObjectPath<T>

- Type Parameters:
    `T` - the type of the timeline object to which the path points
  All Implemented Interfaces:
    Serializable

      public class TimelineObjectPath<T>
      extends TreePath

  An extension of `TreePath` which adds a reference to a timeline object and the layer on which it is displayed to the tree path information. Timeline object paths are used for creating unique references to timeline objects.
  Since:
    1.0
  Version:
    $Revision: 1.8 $
  Author:
    Dirk Lemmermann
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimelineObjectPath(Object[] path, T timelineObject, ILayer layer)` Constructs a new timeline object path.
    `TimelineObjectPath(Object singlePath, T timelineObject, ILayer layer)` Constructs a new timeline object path.
    `TimelineObjectPath(TreePath path, T timelineObject, ILayer layer)` Constructs a new timeline object path.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `ILayer` | `getLayer()` Returns the layer on which the timeline object gets displayed.
    `Object` | `getNode()` Returns the node in the tree table to which the path is pointing.
    `T` | `getTimelineObject()` Returns the timeline object to which the path points.
    `TreePath` | `getTreePath()` Creates a tree path for the timeline object path.

    - ### Methods inherited from class javax.swing.tree.TreePath

      `getLastPathComponent, getParentPath, getPath, getPathComponent, getPathCount, hashCode, isDescendant, pathByAddingChild, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### TimelineObjectPath

          public TimelineObjectPath(Object singlePath,
                                    T timelineObject,
                                    ILayer layer)

      Constructs a new timeline object path.
      Parameters:
        `singlePath` - the tree path if it consists of only one element
        `timelineObject` - the timeline object to which the path points
        `layer` - the layer on which the timeline object is displayed
      Since:
        1.0

    - #### TimelineObjectPath

          public TimelineObjectPath(Object[] path,
                                    T timelineObject,
                                    ILayer layer)

      Constructs a new timeline object path.
      Parameters:
        `path` - the tree path pointing to the hierarchy node on which the timeline object is stored
        `timelineObject` - the timeline object to which the path points
        `layer` - the layer on which the timeline object is displayed
      Since:
        1.0

    - #### TimelineObjectPath

          public TimelineObjectPath(TreePath path,
                                    T timelineObject,
                                    ILayer layer)

      Constructs a new timeline object path.
      Parameters:
        `path` - the tree path pointing to the hierarchy node on which the timeline object is stored
        `timelineObject` - the timeline object to which the path points
        `layer` - the layer on which the timeline object is displayed
      Since:
        1.0

  - ### Method Detail

    - #### getTimelineObject

          public T getTimelineObject()

      Returns the timeline object to which the path points.
      Returns:
        the refernces timeline object
      Since:
        1.0

    - #### getNode

          public Object getNode()

      Returns the node in the tree table to which the path is pointing. This method delegates to `TreePath.getLastPathComponent()`.
      Returns:
        the tree node where the timeline object is located
      Since:
        1.1

    - #### getLayer

          public ILayer getLayer()

      Returns the layer on which the timeline object gets displayed.
      Returns:
        the layer on which the timeline object gets displayed
      Since:
        1.0

    - #### getTreePath

          public TreePath getTreePath()

      Creates a tree path for the timeline object path. Creating a tree path for a timeline object path makes it easy to check if two timeline objects are located in the same row.
      Returns:
        a tree path for the timeline object path
      Since:
        1.0

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `TreePath`

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