Interface PageBreakPositions
-
- All Known Implementing Classes:
FilteringPageBreakPositions
,FlowPageBreakPositionList
,PageBreakPositionList
public interface PageBreakPositions
-
-
Method Summary
All Methods Instance Methods Abstract 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 pageStartPosition)
Locates the page-end for a given page-start position.long
findPageStartPositionForPageEndPosition(long pageEndPosition)
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)
-
-
-
Method Detail
-
computeFixedPositionInFlow
long computeFixedPositionInFlow(long shiftedBoxPosition, long fixedPositionResolved)
-
isCrossingPagebreakWithFixedPosition
boolean isCrossingPagebreakWithFixedPosition(long shiftedBoxPosition, long height, long fixedPositionResolved)
-
findPageStartPositionForPageEndPosition
long findPageStartPositionForPageEndPosition(long pageEndPosition)
Locates the page-start for a given page-end position.- Parameters:
pageEndPosition
- the current page-end for which to find the page-start.- Returns:
- the start position for the page ending on
pageEndPosition
. - Throws:
IllegalStateException
- if the given pageEndPosition does not correspond to a major break.
-
findPageEndForPageStartPosition
long findPageEndForPageStartPosition(long pageStartPosition)
Locates the page-end for a given page-start position.- Parameters:
pageStartPosition
- the current page-start for which to find the page-end.- Returns:
- the end position for the page starting on
pageStartPosition
. - Throws:
IllegalStateException
- if the given pageStartPosition does not correspond to a major break.
-
isCrossingPagebreak
boolean isCrossingPagebreak(long boxY, long boxHeight, long pagebreakShift)
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.- 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.
-
findNextBreakPosition
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.- Parameters:
position
- the position from where to search the next pagebreak.- Returns:
- the position.
-
findNextMajorBreakPosition
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.- Parameters:
position
- the position from where to search the next pagebreak.- Returns:
- the position.
-
findPreviousBreakPosition
long findPreviousBreakPosition(long position)
-
isPageStart
boolean isPageStart(long position)
-
-