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


Java BaseGridRendererHelper.getRenderingInformation方法代码示例

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


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

示例1: 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)));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:BaseCellSelectionManager.java

示例2: 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)));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:BaseCellSelectionManager.java

示例3: 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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:BaseKeyboardOperation.java

示例4: 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();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:GridWidgetDnDMouseDownHandler.java

示例5: getScreenX

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
private int getScreenX(final GuidedDecisionTableModellerView modellerView,
                       final GuidedDecisionTableView.Presenter dtPresenter,
                       final int uiColumnIndex) {
    final GridWidget gridWidget = dtPresenter.getView();
    final GridColumn<?> uiColumn = gridWidget.getModel().getColumns().get(uiColumnIndex);

    final double gx = gridWidget.getX();
    final GridLayer layer = modellerView.getGridLayerView();
    final int containerX = layer.getDomElementContainer().getAbsoluteLeft();
    final double vx = layer.getVisibleBounds().getX();
    final Transform t = layer.getViewport().getTransform();

    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
    final BaseGridRendererHelper.RenderingBlockInformation floatingBlockInformation = ri.getFloatingBlockInformation();
    final double offsetX = floatingBlockInformation.getColumns().contains(uiColumn) ? floatingBlockInformation.getX() : 0;

    final int screenX = containerX + (int) ((gx - vx + offsetX + rendererHelper.getColumnOffset(uiColumn) + uiColumn.getWidth() / 2) * t.getScaleX());
    return screenX;
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:21,代码来源:ColumnHeaderPopOverImpl.java

示例6: showColumnHighlight

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的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

示例7: isOverRowDragHandleColumn

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的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

示例8: handleHeaderCellDoubleClick

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
@Override
protected boolean handleHeaderCellDoubleClick(final NodeMouseDoubleClickEvent event) {
    //Convert Canvas co-ordinate to Grid co-ordinate
    final Point2D ap = CoordinateUtilities.convertDOMToGridCoordinate(gridWidget,
                                                                      new Point2D(event.getX(),
                                                                                  event.getY()));
    final double cx = ap.getX();
    final double cy = ap.getY();

    //Get column information
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation();
    if (ri == null) {
        return false;
    }
    final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx);
    final GridColumn<?> column = ci.getColumn();
    if (!hasEditableHeader(column)) {
        return false;
    }

    //Get row index
    final Integer uiHeaderRowIndex = EditableHeaderUtilities.getUiHeaderRowIndex(gridWidget,
                                                                                 column,
                                                                                 cy);
    if (!isEditableHeader(column,
                          uiHeaderRowIndex)) {
        return false;
    }

    //Get rendering information
    final EditableHeaderMetaData headerMetaData = (EditableHeaderMetaData) column.getHeaderMetaData().get(uiHeaderRowIndex);
    final GridBodyCellRenderContext context = EditableHeaderUtilities.makeRenderContext(gridWidget,
                                                                                        ri,
                                                                                        ci,
                                                                                        uiHeaderRowIndex);
    headerMetaData.edit(context);

    return true;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:41,代码来源:EditableHeaderGridWidgetMouseDoubleClickHandler.java

示例9: edit

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的package包/类
private boolean edit(final int uiRowIndex,
                     final BaseGridRendererHelper.ColumnInformation ci) {
    final GridColumn<?> column = ci.getColumn();
    final int uiColumnIndex = ci.getUiColumnIndex();
    final double offsetX = ci.getOffsetX();

    //Get rendering information
    final GridRenderer renderer = gridWidget.getRenderer();
    final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper();
    final BaseGridRendererHelper.RenderingInformation renderingInformation = rendererHelper.getRenderingInformation();
    if (renderingInformation == null) {
        return false;
    }

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

    //Construct context of MouseEvent
    final double cellX = gridWidget.getAbsoluteX() + offsetX;
    final double cellY = gridWidget.getAbsoluteY() + renderer.getHeaderHeight() + getRowOffset(uiRowIndex,
                                                                                               uiColumnIndex,
                                                                                               rendererHelper);
    final double cellHeight = getCellHeight(uiRowIndex,
                                            uiColumnIndex);

    final Group header = gridWidget.getHeader();
    final double clipMinY = gridWidget.getAbsoluteY() + header.getY() + renderer.getHeaderHeight();
    final double clipMinX = gridWidget.getAbsoluteX() + floatingX + floatingWidth;

    final GridBodyCellRenderContext context = new GridBodyCellRenderContext(cellX,
                                                                            cellY,
                                                                            column.getWidth(),
                                                                            cellHeight,
                                                                            clipMinY,
                                                                            clipMinX,
                                                                            uiRowIndex,
                                                                            uiColumnIndex,
                                                                            floatingBlockInformation.getColumns().contains(column),
                                                                            gridWidget.getViewport().getTransform(),
                                                                            renderer);

    doEdit(context);

    return true;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:47,代码来源:BaseCellSelectionManager.java

示例10: isGridWidgetRendered

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的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

示例11: findMovableColumns

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的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

示例12: handleColumnMove

import org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.impl.BaseGridRendererHelper; //导入方法依赖的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


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