Class FilteringPageBreakPositions
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.model.FilteringPageBreakPositions
-
- All Implemented Interfaces:
PageBreakPositions
public class FilteringPageBreakPositions extends Object implements PageBreakPositions
-
-
Constructor Summary
Constructors Constructor Description FilteringPageBreakPositions(PageBreakPositions backend, long pageStart)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
computeFixedPositionInFlow(long shiftedBoxPosition, long fixedPositionResolved)
long
findNextBreakPosition(long position)
Finds the closest break-position that is larger or equal to the given position.long
findNextMajorBreakPosition(long position)
Finds the closest master break-position that is larger or equal to the given position.long
findPageEndForPageStartPosition(long pageOffset)
Locates the page-end for a given page-start position.long
findPageStartPositionForPageEndPosition(long pageOffset)
Locates the page-start for a given page-end position.long
findPreviousBreakPosition(long position)
boolean
isCrossingPagebreak(long boxY, long boxHeight, long pagebreakShift)
Checks, whether the given box will cross a pagebreak.boolean
isCrossingPagebreakWithFixedPosition(long shiftedBoxPosition, long height, long fixedPositionResolved)
boolean
isPageStart(long position)
-
-
-
Constructor Detail
-
FilteringPageBreakPositions
public FilteringPageBreakPositions(PageBreakPositions backend, long pageStart)
-
-
Method Detail
-
findNextBreakPosition
public long findNextBreakPosition(long position)
Finds the closest break-position that is larger or equal to the given position. This returns the next pagebreak in the flow after the given position. If the position given is larger than the largest posible page-break, then this returns the last pagebreak instead.- Specified by:
findNextBreakPosition
in interfacePageBreakPositions
- Parameters:
position
- the position from where to search the next pagebreak.- Returns:
- the position.
-
findNextMajorBreakPosition
public long findNextMajorBreakPosition(long position)
Finds the closest master break-position that is larger or equal to the given position. A master pagebreak is the boundary of a logical page, which in itself can consist of several physical pages. This returns the next master pagebreak in the flow after the given position. If the position given is larger than the largest posible page-break, then this returns the last pagebreak instead.- Specified by:
findNextMajorBreakPosition
in interfacePageBreakPositions
- Parameters:
position
- the position from where to search the next pagebreak.- Returns:
- the position.
-
findPreviousBreakPosition
public long findPreviousBreakPosition(long position)
- Specified by:
findPreviousBreakPosition
in interfacePageBreakPositions
-
findPageStartPositionForPageEndPosition
public long findPageStartPositionForPageEndPosition(long pageOffset)
Description copied from interface:PageBreakPositions
Locates the page-start for a given page-end position.- Specified by:
findPageStartPositionForPageEndPosition
in interfacePageBreakPositions
- Parameters:
pageOffset
- the current page-end for which to find the page-start.- Returns:
- the start position for the page ending on
pageEndPosition
.
-
findPageEndForPageStartPosition
public long findPageEndForPageStartPosition(long pageOffset)
Description copied from interface:PageBreakPositions
Locates the page-end for a given page-start position.- Specified by:
findPageEndForPageStartPosition
in interfacePageBreakPositions
- Parameters:
pageOffset
- the current page-start for which to find the page-end.- Returns:
- the end position for the page starting on
pageStartPosition
.
-
isCrossingPagebreak
public boolean isCrossingPagebreak(long boxY, long boxHeight, long pagebreakShift)
Description copied from interface:PageBreakPositions
Checks, whether the given box will cross a pagebreak. The box's y-position is shifted by the given amount before testing the result. A box will cross a pagebreak if its shifted y position and its shifted y2 position (y + height) are located on different pages. A box with a height of zero cannot cross a pagebreak by definition.- Specified by:
isCrossingPagebreak
in interfacePageBreakPositions
- Parameters:
boxY
- the box Y, unshifted.boxHeight
- the box height.pagebreakShift
- the current shift that should be applied for the test- Returns:
- true, if the box crosses a pagebreak, false otherwise.
-
isCrossingPagebreakWithFixedPosition
public boolean isCrossingPagebreakWithFixedPosition(long shiftedBoxPosition, long height, long fixedPositionResolved)
- Specified by:
isCrossingPagebreakWithFixedPosition
in interfacePageBreakPositions
-
computeFixedPositionInFlow
public long computeFixedPositionInFlow(long shiftedBoxPosition, long fixedPositionResolved)
- Specified by:
computeFixedPositionInFlow
in interfacePageBreakPositions
-
isPageStart
public boolean isPageStart(long position)
- Specified by:
isPageStart
in interfacePageBreakPositions
-
-