Package com.itextpdf.layout.renderer
Class Grid.Builder
- java.lang.Object
-
- com.itextpdf.layout.renderer.Grid.Builder
-
- Enclosing class:
- Grid
static final class Grid.Builder extends java.lang.Object
This class is used to properly initialize starting values for grid.
-
-
Field Summary
Fields Modifier and Type Field Description private int
explicitColumnCount
private int
explicitRowCount
private GridFlow
flow
private java.util.List<IRenderer>
values
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Grid
build()
Build a grid with provided properties.private static int
calculateInitialColumnsCount(java.util.Collection<GridCell> cells)
private static int
calculateInitialRowsCount(java.util.Collection<GridCell> cells)
Grid.Builder
columns(int explicitColumnCount)
Set number of columns for a grid, the result will be either a provided one or if some elements have a property defining more columns on a grid than provided value it will be set instead.Grid.Builder
flow(GridFlow flow)
Set iteration flow for a grid.(package private) static Grid.Builder
forItems(java.util.List<IRenderer> values)
Get grid builder for list of values.(package private) static java.util.Comparator<GridCell>
getOrderingFunctionForFlow(GridFlow flow)
Grid.Builder
rows(int explicitRowCount)
Set number of rows for a grid, the result will be either a provided one or if some elements have a property defining more rows on a grid than provided value it will be set instead.
-
-
-
Method Detail
-
forItems
static Grid.Builder forItems(java.util.List<IRenderer> values)
Get grid builder for list of values.- Parameters:
values
- values to layout on grid- Returns:
- new grid builder instance
-
columns
public Grid.Builder columns(int explicitColumnCount)
Set number of columns for a grid, the result will be either a provided one or if some elements have a property defining more columns on a grid than provided value it will be set instead.- Parameters:
explicitColumnCount
- explicit column count of a grid- Returns:
- current builder instance
-
rows
public Grid.Builder rows(int explicitRowCount)
Set number of rows for a grid, the result will be either a provided one or if some elements have a property defining more rows on a grid than provided value it will be set instead.- Parameters:
explicitRowCount
- explicit height of a grid- Returns:
- current builder instance
-
flow
public Grid.Builder flow(GridFlow flow)
Set iteration flow for a grid.- Parameters:
flow
- iteration flow- Returns:
- current builder instance
-
build
public Grid build()
Build a grid with provided properties.- Returns:
- new
Grid
instance.
-
calculateInitialColumnsCount
private static int calculateInitialColumnsCount(java.util.Collection<GridCell> cells)
-
calculateInitialRowsCount
private static int calculateInitialRowsCount(java.util.Collection<GridCell> cells)
-
-