当前位置: 首页>>代码示例>>Java>>正文


Java GridWidget.getRendererHelper方法代码示例

本文整理汇总了Java中org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget.getRendererHelper方法的典型用法代码示例。如果您正苦于以下问题:Java GridWidget.getRendererHelper方法的具体用法?Java GridWidget.getRendererHelper怎么用?Java GridWidget.getRendererHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget的用法示例。


在下文中一共展示了GridWidget.getRendererHelper方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUiColumnIndex

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:31,代码来源:CoordinateUtilities.java

示例2: isGridColumnCandidateForScroll

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BaseKeyboardOperation.java

示例3: showRowHighlight

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的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();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:GridWidgetDnDMouseDownHandler.java

示例4: BaseGridWidgetMouseClickHandler

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
public BaseGridWidgetMouseClickHandler(final GridWidget gridWidget,
                                       final GridSelectionManager selectionManager,
                                       final GridRenderer renderer) {
    this.gridWidget = gridWidget;
    this.gridModel = gridWidget.getModel();
    this.rendererHelper = gridWidget.getRendererHelper();
    this.selectionManager = selectionManager;
    this.renderer = renderer;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:BaseGridWidgetMouseClickHandler.java

示例5: GridCellSelectorMouseClickHandler

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
public GridCellSelectorMouseClickHandler(final GridWidget gridWidget,
                                         final GridSelectionManager selectionManager,
                                         final GridRenderer renderer) {
    this.gridWidget = gridWidget;
    this.gridModel = gridWidget.getModel();
    this.rendererHelper = gridWidget.getRendererHelper();
    this.selectionManager = selectionManager;
    this.renderer = renderer;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:GridCellSelectorMouseClickHandler.java

示例6: BaseGridWidgetMouseDoubleClickHandler

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
public BaseGridWidgetMouseDoubleClickHandler(final GridWidget gridWidget,
                                             final GridSelectionManager selectionManager,
                                             final GridPinnedModeManager pinnedModeManager,
                                             final GridRenderer renderer) {
    this.gridWidget = gridWidget;
    this.gridModel = gridWidget.getModel();
    this.rendererHelper = gridWidget.getRendererHelper();
    this.selectionManager = selectionManager;
    this.pinnedModeManager = pinnedModeManager;
    this.renderer = renderer;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:12,代码来源:BaseGridWidgetMouseDoubleClickHandler.java

示例7: showColumnHighlight

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected void showColumnHighlight(final GridWidget view,
                                   final List<GridColumn<?>> activeGridColumns) {
    final BaseGridRendererHelper rendererHelper = view.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    if (renderingInformation == null) {
        return;
    }

    final Group header = view.getHeader();
    final double headerRowsYOffset = renderingInformation.getHeaderRowsYOffset();
    final double headerMinY = (header == null ? headerRowsYOffset : header.getY() + headerRowsYOffset);

    final Bounds bounds = renderingInformation.getBounds();
    final double activeColumnX = rendererHelper.getColumnOffset(activeGridColumns.get(0));
    final double highlightWidth = getHighlightWidth(activeGridColumns);
    final double highlightHeight = getHighlightHeight(bounds,
                                                      view,
                                                      headerMinY);

    state.getEventColumnHighlight().setWidth(highlightWidth)
            .setHeight(highlightHeight)
            .setX(view.getAbsoluteX() + activeColumnX)
            .setY(view.getAbsoluteY() + headerMinY);
    layer.add(state.getEventColumnHighlight());
    layer.getLayer().batch();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:28,代码来源:GridWidgetDnDMouseDownHandler.java

示例8: isOverRowDragHandleColumn

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
private boolean isOverRowDragHandleColumn(final GridWidget view,
                                          final double cx) {
    //Gather information on columns
    final BaseGridRendererHelper rendererHelper = view.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    if (renderingInformation == null) {
        return false;
    }

    final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation();
    final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
    final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
    final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns();
    final double bodyX = bodyBlockInformation.getX();
    final double floatingX = floatingBlockInformation.getX();

    //Check floating columns
    if (findRowDragHandleColumn(floatingColumns,
                                floatingX,
                                cx) != null) {
        return true;
    }

    //Check all other columns
    return findRowDragHandleColumn(bodyColumns,
                                   bodyX,
                                   cx) != null;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:29,代码来源:GridWidgetDnDMouseMoveHandler.java

示例9: isGridWidgetRendered

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
private boolean isGridWidgetRendered(final GridWidget gridWidget) {
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    return renderingInformation != null;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:BaseKeyboardOperation.java

示例10: findMovableColumns

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
protected void findMovableColumns(final GridWidget view,
                                  final double headerRowsHeight,
                                  final double headerMinY,
                                  final double cx,
                                  final double cy) {
    //Gather information on columns
    final BaseGridRendererHelper rendererHelper = view.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    if (renderingInformation == null) {
        return;
    }

    final BaseGridRendererHelper.RenderingBlockInformation bodyBlockInformation = renderingInformation.getBodyBlockInformation();
    final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
    final List<GridColumn<?>> allColumns = view.getModel().getColumns();
    final List<GridColumn<?>> bodyColumns = bodyBlockInformation.getColumns();
    final List<GridColumn<?>> floatingColumns = floatingBlockInformation.getColumns();
    final double bodyX = bodyBlockInformation.getX();
    final double floatingX = floatingBlockInformation.getX();
    final double floatingWidth = floatingBlockInformation.getWidth();

    //Check all other columns. Floating columns cannot be moved.
    double offsetX = bodyX;
    for (int headerColumnIndex = 0; headerColumnIndex < bodyColumns.size(); headerColumnIndex++) {
        final GridColumn<?> gridColumn = bodyColumns.get(headerColumnIndex);
        final double columnWidth = gridColumn.getWidth();

        if (gridColumn.isVisible()) {
            final List<GridColumn.HeaderMetaData> headerMetaData = gridColumn.getHeaderMetaData();
            final double headerRowHeight = headerRowsHeight / headerMetaData.size();

            for (int headerRowIndex = 0; headerRowIndex < headerMetaData.size(); headerRowIndex++) {
                final GridColumn.HeaderMetaData md = headerMetaData.get(headerRowIndex);
                if (gridColumn.isMovable()) {
                    if (cy < (headerRowIndex + 1) * headerRowHeight + headerMinY) {
                        if (cx > floatingX + floatingWidth) {
                            if (cx > offsetX && cx < offsetX + columnWidth) {
                                //Get the block of columns to be moved.
                                final List<GridColumn<?>> blockColumns = getBlockColumns(allColumns,
                                                                                         headerMetaData,
                                                                                         headerRowIndex,
                                                                                         allColumns.indexOf(gridColumn));
                                //If the columns to move are split between body and floating we cannot move them.
                                for (GridColumn<?> blockColumn : blockColumns) {
                                    if (floatingColumns.contains(blockColumn)) {
                                        return;
                                    }
                                }

                                state.setActiveGridWidget(view);
                                state.setActiveGridColumns(blockColumns);
                                state.setActiveHeaderMetaData(md);
                                state.setOperation(GridWidgetDnDHandlersState.GridWidgetHandlersOperation.COLUMN_MOVE_PENDING);
                                setCursor(Style.Cursor.MOVE);
                                return;
                            }
                        }
                    }
                }
            }
            offsetX = offsetX + columnWidth;
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:65,代码来源:GridWidgetDnDMouseMoveHandler.java

示例11: handleColumnMove

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
protected void handleColumnMove(final NodeMouseMoveEvent event) {
    final GridWidget activeGridWidget = state.getActiveGridWidget();
    final List<GridColumn<?>> activeGridColumns = state.getActiveGridColumns();
    final GridColumn.HeaderMetaData activeHeaderMetaData = state.getActiveHeaderMetaData();

    final GridData activeGridModel = activeGridWidget.getModel();
    final List<GridColumn<?>> allGridColumns = activeGridModel.getColumns();
    final BaseGridRendererHelper rendererHelper = activeGridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    if (renderingInformation == null) {
        return;
    }

    final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = renderingInformation.getFloatingBlockInformation();
    final double floatingX = floatingBlockInformation.getX();
    final double floatingWidth = floatingBlockInformation.getWidth();

    final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate(activeGridWidget,
                                                                      new Point2D(event.getX(),
                                                                                  event.getY()));
    final double cx = ap.getX();
    if (cx < floatingX + floatingWidth) {
        return;
    }

    final double activeBlockWidth = getBlockWidth(allGridColumns,
                                                  allGridColumns.indexOf(activeGridColumns.get(0)),
                                                  allGridColumns.indexOf(activeGridColumns.get(activeGridColumns.size() - 1)));

    for (int headerColumnIndex = 0; headerColumnIndex < allGridColumns.size(); headerColumnIndex++) {
        final GridColumn<?> candidateGridColumn = allGridColumns.get(headerColumnIndex);
        if (candidateGridColumn.isVisible()) {
            if (!activeGridColumns.contains(candidateGridColumn)) {
                for (int headerRowIndex = 0; headerRowIndex < candidateGridColumn.getHeaderMetaData().size(); headerRowIndex++) {
                    final GridColumn.HeaderMetaData candidateHeaderMetaData = candidateGridColumn.getHeaderMetaData().get(headerRowIndex);
                    if (candidateHeaderMetaData.getColumnGroup().equals(activeHeaderMetaData.getColumnGroup())) {
                        final int candidateBlockStartColumnIndex = getBlockStartColumnIndex(allGridColumns,
                                                                                            candidateHeaderMetaData,
                                                                                            headerRowIndex,
                                                                                            headerColumnIndex);
                        final int candidateBlockEndColumnIndex = getBlockEndColumnIndex(allGridColumns,
                                                                                        candidateHeaderMetaData,
                                                                                        headerRowIndex,
                                                                                        headerColumnIndex);
                        final double candidateBlockOffset = rendererHelper.getColumnOffset(candidateBlockStartColumnIndex);
                        final double candidateBlockWidth = getBlockWidth(allGridColumns,
                                                                         candidateBlockStartColumnIndex,
                                                                         candidateBlockEndColumnIndex);

                        final double minColX = Math.max(candidateBlockOffset,
                                                        candidateBlockOffset + (candidateBlockWidth - activeBlockWidth) / 2);
                        final double maxColX = Math.min(candidateBlockOffset + candidateBlockWidth,
                                                        candidateBlockOffset + (candidateBlockWidth + activeBlockWidth) / 2);
                        final double midColX = candidateBlockOffset + candidateBlockWidth / 2;
                        if (cx > minColX && cx < maxColX) {
                            if (cx < midColX) {
                                destroyColumns(allGridColumns);
                                activeGridModel.moveColumnsTo(candidateBlockEndColumnIndex,
                                                              activeGridColumns);
                                state.getEventColumnHighlight().setX(activeGridWidget.getAbsoluteX() + rendererHelper.getColumnOffset(activeGridColumns.get(0)));
                                layer.batch();
                                return;
                            } else {
                                destroyColumns(allGridColumns);
                                activeGridModel.moveColumnsTo(candidateBlockStartColumnIndex,
                                                              activeGridColumns);
                                state.getEventColumnHighlight().setX(activeGridWidget.getAbsoluteX() + rendererHelper.getColumnOffset(activeGridColumns.get(0)));
                                layer.batch();
                                return;
                            }
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:79,代码来源:GridWidgetDnDMouseMoveHandler.java

示例12: handleRowMove

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //导入方法依赖的package包/类
protected void handleRowMove(final NodeMouseMoveEvent event) {
    final GridWidget activeGridWidget = state.getActiveGridWidget();
    final List<GridRow> activeGridRows = state.getActiveGridRows();

    final GridData activeGridModel = activeGridWidget.getModel();
    final List<GridColumn<?>> allGridColumns = activeGridModel.getColumns();

    final BaseGridRendererHelper rendererHelper = activeGridWidget.getRendererHelper();
    final GridRenderer renderer = activeGridWidget.getRenderer();
    final double headerHeight = renderer.getHeaderHeight();

    final GridRow leadRow = activeGridRows.get(0);
    final int leadRowIndex = activeGridModel.getRows().indexOf(leadRow);

    final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate(activeGridWidget,
                                                                      new Point2D(event.getX(),
                                                                                  event.getY()));
    final double cy = ap.getY();
    if (cy < headerHeight || cy > activeGridWidget.getHeight()) {
        return;
    }

    //Find new row index
    GridRow row;
    int uiRowIndex = 0;
    double offsetY = cy - headerHeight;
    while ((row = activeGridModel.getRow(uiRowIndex)).getHeight() < offsetY) {
        offsetY = offsetY - row.getHeight();
        uiRowIndex++;
    }
    if (uiRowIndex < 0 || uiRowIndex > activeGridModel.getRowCount() - 1) {
        return;
    }

    if (uiRowIndex == leadRowIndex) {
        //Don't move if the new rowIndex equals the index of the row(s) being moved
        return;
    } else if (uiRowIndex < activeGridModel.getRows().indexOf(leadRow)) {
        //Don't move up if the pointer is in the bottom half of the target row.
        if (offsetY > activeGridModel.getRow(uiRowIndex).getHeight() / 2) {
            return;
        }
    } else if (uiRowIndex > activeGridModel.getRows().indexOf(leadRow)) {
        //Don't move down if the pointer is in the top half of the target row.
        if (offsetY < activeGridModel.getRow(uiRowIndex).getHeight() / 2) {
            return;
        }
    }

    //Move row(s) and update highlight
    destroyColumns(allGridColumns);
    activeGridModel.moveRowsTo(uiRowIndex,
                               activeGridRows);

    final double rowOffsetY = rendererHelper.getRowOffset(leadRow) + headerHeight;
    state.getEventColumnHighlight().setY(activeGridWidget.getAbsoluteY() + rowOffsetY);
    layer.batch();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:59,代码来源:GridWidgetDnDMouseMoveHandler.java


注:本文中的org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget.getRendererHelper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。