public class JRGridLayout extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
JRGridLayout.BoxKey |
Modifier | Constructor and Description |
---|---|
|
JRGridLayout(ExporterNature nature,
List<JRPrintElement> elements,
int width,
int height,
int offsetX,
int offsetY)
Constructor.
|
|
JRGridLayout(ExporterNature nature,
List<JRPrintElement> elements,
int width,
int height,
int offsetX,
int offsetY,
CutsInfo xCuts)
Constructor.
|
protected |
JRGridLayout(JRGridLayout parent,
List<JRPrintElement> elements,
int width,
int height,
int offsetX,
int offsetY,
PrintElementIndex parentElementIndex)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
addXCuts(ExporterNature nature,
List<JRPrintElement> elementsList,
int elementOffsetX,
CutsInfo xCuts)
This static method calculates the X cuts for a list of print elements and
stores them in the list indicated by the xCuts parameter.
|
static CutsInfo |
calculateXCuts(ExporterNature nature,
JasperPrint jasperPrint,
int startPageIndex,
int endPageIndex,
int offsetX)
This static method calculates all the X cuts for a list of pages.
|
protected GridCellSize |
cellSize(int width,
int height,
int colSpan,
int rowSpan) |
protected GridCellStyle |
cellStyle(Color backcolor,
Color forecolor,
JRLineBox box) |
protected JRExporterGridCell |
changeStyle(JRExporterGridCell cell,
GridCellStyle newStyle) |
protected void |
createCuts(List<JRPrintElement> elements,
int elementOffsetX,
int elementOffsetY,
boolean createXCuts) |
protected EmptyGridCell |
emptyCell(GridCellSize size,
GridCellStyle style) |
int |
getColumnWidth(int col) |
JRPrintElement |
getElement(PrintElementIndex parentIndex,
int index) |
Grid |
getGrid()
Returns the constructed element grid.
|
int |
getMaxRowHeight(int rowIndex) |
static int |
getRowHeight(GridRow row) |
int |
getRowHeight(int row) |
int |
getWidth()
Returns the width available for the grid.
|
CutsInfo |
getXCuts()
Returns the list of cut points on the X axis for the grid.
|
CutsInfo |
getYCuts()
Returns the list of cut points on the Y axis for the grid.
|
protected void |
horizontallyMergeEmptyCells(int startRow,
int startCol,
int endRow,
int endCol) |
protected boolean |
isEmpty(JRExporterGridCell cell) |
protected boolean |
isOverlap(int row1,
int col1,
int row2,
int col2) |
protected void |
layoutGrid(PrintElementIndex parentElementIndex,
List<JRPrintElement> elements)
Constructs the element grid.
|
protected void |
setFrameCellsStyle(JRPrintFrame frame,
int row1,
int col1,
int row2,
int col2) |
protected void |
setGridElement(JRPrintElement element,
PrintElementIndex parentIndex,
int elementIndex,
int row1,
int col1,
int row2,
int col2) |
protected void |
setGridElements(PrintElementIndex parentIndex,
List<JRPrintElement> elements,
int elementOffsetX,
int elementOffsetY,
int startRow,
int startCol,
int endRow,
int endCol) |
protected void |
setMargins(List<JRPrintElement> elements) |
protected void |
spanEmptyCell(int row,
int col,
int spanWidth,
int colSpan) |
public JRGridLayout(ExporterNature nature, List<JRPrintElement> elements, int width, int height, int offsetX, int offsetY)
elements
- the elements that should arranged in a gridwidth
- the width available for the gridheight
- the height available for the gridoffsetX
- horizontal element position offsetoffsetY
- vertical element position offsetpublic JRGridLayout(ExporterNature nature, List<JRPrintElement> elements, int width, int height, int offsetX, int offsetY, CutsInfo xCuts)
elements
- the elements that should arranged in a gridwidth
- the width available for the gridheight
- the height available for the gridoffsetX
- horizontal element position offsetoffsetY
- vertical element position offsetxCuts
- An optional list of pre-calculated X cuts.protected JRGridLayout(JRGridLayout parent, List<JRPrintElement> elements, int width, int height, int offsetX, int offsetY, PrintElementIndex parentElementIndex)
width
- the width available for the gridheight
- the height available for the gridoffsetX
- horizontal element position offsetoffsetY
- vertical element position offsetpublic JRPrintElement getElement(PrintElementIndex parentIndex, int index)
protected void layoutGrid(PrintElementIndex parentElementIndex, List<JRPrintElement> elements)
parentElementIndex
- protected GridCellSize cellSize(int width, int height, int colSpan, int rowSpan)
protected void createCuts(List<JRPrintElement> elements, int elementOffsetX, int elementOffsetY, boolean createXCuts)
protected void setMargins(List<JRPrintElement> elements)
protected void setGridElements(PrintElementIndex parentIndex, List<JRPrintElement> elements, int elementOffsetX, int elementOffsetY, int startRow, int startCol, int endRow, int endCol)
protected EmptyGridCell emptyCell(GridCellSize size, GridCellStyle style)
protected void horizontallyMergeEmptyCells(int startRow, int startCol, int endRow, int endCol)
protected void spanEmptyCell(int row, int col, int spanWidth, int colSpan)
protected boolean isEmpty(JRExporterGridCell cell)
protected boolean isOverlap(int row1, int col1, int row2, int col2)
protected void setGridElement(JRPrintElement element, PrintElementIndex parentIndex, int elementIndex, int row1, int col1, int row2, int col2)
protected GridCellStyle cellStyle(Color backcolor, Color forecolor, JRLineBox box)
protected void setFrameCellsStyle(JRPrintFrame frame, int row1, int col1, int row2, int col2)
protected JRExporterGridCell changeStyle(JRExporterGridCell cell, GridCellStyle newStyle)
public Grid getGrid()
public CutsInfo getXCuts()
public CutsInfo getYCuts()
public int getWidth()
public int getColumnWidth(int col)
public int getRowHeight(int row)
public int getMaxRowHeight(int rowIndex)
public static int getRowHeight(GridRow row)
public static CutsInfo calculateXCuts(ExporterNature nature, JasperPrint jasperPrint, int startPageIndex, int endPageIndex, int offsetX)
jasperPrint
- The JasperPrint document.startPageIndex
- The first page to consider.endPageIndex
- The last page to consider.offsetX
- horizontal element position offsetprotected static void addXCuts(ExporterNature nature, List<JRPrintElement> elementsList, int elementOffsetX, CutsInfo xCuts)
elementsList
- The list of elements to be used to determine the X cuts.elementOffsetX
- horizontal element position offsetxCuts
- The list to which the X cuts are to be added.Copyright © 2023 Cloud Software Group, Inc.. All rights reserved.