java.lang.Object
com.flexganttfx.model.ActivityRef<A>
- Type Parameters:
A
- the type of the referenced activity
public final class ActivityRef<A extends Activity> extends Object
An activity reference is used to precisely identify the location of an
activity where the location is a combination of row, layer, and the activity
itself. As the same activity can be located on multiple rows and or multiple
layers at the same time it is often necessary to work with an activity
reference instead of only the activity.
- Since:
- 1.0
-
Constructor Summary
Constructors Constructor Description ActivityRef(Row<?,?,A> row, Layer layer, A activity)
Constructs a new activity reference. -
Method Summary
Modifier and Type Method Description void
attachToRow()
Attaches the activity to its row.void
detachFromRow()
Removes the activity from the row where it is currently shown.boolean
equals(Object obj)
A
getActivity()
Returns the activity itself.Layer
getLayer()
The layer on which the activity is shown.int
getLineIndex()
The line index of the activity.Row<?,?,A>
getRow()
Returns the row where the activity is located.int
hashCode()
boolean
isPathExpanded()
Determines if the entire row path to the activity is currently expanded or not.String
toString()
-
Constructor Details
-
ActivityRef
Constructs a new activity reference.- Parameters:
row
- the row where the activity is shownlayer
- the model layer where the activity is located (optional)activity
- the referenced activity- Since:
- 1.0
-
-
Method Details
-
isPathExpanded
public boolean isPathExpanded()Determines if the entire row path to the activity is currently expanded or not. An activity will not be shown if the tree path to it is not expanded.- Returns:
- true if the row path to the activity is completely expanded
- Since:
- 1.0
-
getRow
Returns the row where the activity is located.- Returns:
- the row where the activity is located
- Since:
- 1.0
-
getLayer
The layer on which the activity is shown.- Returns:
- the layer that is displaying the activity
- Since:
- 1.0
-
getActivity
Returns the activity itself.- Returns:
- the activity
-
getLineIndex
public int getLineIndex()The line index of the activity. This is a convenience method delegating toRow.getLineIndex(Activity)
which then delegates toLinesManager.getLineIndex(Activity)
.- Returns:
- the line index of the activity
- Since:
- 1.0
-
detachFromRow
public void detachFromRow()Removes the activity from the row where it is currently shown.- Since:
- 1.0
- See Also:
detachFromRow()
-
attachToRow
public void attachToRow()Attaches the activity to its row.- Since:
- 1.0
- See Also:
Row.addActivity(Layer, Activity)
-
toString
-
hashCode
public int hashCode() -
equals
-