public class BaseGridRenderer extends Object implements GridRenderer
GridRenderer.GridRendererContext, GridRenderer.RenderBodyGridBackgroundCommand, GridRenderer.RenderBodyGridContentCommand, GridRenderer.RenderBodyGridLinesCommand, GridRenderer.RendererBodyCommand, GridRenderer.RendererCommand, GridRenderer.RendererHeaderCommand, GridRenderer.RenderGridBoundaryCommand, GridRenderer.RenderHeaderBackgroundCommand, GridRenderer.RenderHeaderContentCommand, GridRenderer.RenderHeaderGridLinesCommand, GridRenderer.RenderSelectedCellsCommand, GridRenderer.RenderSelectorCommand
Modifier and Type | Field and Description |
---|---|
protected BiFunction<Boolean,GridColumn<?>,Boolean> |
columnRenderingConstraint |
protected GridRendererTheme |
theme |
Constructor and Description |
---|
BaseGridRenderer(GridRendererTheme theme) |
Modifier and Type | Method and Description |
---|---|
void |
clearCellHighlight() |
double |
getHeaderHeight()
Returns the height of the header built by this renderer.
|
double |
getHeaderRowHeight()
Returns the height of a single row in the header.
|
Integer |
getHighlightCellColumnIndex() |
Integer |
getHighlightCellRowIndex() |
GridRendererTheme |
getTheme()
Returns the theme.
|
void |
highlightCell(int column,
int row) |
boolean |
onGroupingToggle(double cellX,
double cellY,
double cellWidth,
double cellHeight)
Checks whether a cell-relative coordinate is "on" the hot-spot to toggle the collapsed/expanded state.
|
List<GridRenderer.RendererCommand> |
renderBody(GridData model,
GridBodyRenderContext context,
BaseGridRendererHelper rendererHelper,
BaseGridRendererHelper.RenderingInformation renderingInformation)
Renders the body for the Grid.
|
GridRenderer.RendererCommand |
renderGridBoundary(GridBoundaryRenderContext context)
Renders a boundary around the grid.
|
List<GridRenderer.RendererCommand> |
renderHeader(GridData model,
GridHeaderRenderContext context,
BaseGridRendererHelper rendererHelper,
BaseGridRendererHelper.RenderingInformation renderingInformation)
Renders the header for the Grid.
|
GridRenderer.RendererCommand |
renderHeaderBodyDivider(double width)
Renders a divider between Grid header and body.
|
GridRenderer.RendererCommand |
renderSelectedCells(GridData model,
GridBodyRenderContext context,
BaseGridRendererHelper rendererHelper,
List<GridData.SelectedCell> selectedCells,
BiFunction<SelectedRange,Integer,Double> selectedCellsYOffsetStrategy,
Function<SelectedRange,Double> selectedCellsHeightStrategy)
Renders the selected ranges and append to the Body Group.
|
protected com.ait.lienzo.client.core.shape.Group |
renderSelectedRange(List<GridColumn<?>> blockColumns,
int minVisibleUiColumnIndex,
SelectedRange selectedRange,
Function<SelectedRange,Double> selectedCellsHeightStrategy) |
GridRenderer.RendererCommand |
renderSelector(double width,
double height,
BaseGridRendererHelper.RenderingInformation renderingInformation)
Renders a "selector" when a grid has been selected, i.e. clicked.
|
void |
setColumnRenderConstraint(BiFunction<Boolean,GridColumn<?>,Boolean> columnRenderingConstraint)
Sets the constraint to control rendering of columns.
|
void |
setTheme(GridRendererTheme theme)
Sets the theme.
|
protected GridRendererTheme theme
protected BiFunction<Boolean,GridColumn<?>,Boolean> columnRenderingConstraint
public BaseGridRenderer(GridRendererTheme theme)
public double getHeaderHeight()
GridRenderer
GridColumn.HeaderMetaData
) and GridRenderer.getHeaderRowHeight()
.
Header rows are always positioned adjacent to the Body.getHeaderHeight
in interface GridRenderer
public double getHeaderRowHeight()
GridRenderer
getHeaderRowHeight
in interface GridRenderer
public GridRendererTheme getTheme()
GridRenderer
getTheme
in interface GridRenderer
public void setTheme(GridRendererTheme theme)
GridRenderer
setTheme
in interface GridRenderer
public GridRenderer.RendererCommand renderSelector(double width, double height, BaseGridRendererHelper.RenderingInformation renderingInformation)
GridRenderer
renderSelector
in interface GridRenderer
width
- The width of the GridWidget.height
- The height of the GridWidget including header and body.renderingInformation
- Calculated rendering information supporting rendering.public GridRenderer.RendererCommand renderSelectedCells(GridData model, GridBodyRenderContext context, BaseGridRendererHelper rendererHelper, List<GridData.SelectedCell> selectedCells, BiFunction<SelectedRange,Integer,Double> selectedCellsYOffsetStrategy, Function<SelectedRange,Double> selectedCellsHeightStrategy)
GridRenderer
renderSelectedCells
in interface GridRenderer
model
- The data model for the GridWidget.context
- The context of the render phase.rendererHelper
- Helper for rendering.selectedCells
- The cells that are selected.selectedCellsYOffsetStrategy
- A function that returns the YOffset of a selection.selectedCellsHeightStrategy
- A function that returns the height of a selection.protected com.ait.lienzo.client.core.shape.Group renderSelectedRange(List<GridColumn<?>> blockColumns, int minVisibleUiColumnIndex, SelectedRange selectedRange, Function<SelectedRange,Double> selectedCellsHeightStrategy)
public List<GridRenderer.RendererCommand> renderHeader(GridData model, GridHeaderRenderContext context, BaseGridRendererHelper rendererHelper, BaseGridRendererHelper.RenderingInformation renderingInformation)
GridRenderer
renderHeader
in interface GridRenderer
model
- The data model for the GridWidget.context
- The context of the render phase.rendererHelper
- Helper for rendering.renderingInformation
- Calculated rendering information supporting rendering.public GridRenderer.RendererCommand renderHeaderBodyDivider(double width)
GridRenderer
GridRenderer.getHeaderHeight()
.
The returned Group itself is not positioned when added to the Grid. This is to support different types of divider
that may need to be positioned at a y-coordinate different to GridRenderer.getHeaderHeight()
.renderHeaderBodyDivider
in interface GridRenderer
width
- The width of the divider. May not be the width of the whole grid if there are floating columns.public List<GridRenderer.RendererCommand> renderBody(GridData model, GridBodyRenderContext context, BaseGridRendererHelper rendererHelper, BaseGridRendererHelper.RenderingInformation renderingInformation)
GridRenderer
renderBody
in interface GridRenderer
model
- The data model for the GridWidget.context
- The context of the render phase.rendererHelper
- Helper for rendering.renderingInformation
- Calculated rendering information supporting rendering.public GridRenderer.RendererCommand renderGridBoundary(GridBoundaryRenderContext context)
GridRenderer
renderGridBoundary
in interface GridRenderer
context
- The context of the render phase.public boolean onGroupingToggle(double cellX, double cellY, double cellWidth, double cellHeight)
GridRenderer
onGroupingToggle
in interface GridRenderer
cellX
- The MouseEvent relative to the cell's x-coordinate.cellY
- The MouseEvent relative to the cell's y-coordinate.cellWidth
- Width of the containing cell.cellHeight
- Height of the containing cell.public void setColumnRenderConstraint(BiFunction<Boolean,GridColumn<?>,Boolean> columnRenderingConstraint)
GridRenderer
setColumnRenderConstraint
in interface GridRenderer
public void clearCellHighlight()
public void highlightCell(int column, int row)
public Integer getHighlightCellColumnIndex()
public Integer getHighlightCellRowIndex()
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.