public class SheetLayout extends Object implements SlimSheetLayout, Cloneable
Constructor and Description |
---|
SheetLayout(boolean strict,
boolean ellipseAsRectangle)
Creates a new TableGrid-object.
|
SheetLayout(OutputProcessorMetaData metaData) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(RenderBox element,
long offset,
long headerSize,
long maxHeight)
Adds the bounds of the given TableCellData to the grid.
|
void |
addRenderableContent(RenderableReplacedContentBox element,
long offset,
long headerSize,
long maxHeight) |
void |
clear() |
void |
clearVerticalInfo() |
SheetLayout |
clone() |
SheetLayout |
derive() |
void |
ensureXMapping(long coordinate,
Boolean aux) |
void |
ensureYMapping(long coordinate,
Boolean aux) |
long |
getCellWidth(int startCell) |
long |
getCellWidth(int startCell,
int endCell)
Computes the height of the given row.
|
int |
getColSpan(int x1,
long endPosition) |
int |
getColumnCount()
The current number of columns.
|
long |
getMaxHeight() |
long |
getMaxWidth() |
int |
getRowCount()
The current number of rows.
|
long |
getRowHeight(int row)
Computes the height of the given row.
|
long |
getRowHeight(int startRow,
int endRow) |
int |
getRowSpan(int y1,
long endPosition) |
TableRectangle |
getTableBounds(long x,
long y,
long width,
long height,
TableRectangle rect)
Returns the position of the given element within the table.
|
TableRectangle |
getTableBounds(StrictBounds bounds,
TableRectangle rect)
Returns the position of the given element within the table.
|
TableRectangle |
getTableBoundsWithCache(long x,
long y,
long width,
long height,
TableRectangle rect) |
long |
getXPosition(int col) |
long |
getYPosition(int row) |
boolean |
isEmpty() |
boolean |
isStrict()
Gets the strict mode flag.
|
void |
pageCompleted()
A Callback method to inform the sheet layout, that the current page is complete, and no more content will be added.
|
protected void |
removeAuxilaryBounds() |
public SheetLayout(boolean strict, boolean ellipseAsRectangle)
strict
- the strict mode for the layout.ellipseAsRectangle
- a flag that defines whether ellipse-objects are translated into rectangles and therefore create
backgrounds.public SheetLayout(OutputProcessorMetaData metaData)
public SheetLayout derive()
public SheetLayout clone()
public boolean add(RenderBox element, long offset, long headerSize, long maxHeight)
element
- the position that should be added to the grid (might be null).offset
- the vertical shift which adjusts the visual position of the content.headerSize
- the vertical shift which adjusts the visual position of the content.NullPointerException
- if the bounds are nullpublic void addRenderableContent(RenderableReplacedContentBox element, long offset, long headerSize, long maxHeight)
public void ensureXMapping(long coordinate, Boolean aux)
public void ensureYMapping(long coordinate, Boolean aux)
public boolean isStrict()
public boolean isEmpty()
public TableRectangle getTableBounds(long x, long y, long width, long height, TableRectangle rect)
x
- the element bounds for which the table bounds should be found.y
- the element bounds for which the table bounds should be found.width
- the element bounds for which the table bounds should be found.height
- the element bounds for which the table bounds should be found.rect
- the returned rectangle or null, if a new instance should be createdpublic TableRectangle getTableBoundsWithCache(long x, long y, long width, long height, TableRectangle rect)
public int getColSpan(int x1, long endPosition)
public int getRowSpan(int y1, long endPosition)
public TableRectangle getTableBounds(StrictBounds bounds, TableRectangle rect)
getTableBounds
in interface SlimSheetLayout
bounds
- the element bounds for which the table bounds should be found.rect
- the returned rectangle or null, if a new instance should be createdpublic void pageCompleted()
protected void removeAuxilaryBounds()
public long getRowHeight(int row)
getRowHeight
in interface SlimSheetLayout
row
- the row, for which the height should be computed.IndexOutOfBoundsException
- if the row is invalid.public long getMaxHeight()
public long getMaxWidth()
getMaxWidth
in interface SlimSheetLayout
public long getCellWidth(int startCell)
getCellWidth
in interface SlimSheetLayout
public long getCellWidth(int startCell, int endCell)
getCellWidth
in interface SlimSheetLayout
startCell
- the first cell in the rangeendCell
- the last cell included in the cell rangeIndexOutOfBoundsException
- if the row is invalid.public long getRowHeight(int startRow, int endRow)
public int getColumnCount()
getColumnCount
in interface SlimSheetLayout
public int getRowCount()
public long getXPosition(int col)
getXPosition
in interface SlimSheetLayout
public long getYPosition(int row)
getYPosition
in interface SlimSheetLayout
public void clear()
public void clearVerticalInfo()
Copyright © 2017 Hitachi Vantara. All rights reserved.