Module com.flexganttfx.view
Package com.flexganttfx.view.util
Class AutoLinesManager<R extends Row<?,?,A>,A extends Activity>
java.lang.Object
com.flexganttfx.model.layout.EqualLinesManager<R,A>
com.flexganttfx.view.util.AutoLinesManager<R,A>
- Type Parameters:
R
- the type of the row that will be managedA
- the type of the activities that will be managed
- All Implemented Interfaces:
LinesManager<A>
public class AutoLinesManager<R extends Row<?,?,A>,A extends Activity> extends EqualLinesManager<R,A>
A specialized
LinesManager
used for ensuring that activities will not
overlap each other. This manager will create as many inner lines as needed
and will calculate the placement of all activities on these lines.- Since:
- 1.2
-
Constructor Summary
Constructors Constructor Description AutoLinesManager(R row, GraphicsBase<R> graphics)
Constructs a new automatic lines manager. -
Method Summary
Modifier and Type Method Description GraphicsBase<R>
getGraphics()
Returns the graphics view where the manager will be used.int
getLineIndex(A activity)
Returns the line index for the given activity.void
layout()
Triggers a layout of the activities and calculates the line count for the row.void
setFilter(Predicate<A> filter)
Sets a filter that will be used in combination with aResolver
instance to figure out which activities are relevant for the calculation of overlapping activities (clusters).Methods inherited from class com.flexganttfx.model.layout.EqualLinesManager
getLineHeight, getLineLayout, getLineLocation, getRow
-
Constructor Details
-
AutoLinesManager
Constructs a new automatic lines manager. The constructor requires a reference to the graphics view to lookup various parameters that are needed when the manager queries the activity repository of the row (e.g. the currently displayed temporal unit and the list of layers).- Parameters:
row
- the managed rowgraphics
- the graphics view where the manager will be used- Since:
- 1.2
-
-
Method Details
-
getGraphics
Returns the graphics view where the manager will be used.- Returns:
- the graphics view
- Since:
- 1.2
-
setFilter
Sets a filter that will be used in combination with aResolver
instance to figure out which activities are relevant for the calculation of overlapping activities (clusters). If the predicate returns false then the activity will not be considered when creating the clusters.- Parameters:
filter
- the filter
-
layout
public final void layout()Triggers a layout of the activities and calculates the line count for the row.- Since:
- 1.2
-
getLineIndex
Description copied from interface:LinesManager
Returns the line index for the given activity. This method is responsible for placing activities on different lines.- Specified by:
getLineIndex
in interfaceLinesManager<R extends Row<?,?,A>>
- Overrides:
getLineIndex
in classEqualLinesManager<R extends Row<?,?,A>,A extends Activity>
- Parameters:
activity
- the activity for which a line index is requested- Returns:
- the line index of the given activity
-