當前位置: 首頁>>代碼示例>>Java>>正文


Java GridWidget.getModel方法代碼示例

本文整理匯總了Java中org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget.getModel方法的典型用法代碼示例。如果您正苦於以下問題:Java GridWidget.getModel方法的具體用法?Java GridWidget.getModel怎麽用?Java GridWidget.getModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget的用法示例。


在下文中一共展示了GridWidget.getModel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getCellScrollDeltaX

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private double getCellScrollDeltaX(final GridWidget gridWidget) {
    final GridData gridModel = gridWidget.getModel();
    final List<GridColumn<?>> columns = gridModel.getColumns();
    final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
    final int uiColumnIndex = ColumnIndexUtilities.findUiColumnIndex(columns,
                                                                     origin.getColumnIndex());

    double dx = 0;
    final Bounds bounds = gridLayer.getVisibleBounds();
    final double columnWidth = columns.get(uiColumnIndex).getWidth();
    final double gridCellX = gridWidget.getX() + gridWidget.getRendererHelper().getColumnOffset(uiColumnIndex);

    if (gridCellX + columnWidth >= bounds.getX() + bounds.getWidth()) {
        dx = bounds.getX() + bounds.getWidth() - gridCellX - columnWidth;
    } else if (gridCellX <= bounds.getX()) {
        dx = bounds.getX() - gridCellX;
    }

    return dx;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:21,代碼來源:BaseKeyboardOperation.java

示例4: clearCells

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private void clearCells() {
    final GridWidget selectedGridWidget = getSelectedGridWidget();
    if (selectedGridWidget == null) {
        return;
    }
    final GridData gridModel = selectedGridWidget.getModel();
    final List<GridData.SelectedCell> selectedCells = gridModel.getSelectedCells();
    for (GridData.SelectedCell cell : selectedCells) {
        gridModel.deleteCell(cell.getRowIndex(),
                             cell.getColumnIndex());
    }
    view.refresh();
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:14,代碼來源:WiresGridsDemoPresenter.java

示例5: removeGridWidgetConnectors

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private void removeGridWidgetConnectors(final GridWidget gridWidget) {
    final GridData gridModel = gridWidget.getModel();
    final List<GridWidgetConnector> removedConnectors = new ArrayList<GridWidgetConnector>();
    for (Map.Entry<GridWidgetConnector, Line> e : gridWidgetConnectors.entrySet()) {
        if (gridModel.getColumns().contains(e.getKey().getSourceColumn()) || gridModel.getColumns().contains(e.getKey().getTargetColumn())) {
            remove(e.getValue());
            removedConnectors.add(e.getKey());
        }
    }
    //Remove Connectors from HashMap after iteration of EntrySet to avoid ConcurrentModificationException
    for (GridWidgetConnector c : removedConnectors) {
        gridWidgetConnectors.remove(c);
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:15,代碼來源:DefaultGridLayer.java

示例6: flushDOMElements

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private void flushDOMElements(final GridWidget selectedGridWidget) {
    final GridData gridModel = selectedGridWidget.getModel();
    for (GridColumn<?> column : gridModel.getColumns()) {
        if (column instanceof HasSingletonDOMElementResource) {
            ((HasSingletonDOMElementResource) column).flush();
            ((HasSingletonDOMElementResource) column).destroyResources();
        }
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:10,代碼來源:BaseGridWidgetKeyboardHandler.java

示例7: 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

示例8: addGridWidgetConnectors

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private void addGridWidgetConnectors() {
    for (GridWidget gridWidget : gridWidgets) {
        final GridData gridModel = gridWidget.getModel();
        for (GridColumn<?> gridColumn : gridModel.getColumns()) {
            if (gridColumn.isVisible()) {
                if (gridColumn.isLinked()) {
                    final GridWidget linkedGridWidget = getLinkedGridWidget(gridColumn.getLink());
                    if (linkedGridWidget != null) {
                        final Point2D sp = new Point2D(gridWidget.getX() + gridWidget.getWidth() / 2,
                                                       gridWidget.getY() + gridWidget.getHeight() / 2);
                        final Point2D ep = new Point2D(linkedGridWidget.getX() + linkedGridWidget.getWidth() / 2,
                                                       linkedGridWidget.getY() + linkedGridWidget.getHeight() / 2);

                        final GridWidgetConnector connector = new GridWidgetConnector(gridColumn,
                                                                                      gridColumn.getLink());

                        if (!gridWidgetConnectors.containsKey(connector)) {
                            final Line line = new Line(sp,
                                                       ep)
                                    .setVisible(!isGridPinned())
                                    .setStrokeColor(ColorName.DARKGRAY)
                                    .setFillColor(ColorName.TAN)
                                    .setStrokeWidth(2.0);
                            gridWidgetConnectors.put(connector,
                                                     line);
                            super.add(line);
                            line.moveToBottom();
                        }
                    }
                }
            }
        }
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:35,代碼來源:DefaultGridLayer.java

示例9: clearCells

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
protected void clearCells(final GridWidget gridWidget) {
    final GridData gridModel = gridWidget.getModel();
    final List<GridData.SelectedCell> selectedCells = gridModel.getSelectedCells();
    for (GridData.SelectedCell cell : selectedCells) {
        gridModel.deleteCell(cell.getRowIndex(),
                             cell.getColumnIndex());
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:9,代碼來源:KeyboardOperationClearCell.java

示例10: 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

示例11: editCell

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
protected void editCell(final GridWidget gridWidget) {
    final GridData gridModel = gridWidget.getModel();
    final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
    if (origin == null) {
        return;
    }
    gridWidget.startEditingCell(origin.getRowIndex(),
                                ColumnIndexUtilities.findUiColumnIndex(gridModel.getColumns(),
                                                                       origin.getColumnIndex()));
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:11,代碼來源:KeyboardOperationEditCell.java

示例12: getLinkedGridWidget

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private GridWidget getLinkedGridWidget(final GridColumn<?> linkedGridColumn) {
    GridWidget linkedGridWidget = null;
    for (GridWidget gridWidget : gridWidgets) {
        final GridData gridModel = gridWidget.getModel();
        if (gridModel.getColumns().contains(linkedGridColumn)) {
            linkedGridWidget = gridWidget;
            break;
        }
    }
    return linkedGridWidget;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:12,代碼來源:DefaultGridLayer.java

示例13: 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

示例14: selectTopLeftCell

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
protected boolean selectTopLeftCell(final GridWidget gridWidget) {
    final GridData gridModel = gridWidget.getModel();
    final int rowCount = gridModel.getRowCount();
    final int columnCount = gridModel.getColumnCount();
    if (rowCount == 0 || columnCount == 0) {
        return false;
    }
    return gridWidget.selectCell(0,
                                 0,
                                 false,
                                 false);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:13,代碼來源:KeyboardOperationSelectTopLeftCell.java

示例15: getHeaderRowsYOffset

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private double getHeaderRowsYOffset(final GridWidget gridWidget,
                                    final GridRenderer renderer) {
    final GridData model = gridWidget.getModel();
    final int headerRowCount = model.getHeaderRowCount();
    final double headerHeight = renderer.getHeaderHeight();
    final double headerRowHeight = renderer.getHeaderRowHeight();
    final double headerRowsHeight = headerRowHeight * headerRowCount;
    final double headerRowsYOffset = headerHeight - headerRowsHeight;

    return headerRowsYOffset;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:12,代碼來源:GridWidgetDnDMouseMoveHandler.java


注:本文中的org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget.getModel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。