本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper类的典型用法代码示例。如果您正苦于以下问题:Java BaseGridRendererHelper类的具体用法?Java BaseGridRendererHelper怎么用?Java BaseGridRendererHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BaseGridRendererHelper类属于org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl包,在下文中一共展示了BaseGridRendererHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getUiColumnIndex
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
/**
* Gets the column index corresponding to the provided Canvas x-coordinate relative to the grid. Grid-relative coordinates can be
* obtained from {@link INodeXYEvent} using {@link CoordinateUtilities#convertDOMToGridCoordinate(GridWidget, Point2D)}
* @param gridWidget GridWidget to check.
* @param cx x-coordinate relative to the GridWidget.
* @return The column index or null if the coordinate did not map to a cell.
*/
public static Integer getUiColumnIndex(final GridWidget gridWidget,
final double cx) {
final GridData gridModel = gridWidget.getModel();
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
if (cx < 0 || cx > gridWidget.getWidth()) {
return null;
}
//Get column index
final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx);
final GridColumn<?> column = ci.getColumn();
final int uiColumnIndex = ci.getUiColumnIndex();
if (column == null) {
return null;
}
if (uiColumnIndex < 0 || uiColumnIndex > gridModel.getColumnCount() - 1) {
return null;
}
return uiColumnIndex;
}
示例2: renderColumn
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Override
public Group renderColumn(final GridColumn<?> column,
final GridBodyColumnRenderContext context,
final BaseGridRendererHelper rendererHelper,
final BaseGridRendererHelper.RenderingInformation renderingInformation) {
if (context.getModel().isMerged()) {
return renderColumnMerged.render(column,
context,
rendererHelper,
renderingInformation);
} else {
return renderColumnFlattened.render(column,
context,
rendererHelper,
renderingInformation);
}
}
示例3: startEditingCell
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Override
public boolean startEditingCell(final Point2D ap) {
//Get row information
final Integer uiRowIndex = CoordinateUtilities.getUiRowIndex(gridWidget,
ap.getY());
if (uiRowIndex == null) {
return false;
}
//Get column information
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(ap.getX());
final GridColumn<?> column = ci.getColumn();
if (column == null) {
return false;
}
return edit(uiRowIndex,
ci);
}
示例4: getFloatingColumnInformation
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
private BaseGridRendererHelper.ColumnInformation getFloatingColumnInformation(final int uiColumnIndex) {
final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex);
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns();
if (!floatingColumns.contains(column)) {
return null;
}
return new BaseGridRendererHelper.ColumnInformation(column,
uiColumnIndex,
floatingBlockInformation.getX() + rendererHelper.getColumnOffset(floatingColumns,
floatingColumns.indexOf(column)));
}
示例5: getBodyColumnInformation
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
private BaseGridRendererHelper.ColumnInformation getBodyColumnInformation(final int uiColumnIndex) {
final GridColumn<?> column = gridModel.getColumns().get(uiColumnIndex);
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation();
final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
if (!bodyColumns.contains(column)) {
return null;
}
return new BaseGridRendererHelper.ColumnInformation(column,
uiColumnIndex,
bodyBlockInformation.getX() + rendererHelper.getColumnOffset(bodyColumns,
bodyColumns.indexOf(column)));
}
示例6: getRowOffset
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
private double getRowOffset(final int uiRowIndex,
final int uiColumnIndex,
final BaseGridRendererHelper rendererHelper) {
final GridCell<?> cell = gridModel.getCell(uiRowIndex,
uiColumnIndex);
if (cell == null) {
return rendererHelper.getRowOffset(uiRowIndex);
}
if (cell.getMergedCellCount() == 1) {
return rendererHelper.getRowOffset(uiRowIndex);
} else if (cell.getMergedCellCount() > 1) {
return rendererHelper.getRowOffset(uiRowIndex);
} else {
int _uiRowIndex = uiRowIndex;
GridCell<?> _cell = cell;
while (_cell.getMergedCellCount() == 0) {
_uiRowIndex--;
_cell = gridModel.getCell(_uiRowIndex,
uiColumnIndex);
}
return rendererHelper.getRowOffset(_uiRowIndex);
}
}
示例7: isGridColumnCandidateForScroll
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
private boolean isGridColumnCandidateForScroll(final GridWidget gridWidget) {
final GridData gridModel = gridWidget.getModel();
final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
if (renderingInformation == null) {
return false;
}
final List<GridColumn<?>> columns = gridModel.getColumns();
final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(columns,
origin.getColumnIndex());
final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns();
final GridColumn<?> column = columns.get(uiColumnIndex);
return !floatingColumns.contains(column);
}
示例8: showRowHighlight
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
protected void showRowHighlight(final GridWidget view,
final List<GridRow> activeGridRows) {
final BaseGridRendererHelper rendererHelper = view.getRendererHelper();
final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
if (renderingInformation == null) {
return;
}
final Bounds bounds = renderingInformation.getBounds();
final GridRow row = activeGridRows.get(0);
final double rowOffsetY = rendererHelper.getRowOffset(row) + view.getRenderer().getHeaderHeight();
final double highlightWidth = Math.min(bounds.getX() + bounds.getWidth() - view.getAbsoluteX(),
view.getWidth());
final double highlightHeight = row.getHeight();
state.getEventColumnHighlight().setWidth(highlightWidth)
.setHeight(highlightHeight)
.setX(view.getAbsoluteX())
.setY(view.getAbsoluteY() + rowOffsetY);
layer.add(state.getEventColumnHighlight());
layer.getLayer().batch();
}
示例9: setup
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Before
public void setup() {
gridWidgetData = new BaseGridData();
gridWidgetData.appendRow(new BaseGridRow(ROW_HEIGHT));
gridWidgetData.appendRow(new BaseGridRow(ROW_HEIGHT));
gridWidgetData.appendColumn(col1);
gridWidgetData.appendColumn(col2);
when(gridWidget.getModel()).thenReturn(gridWidgetData);
cellSelectionManager = new BaseCellSelectionManager(gridWidget);
gridWidgetRendererHelper = new BaseGridRendererHelper(gridWidget);
when(gridWidget.getRenderer()).thenReturn(gridWidgetRenderer);
when(gridWidget.getRendererHelper()).thenReturn(gridWidgetRendererHelper);
when(gridWidget.getLayer()).thenReturn(gridLayer);
when(gridWidget.getWidth()).thenReturn(200.0);
when(gridWidget.getHeader()).thenReturn(gridWidgetHeader);
when(gridWidget.getHeight()).thenReturn(HEADER_HEIGHT + (ROW_HEIGHT * 2));
when(gridWidget.getViewport()).thenReturn(viewport);
when(gridWidget.getX()).thenReturn(0.0);
when(gridWidget.getY()).thenReturn(0.0);
when(gridLayer.getVisibleBounds()).thenReturn(visibleBounds);
when(gridWidgetRenderer.getHeaderHeight()).thenReturn(HEADER_HEIGHT);
when(viewport.getTransform()).thenReturn(transform);
}
示例10: setup
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Before
public void setup() {
this.model = new BaseGridData();
final BaseGridWidget wrapped = new BaseGridWidget(model,
selectionManager,
pinnedModeManager,
renderer) {
@Override
protected CellSelectionManager getCellSelectionManager() {
return BaseGridWidgetRenderingTest.this.cellSelectionManager;
}
@Override
protected BaseGridRendererHelper getBaseGridRendererHelper() {
return BaseGridWidgetRenderingTest.this.rendererHelper;
}
};
gridWidget = spy(wrapped);
mockCanvas();
mockHeader();
mockBody();
mockBoundary();
}
示例11: makeRenderingInformation
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
private BaseGridRendererHelper.RenderingInformation makeRenderingInformation(final List<Double> rowOffsets) {
return new BaseGridRendererHelper.RenderingInformation(mock(Bounds.class),
model.getColumns(),
new BaseGridRendererHelper.RenderingBlockInformation(model.getColumns(),
0.0,
0.0,
0.0,
100),
new BaseGridRendererHelper.RenderingBlockInformation(Collections.emptyList(),
0.0,
0.0,
0.0,
0.0),
0,
rowOffsets.size() - 1,
rowOffsets,
false,
false,
0,
2,
0);
}
示例12: basicCheckForBodyHandlerWithinBodyBounds
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Test
public void basicCheckForBodyHandlerWithinBodyBounds() {
when(gridWidget.isVisible()).thenReturn(true);
when(event.getX()).thenReturn(100);
when(event.getY()).thenReturn(200);
final BaseGridRendererHelper.ColumnInformation ci = new BaseGridRendererHelper.ColumnInformation(uiColumn,
0,
0);
when(helper.getColumnInformation(any(Double.class))).thenReturn(ci);
handler.onNodeMouseClick(event);
verify(handler,
times(1)).handleBodyCellClick(any(NodeMouseClickEvent.class));
verify(gridWidget,
times(1)).selectCell(any(Point2D.class),
eq(false),
eq(false));
}
示例13: basicCheckForBodyHandlerOutsideBodyBounds
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Test
public void basicCheckForBodyHandlerOutsideBodyBounds() {
when(gridWidget.isVisible()).thenReturn(true);
when(event.getX()).thenReturn(100);
when(event.getY()).thenReturn(120);
final BaseGridRendererHelper.ColumnInformation ci = new BaseGridRendererHelper.ColumnInformation(uiColumn,
0,
0);
when(helper.getColumnInformation(any(Double.class))).thenReturn(ci);
handler.onNodeMouseClick(event);
verify(handler,
times(1)).handleBodyCellClick(any(NodeMouseClickEvent.class));
verify(uiModel,
never()).getCell(any(Integer.class),
any(Integer.class));
}
示例14: basicCheckForBodyHandler
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Test
public void basicCheckForBodyHandler() {
when(gridWidget.isVisible()).thenReturn(true);
when(event.getX()).thenReturn(100);
when(event.getY()).thenReturn(200);
when(gridWidget.getLocation()).thenReturn(new Point2D(100,
100));
when(gridWidget.getHeight()).thenReturn(200.0);
final BaseGridRendererHelper.ColumnInformation ci = new BaseGridRendererHelper.ColumnInformation(uiColumn,
0,
0);
when(helper.getColumnInformation(any(Double.class))).thenReturn(ci);
handler.onNodeMouseDoubleClick(event);
verify(handler,
times(1)).handleHeaderCellDoubleClick(any(NodeMouseDoubleClickEvent.class));
verify(handler,
times(1)).handleBodyCellDoubleClick(any(NodeMouseDoubleClickEvent.class));
}
示例15: selectVisibleGridBody
import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入依赖的package包/类
@Test
public void selectVisibleGridBody() {
when(gridWidget.isVisible()).thenReturn(true);
when(event.getX()).thenReturn(100);
when(event.getY()).thenReturn(200);
when(gridWidget.getLocation()).thenReturn(new Point2D(100,
100));
when(gridWidget.getHeight()).thenReturn(200.0);
final BaseGridRendererHelper.ColumnInformation ci = new BaseGridRendererHelper.ColumnInformation(uiColumn,
0,
0);
when(helper.getColumnInformation(any(Double.class))).thenReturn(ci);
handler.onNodeMouseClick(event);
verify(handler,
times(1)).handleHeaderCellClick(any(NodeMouseClickEvent.class));
verify(handler,
times(1)).handleBodyCellClick(any(NodeMouseClickEvent.class));
verify(selectionManager,
times(1)).select(eq(gridWidget));
}