本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext类的典型用法代码示例。如果您正苦于以下问题:Java GridBodyRenderContext类的具体用法?Java GridBodyRenderContext怎么用?Java GridBodyRenderContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridBodyRenderContext类属于org.uberfire.ext.wires.core.grids.client.widget.context包,在下文中一共展示了GridBodyRenderContext类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderBody
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
@Override
public List<RendererCommand> renderBody(final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
final List<RendererCommand> commands = super.renderBody(model,
context,
rendererHelper,
renderingInformation);
if (!(rowHighlightRowIndexes == null || rowHighlightRowIndexes.isEmpty())) {
commands.addAll(renderRowHighlights(model,
context,
rendererHelper,
renderingInformation));
}
return commands;
}
示例2: renderRowHighlights
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
List<RendererCommand> renderRowHighlights(final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
final List<RendererCommand> commands = new ArrayList<>();
rowHighlightRowIndexes.stream().forEach((rowIndex) -> {
final int _rowIndex = rowIndex - 1;
final int _visibleRowIndex = _rowIndex - renderingInformation.getMinVisibleRowIndex();
if (_rowIndex >= 0 && _rowIndex < model.getRowCount()) {
if (_visibleRowIndex >= 0 && _visibleRowIndex < model.getRowCount()) {
commands.add((RenderSelectedCellsCommand) (parent) -> {
parent.add(makeRowHighlight(_rowIndex,
_visibleRowIndex,
model,
context,
rendererHelper));
});
}
}
});
return commands;
}
示例3: makeRowHighlight
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
Rectangle makeRowHighlight(final int _rowIndex,
final int _visibleRowIndex,
final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper) {
final Rectangle r = new Rectangle(0,
0).setAlpha(0.3).setFillColor(ColorName.ORANGE).setListening(false);
r.setY(rendererHelper.getRowOffset(_visibleRowIndex));
r.setWidth(rendererHelper.getWidth(context.getBlockColumns()));
r.setHeight(model.getRow(_rowIndex).getHeight());
switch (rowHighlightSeverity) {
case NOTE:
r.setFillColor(ColorName.LIGHTBLUE);
break;
case WARNING:
r.setFillColor(ColorName.ORANGE);
break;
case ERROR:
r.setFillColor(ColorName.RED);
break;
}
return r;
}
示例4: renderGridBodyWidget
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
/**
* Render the Widget's Body and append to this Group.
* @param blockColumns The columns to render.
* @param absoluteColumnOffsetX Absolute offset from Grid's X co-ordinate to render first column in block.
* @param minVisibleRowIndex The index of the first visible row.
* @param maxVisibleRowIndex The index of the last visible row.
* @param isSelectionLayer Is the SelectionLayer being rendered.
* @param transformer SelectionTransformer in operation.
*/
protected Group renderGridBodyWidget(final List<GridColumn<?>> blockColumns,
final double absoluteColumnOffsetX,
final int minVisibleRowIndex,
final int maxVisibleRowIndex,
final boolean isSelectionLayer,
final SelectionsTransformer transformer,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
final double floatingX = floatingBlockInformation.getX();
final double floatingWidth = floatingBlockInformation.getWidth();
final double clipMinY = getAbsoluteY() + (header == null ? 0.0 : header.getY() + getRenderer().getHeaderHeight());
final double clipMinX = getAbsoluteX() + floatingX + floatingWidth;
final GridBodyRenderContext context = new GridBodyRenderContext(getAbsoluteX(),
getAbsoluteY(),
absoluteColumnOffsetX,
clipMinY,
clipMinX,
minVisibleRowIndex,
maxVisibleRowIndex,
blockColumns,
isSelectionLayer,
getViewport().getTransform(),
renderer,
transformer);
final Group g = renderer.renderBody(model,
context,
rendererHelper,
renderingInformation);
return g;
}
示例5: renderSelectedRanges
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
/**
* Render the selected ranges and append to the Body Group.
* @param blockColumns The columns to render.
* @param absoluteColumnOffsetX Absolute offset from Grid's X co-ordinate to render first column in block.
* @param minVisibleRowIndex The index of the first visible row.
* @param maxVisibleRowIndex The index of the last visible row.
* @param transformer SelectionTransformer in operation.
* @return
*/
protected Group renderSelectedRanges(final List<GridColumn<?>> blockColumns,
final double absoluteColumnOffsetX,
final int minVisibleRowIndex,
final int maxVisibleRowIndex,
final SelectionsTransformer transformer,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
final double floatingX = floatingBlockInformation.getX();
final double floatingWidth = floatingBlockInformation.getWidth();
final double clipMinY = getAbsoluteY() + (header == null ? 0.0 : header.getY() + getRenderer().getHeaderHeight());
final double clipMinX = getAbsoluteX() + floatingX + floatingWidth;
final GridBodyRenderContext context = new GridBodyRenderContext(getAbsoluteX(),
getAbsoluteY(),
absoluteColumnOffsetX,
clipMinY,
clipMinX,
minVisibleRowIndex,
maxVisibleRowIndex,
blockColumns,
false,
getViewport().getTransform(),
renderer,
transformer);
final Group g = renderer.renderSelectedCells(model,
context,
rendererHelper);
return g;
}
示例6: mockBody
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void mockBody() {
when(renderer.renderBody(any(GridData.class),
any(GridBodyRenderContext.class),
eq(rendererHelper),
any(BaseGridRendererHelper.RenderingInformation.class))).thenReturn(body);
when(body.asNode()).thenReturn(mock(Node.class));
}
示例7: renderSelectedCells
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
@Override
public Group renderSelectedCells(final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper) {
final List<GridColumn<?>> blockColumns = context.getBlockColumns();
final SelectionsTransformer transformer = context.getTransformer();
final int minVisibleUiColumnIndex = model.getColumns().indexOf(blockColumns.get(0));
final int maxVisibleUiColumnIndex = model.getColumns().indexOf(blockColumns.get(blockColumns.size() - 1));
final int minVisibleUiRowIndex = context.getMinVisibleRowIndex();
final int maxVisibleUiRowIndex = context.getMaxVisibleRowIndex();
//Convert SelectedCells into SelectedRanges, i.e. group them into rectangular ranges
final List<SelectedRange> selectedRanges = transformer.transformToSelectedRanges();
final Group g = new Group();
for (SelectedRange selectedRange : selectedRanges) {
final int rangeOriginUiColumnIndex = selectedRange.getUiColumnIndex();
final int rangeOriginUiRowIndex = selectedRange.getUiRowIndex();
final int rangeUiWidth = selectedRange.getWidth();
final int rangeUiHeight = selectedRange.getHeight();
//Only render range highlights if they're at least partially visible
if (rangeOriginUiColumnIndex + rangeUiWidth - 1 < minVisibleUiColumnIndex) {
continue;
}
if (rangeOriginUiColumnIndex > maxVisibleUiColumnIndex) {
continue;
}
if (rangeOriginUiRowIndex + rangeUiHeight - 1 < minVisibleUiRowIndex) {
continue;
}
if (rangeOriginUiRowIndex > maxVisibleUiRowIndex) {
continue;
}
//Clip range to visible bounds
SelectedRange _selectedRange = selectedRange;
if (rangeOriginUiRowIndex < minVisibleUiRowIndex) {
final int dy = minVisibleUiRowIndex - rangeOriginUiRowIndex;
_selectedRange = new SelectedRange(selectedRange.getUiRowIndex() + dy,
selectedRange.getUiColumnIndex(),
selectedRange.getWidth(),
selectedRange.getHeight() - dy);
}
final Group cs = renderSelectedRange(model,
blockColumns,
minVisibleUiColumnIndex,
_selectedRange);
if (cs != null) {
final double csx = rendererHelper.getColumnOffset(blockColumns,
_selectedRange.getUiColumnIndex() - minVisibleUiColumnIndex);
final double csy = rendererHelper.getRowOffset(_selectedRange.getUiRowIndex()) - rendererHelper.getRowOffset(minVisibleUiRowIndex);
cs.setX(csx)
.setY(csy)
.setListening(false);
g.add(cs);
}
}
return g;
}
示例8: setup
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
@Before
@Override
public void setup() {
super.setup();
doReturn(false).when(context).isSelection();
doReturn(new BaseBounds(0, 0, 1000, 1000)).when(gridLayer).getVisibleBounds();
grid.getModel().appendColumn(new RowNumberColumn());
grid.getModel().appendRow(new DMNGridRow());
doReturn(renderSelectorCommand).when(renderer).renderSelector(anyDouble(),
anyDouble(),
any(BaseGridRendererHelper.RenderingInformation.class));
doReturn(renderSelectedCellsCommand).when(renderer).renderSelectedCells(any(GridData.class),
any(GridBodyRenderContext.class),
any(BaseGridRendererHelper.class));
final List<RendererCommand> renderHeaderCommands = new ArrayList<>();
renderHeaderCommands.add(renderHeaderBackgroundCommand);
renderHeaderCommands.add(renderHeaderGridLinesCommand);
renderHeaderCommands.add(renderHeaderContentCommand);
doReturn(renderHeaderCommands).when(renderer).renderHeader(any(GridData.class),
any(GridHeaderRenderContext.class),
any(BaseGridRendererHelper.class),
any(BaseGridRendererHelper.RenderingInformation.class));
final List<RendererCommand> renderBodyCommands = new ArrayList<>();
renderBodyCommands.add(renderBodyGridBackgroundCommand);
renderBodyCommands.add(renderBodyGridLinesCommand);
renderBodyCommands.add(renderBodyGridContentCommand);
doReturn(renderBodyCommands).when(renderer).renderBody(any(GridData.class),
any(GridBodyRenderContext.class),
any(BaseGridRendererHelper.class),
any(BaseGridRendererHelper.RenderingInformation.class));
doReturn(renderHeaderBodyDividerCommand).when(renderer).renderHeaderBodyDivider(anyDouble());
doReturn(renderGridBoundaryCommand).when(renderer).renderGridBoundary(any(GridBoundaryRenderContext.class));
doReturn(BaseExpressionGridRenderer.HEADER_HEIGHT).when(renderer).getHeaderHeight();
}
示例9: renderSelectedCells
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
/**
* Renders the selected ranges and append to the Body Group.
* @param model The data model for the GridWidget.
* @param context The context of the render phase.
* @param rendererHelper Helper for rendering.
* @return
*/
Group renderSelectedCells(final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper);
示例10: renderBody
import org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyRenderContext; //导入依赖的package包/类
/**
* Renders the body for the Grid.
* @param model The data model for the GridWidget.
* @param context The context of the render phase.
* @param rendererHelper Helper for rendering.
* @param renderingInformation Calculated rendering information supporting rendering.
* @return A Group containing all Shapes representing the Body.
*/
Group renderBody(final GridData model,
final GridBodyRenderContext context,
final BaseGridRendererHelper rendererHelper,
final BaseGridRendererHelper.RenderingInformation renderingInformation);