Package com.itextpdf.layout.renderer
Class GridView
- java.lang.Object
-
- com.itextpdf.layout.renderer.GridView
-
class GridView extends java.lang.ObjectThis class represents a view on a grid, which returns cells one by one in a specified order. Also it allows to place a cell on a grid in this specific order and resizes the grid if needed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classGridView.CursorRepresents a placement cursor.(package private) static classGridView.PosRepresents position on a grid.
-
Field Summary
Fields Modifier and Type Field Description private intbottomMarginprivate GridView.Cursorcursorprivate Gridgridprivate booleanhasNextprivate Grid.GridOrderiterationOrderprivate booleanrestrictXGrowprivate booleanrestrictYGrowprivate intrightMargin
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) booleanfit(int width, int height)Try to fit cell at the current position.booleanhasNext()(package private) voidincreaseDefaultAxis()(package private) voidincreaseDefaultCursor(GridView.Pos cellSizes)Increase cursor in current flow axis(package private) booleanisFixed()Determines if current grid view can be iterated.GridView.Posnext()(package private) GridView.Posreset(int y, int x, int rightMargin, int bottomMargin)Resets grid view and sets it up for processing new element If sparse algorithm is used then x and y positions on a grid are not reset.(package private) voidresetCursorIfIntersectingCellIsPlaced()Reset cursor to the start of a grid if placed a cell, which intersects current flow axis.
-
-
-
Field Detail
-
grid
private final Grid grid
-
iterationOrder
private final Grid.GridOrder iterationOrder
-
cursor
private final GridView.Cursor cursor
-
restrictYGrow
private boolean restrictYGrow
-
restrictXGrow
private boolean restrictXGrow
-
hasNext
private boolean hasNext
-
rightMargin
private int rightMargin
-
bottomMargin
private int bottomMargin
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public GridView.Pos next()
-
reset
GridView.Pos reset(int y, int x, int rightMargin, int bottomMargin)
Resets grid view and sets it up for processing new element If sparse algorithm is used then x and y positions on a grid are not reset.- Parameters:
y- left upper corner y position of an element on the gridx- left upper corner x position of an element on the gridrightMargin- specifies how many cells not to process at the right end of a gridbottomMargin- specifies how many cells not to process at the bottom end of a grid- Returns:
- first element position
-
fit
boolean fit(int width, int height)Try to fit cell at the current position. If cell is fit, then update current flow cursor axis by width/height of a laid out cell.- Parameters:
width- width of the cellheight- height of the cell- Returns:
- true if cell is fit, false otherwise
-
resetCursorIfIntersectingCellIsPlaced
void resetCursorIfIntersectingCellIsPlaced()
Reset cursor to the start of a grid if placed a cell, which intersects current flow axis. This is needed because such cells should be placed out of order and it's expected that they are go first while constructing the grid.
-
increaseDefaultCursor
void increaseDefaultCursor(GridView.Pos cellSizes)
Increase cursor in current flow axis- Parameters:
cellSizes- cell width and height values
-
increaseDefaultAxis
void increaseDefaultAxis()
-
isFixed
boolean isFixed()
Determines if current grid view can be iterated.- Returns:
trueif fixedfalseotherwise
-
-