Module com.flexganttfx.model
Package com.flexganttfx.model.layout
Class EqualLinesManager<R extends Row<?,?,A>,A extends Activity>
java.lang.Object
com.flexganttfx.model.layout.EqualLinesManager<R,A>
- Type Parameters:
R- the type of the rowA- the type of the activities
- All Implemented Interfaces:
LinesManager<A>
- Direct Known Subclasses:
AutoLinesManager
public class EqualLinesManager<R extends Row<?,?,A>,A extends Activity> extends Object implements LinesManager<A>
A lines manager that equally distributes the available row height to all
lines.
- Since:
- 1.0
- See Also:
Row.getLineCount()
-
Constructor Summary
Constructors Constructor Description EqualLinesManager(R row)Constructs a new lines manager for the given row. -
Method Summary
Modifier and Type Method Description doublegetLineHeight(int lineIndex, double rowHeight)Returns the height of the line with the given index.intgetLineIndex(A activity)Returns the line index for the given activity.LayoutgetLineLayout(int lineIndex)Returns the layout for the line with the given line index.doublegetLineLocation(int lineIndex, double rowHeight)Returns the location of the line with the given index.RgetRow()Returns the row for which the manager is used.
-
Constructor Details
-
EqualLinesManager
Constructs a new lines manager for the given row. The manager attaches listeners toRow.lineCountProperty()andRow.heightProperty()in order to recalculate the line locations and heights.- Parameters:
row- the row for which to use the manager
-
-
Method Details
-
getRow
Returns the row for which the manager is used.- Returns:
- the row
-
getLineLocation
public final double getLineLocation(int lineIndex, double rowHeight) throws IllegalLineIndexExceptionDescription copied from interface:LinesManagerReturns the location of the line with the given index. In most cases the value of the location is somewhere between 0 andRow.getHeight(). Lines are free to overlap each other.- Specified by:
getLineLocationin interfaceLinesManager<R extends Row<?,?,A>>- Parameters:
lineIndex- the index of the linerowHeight- the height of the row where the line is located- Returns:
- the location of the given line (y-coordinate)
- Throws:
IllegalLineIndexException- if no line with the given index exists
-
getLineLayout
Description copied from interface:LinesManagerReturns the layout for the line with the given line index. A row and each line within a row can have their own layout.- Specified by:
getLineLayoutin interfaceLinesManager<R extends Row<?,?,A>>- Parameters:
lineIndex- the index of the line- Returns:
- the layout of the given line
- Throws:
IllegalLineIndexException- if no line with the given index exists
-
getLineHeight
public final double getLineHeight(int lineIndex, double rowHeight) throws IllegalLineIndexExceptionDescription copied from interface:LinesManagerReturns the height of the line with the given index. In most cases the height is somewhere between 0 andRow.getHeight().- Specified by:
getLineHeightin interfaceLinesManager<R extends Row<?,?,A>>- Parameters:
lineIndex- the index of the linerowHeight- the height of the row where the line is located- Returns:
- the height of the given line
- Throws:
IllegalLineIndexException- if no line with the given index exists
-
getLineIndex
Description copied from interface:LinesManagerReturns the line index for the given activity. This method is responsible for placing activities on different lines.- Specified by:
getLineIndexin interfaceLinesManager<R extends Row<?,?,A>>- Parameters:
activity- the activity for which a line index is requested- Returns:
- the line index of the given activity
-