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


Java GridWidget.getX方法代碼示例

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


在下文中一共展示了GridWidget.getX方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

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

示例2: updateGridWidgetConnectors

import org.uberfire.ext.wires.core.grids.client.widget.grid.GridWidget; //導入方法依賴的package包/類
private void updateGridWidgetConnectors() {
    for (Map.Entry<GridWidgetConnector, Line> e : gridWidgetConnectors.entrySet()) {
        final GridWidgetConnector connector = e.getKey();
        final Line line = e.getValue();
        final GridColumn<?> sourceGridColumn = connector.getSourceColumn();
        final GridColumn<?> targetGridColumn = connector.getTargetColumn();
        final GridWidget sourceGridWidget = getLinkedGridWidget(sourceGridColumn);
        final GridWidget targetGridWidget = getLinkedGridWidget(targetGridColumn);

        final Point2D sp = new Point2D(sourceGridWidget.getX() + sourceGridWidget.getWidth() / 2,
                                       sourceGridWidget.getY() + sourceGridWidget.getHeight() / 2);
        final Point2D ep = new Point2D(targetGridWidget.getX() + targetGridWidget.getWidth() / 2,
                                       targetGridWidget.getY() + targetGridWidget.getHeight() / 2);

        line.setPoints(new Point2DArray(sp,
                                        ep));
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:19,代碼來源:DefaultGridLayer.java

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


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