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.ObjectThis class is used to properly initialize starting values for grid.
-
-
Field Summary
Fields Modifier and Type Field Description private intexplicitColumnCountprivate intexplicitRowCountprivate GridFlowflowprivate java.util.List<IRenderer>values
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Gridbuild()Build a grid with provided properties.private static intcalculateInitialColumnsCount(java.util.Collection<GridCell> cells)private static intcalculateInitialRowsCount(java.util.Collection<GridCell> cells)Grid.Buildercolumns(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.Builderflow(GridFlow flow)Set iteration flow for a grid.(package private) static Grid.BuilderforItems(java.util.List<IRenderer> values)Get grid builder for list of values.(package private) static java.util.Comparator<GridCell>getOrderingFunctionForFlow(GridFlow flow)Grid.Builderrows(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
Gridinstance.
-
calculateInitialColumnsCount
private static int calculateInitialColumnsCount(java.util.Collection<GridCell> cells)
-
calculateInitialRowsCount
private static int calculateInitialRowsCount(java.util.Collection<GridCell> cells)
-
-