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()
GridRendererGridColumn.HeaderMetaData) and GridRenderer.getHeaderRowHeight().
Header rows are always positioned adjacent to the Body.getHeaderHeight in interface GridRendererpublic double getHeaderRowHeight()
GridRenderergetHeaderRowHeight in interface GridRendererpublic GridRendererTheme getTheme()
GridRenderergetTheme in interface GridRendererpublic void setTheme(GridRendererTheme theme)
GridRenderersetTheme in interface GridRendererpublic GridRenderer.RendererCommand renderSelector(double width, double height, BaseGridRendererHelper.RenderingInformation renderingInformation)
GridRendererrenderSelector in interface GridRendererwidth - 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)
GridRendererrenderSelectedCells in interface GridRenderermodel - 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)
GridRendererrenderHeader in interface GridRenderermodel - 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)
GridRendererGridRenderer.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 GridRendererwidth - 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)
GridRendererrenderBody in interface GridRenderermodel - 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)
GridRendererrenderGridBoundary in interface GridRenderercontext - The context of the render phase.public boolean onGroupingToggle(double cellX,
double cellY,
double cellWidth,
double cellHeight)
GridRendereronGroupingToggle in interface GridRenderercellX - 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)
GridRenderersetColumnRenderConstraint in interface GridRendererpublic void clearCellHighlight()
public void highlightCell(int column,
int row)
public Integer getHighlightCellColumnIndex()
public Integer getHighlightCellRowIndex()
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.