Examples of PositionCoordinate


Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

        this.freezeLayer = freezeLayer;
        this.columnPosition = columnPosition;
    }

    public PositionCoordinate getTopLeftPosition() {
        return new PositionCoordinate(freezeLayer, 0, -1);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

    public PositionCoordinate getTopLeftPosition() {
        return new PositionCoordinate(freezeLayer, 0, -1);
    }

    public PositionCoordinate getBottomRightPosition() {
        return new PositionCoordinate(freezeLayer, columnPosition, -1);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

        this.selectionLayer = selectionLayer;
    }

    @Override
    public PositionCoordinate getTopLeftPosition() {
        PositionCoordinate lastSelectedCellPosition = selectionLayer
                .getLastSelectedCellPosition();
        if (lastSelectedCellPosition == null) {
            return null;
        }

        int columnPosition = viewportLayer.getScrollableLayer()
                .getColumnPositionByX(viewportLayer.getOrigin().getX());
        if (columnPosition > 0
                && columnPosition >= lastSelectedCellPosition.columnPosition) {
            columnPosition = lastSelectedCellPosition.columnPosition - 1;
        }

        int rowPosition = viewportLayer.getScrollableLayer().getRowPositionByY(
                viewportLayer.getOrigin().getY());
        if (rowPosition > 0
                && rowPosition >= lastSelectedCellPosition.rowPosition) {
            rowPosition = lastSelectedCellPosition.rowPosition - 1;
        }

        return new PositionCoordinate(freezeLayer, columnPosition, rowPosition);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

                int[] selColPos = selectionLayer
                        .getFullySelectedColumnPositions();
                for (int col : selColPos) {
                    columnPosition = Math.max(columnPosition, col);
                }
                return new PositionCoordinate(freezeLayer, columnPosition, -1);
            } else if (selectionLayer.getFullySelectedRowPositions().length > 0) {
                // if rows are fully selected we will freeze the rows to the top
                // including the selected row with the greatest index
                int rowPosition = 0;
                int[] selRowPos = selectionLayer.getFullySelectedRowPositions();
                for (int row : selRowPos) {
                    rowPosition = Math.max(rowPosition, row);
                }
                return new PositionCoordinate(freezeLayer, -1, rowPosition);
            } else {
                // find the selected cell that is most to the left and to the
                // top of the selection
                int columnPosition = -1;
                int rowPosition = -1;
                PositionCoordinate[] coords = selectionLayer
                        .getSelectedCellPositions();
                for (PositionCoordinate coord : coords) {
                    if (columnPosition < 0) {
                        columnPosition = coord.columnPosition;
                    } else {
                        columnPosition = Math.min(columnPosition,
                                coord.columnPosition);
                    }
                    if (rowPosition < 0) {
                        rowPosition = coord.rowPosition;
                    } else {
                        rowPosition = Math.min(rowPosition, coord.rowPosition);
                    }
                }
                return new PositionCoordinate(freezeLayer, columnPosition - 1,
                        rowPosition - 1);
            }
        } else {
            PositionCoordinate selectionAnchor = selectionLayer
                    .getSelectionAnchor();
            if (selectionAnchor != null) {
                return new PositionCoordinate(freezeLayer,
                        selectionAnchor.columnPosition - 1,
                        selectionAnchor.rowPosition - 1);
            }
        }
        return null;
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

        this.columnPosition = columnPosition;
        this.rowPosition = rowPosition;
    }

    public PositionCoordinate getTopLeftPosition() {
        return new PositionCoordinate(freezeLayer, 0, 0);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

    public PositionCoordinate getTopLeftPosition() {
        return new PositionCoordinate(freezeLayer, 0, 0);
    }

    public PositionCoordinate getBottomRightPosition() {
        return new PositionCoordinate(freezeLayer, columnPosition - 1,
                rowPosition - 1);
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

    public void shouldFreezeRowsAndColumnsBasedOnSelection() {
        compositeFreezeLayer.doCommand(new SelectCellCommand(
                compositeFreezeLayer, 2, 2, false, false));

        // Make sure selection layer processed command
        final PositionCoordinate lastSelectedCell = selectionLayer
                .getLastSelectedCellPosition();
        Assert.assertEquals(2, lastSelectedCell.columnPosition);
        Assert.assertEquals(2, lastSelectedCell.rowPosition);

        // This is what would happen if we selected to freeze from a selected
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

            // if there is an open editor, we suppose that the movement should
            // be performed from there, as the focus is typically in the editor
            return EditUtils.isCellEditable(
                    to.getLayer(),
                    this.natTable.getConfigRegistry(),
                    new PositionCoordinate(to.getLayer(), to.getColumnPosition(), to.getRowPosition()));
        }
        return true;
    }
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

        setLayerPainter(new SelectionLayerPainter());

        this.selectionModel = selectionModel != null ? selectionModel
                : new SelectionModel(this);

        lastSelectedCell = new PositionCoordinate(this, NO_SELECTION,
                NO_SELECTION);
        selectionAnchor = new PositionCoordinate(this, NO_SELECTION,
                NO_SELECTION);

        selectRowCommandHandler = new SelectRowCommandHandler(this);
        selectCellCommandHandler = new SelectCellCommandHandler(this);
        selectColumnCommandHandler = new SelectColumnCommandHandler(this);
View Full Code Here

Examples of org.eclipse.nebula.widgets.nattable.coordinate.PositionCoordinate

            for (Range rowIndexRange : selectedRowPositions) {
                for (int rowPositionIndex = rowIndexRange.start; rowPositionIndex < rowIndexRange.end; rowPositionIndex++) {
                    if (selectionModel.isCellPositionSelected(columnPosition,
                            rowPositionIndex)) {
                        selectedCells.add(new PositionCoordinate(this,
                                columnPosition, rowPositionIndex));
                    }
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.