com.dlsc.flexgantt.model.gantt
Class TimelineObjectPath<T>

java.lang.Object
  extended by javax.swing.tree.TreePath
      extended by com.dlsc.flexgantt.model.gantt.TimelineObjectPath<T>
Type Parameters:
T - the type of the timeline object to which the path points
All Implemented Interfaces:
java.io.Serializable

public class TimelineObjectPath<T>
extends javax.swing.tree.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
Author:
Dirk Lemmermann
See Also:
Serialized Form

Constructor Summary
TimelineObjectPath(java.lang.Object[] path, T timelineObject, ILayer layer)
          Constructs a new timeline object path.
TimelineObjectPath(java.lang.Object singlePath, T timelineObject, ILayer layer)
          Constructs a new timeline object path.
TimelineObjectPath(javax.swing.tree.TreePath path, T timelineObject, ILayer layer)
          Constructs a new timeline object path.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 ILayer getLayer()
          Returns the layer on which the timeline object gets displayed.
 T getTimelineObject()
          Returns the timeline object to which the path points.
 javax.swing.tree.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(java.lang.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(java.lang.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(javax.swing.tree.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

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 javax.swing.tree.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(java.lang.Object o)
Overrides:
equals in class javax.swing.tree.TreePath