Package simplesheet.model.selection

Examples of simplesheet.model.selection.CellPosition


        }
    }

    @Override
    public TableCell getValueAt(CellPosition pos) {
        CellPosition point = getOrigin(pos);
        TableCell cell = cells[point.row][point.col];
        if(cell == null) {
            return EMPTY_CELL;
        }
        return cell;
View Full Code Here


    public int getColumnCount() {
        return cols.length;
    }

    public void initCell(CellPosition pos, TableCell cell) {
        CellPosition point = getOrigin(pos);
        cells[point.row][point.col] = cell;
        fireSheetCellUpdated(point);
    }
View Full Code Here

     * @param width
     * @param height
     * @return
     */
    public boolean combine(CellPosition pos, int height, int width) {
        CellPosition origin = getOrigin(pos);
        if (origin == null
                || origin.col + width > getColumnCount()
                || origin.row + height > getRowCount()
                || width == 0
                || height == 0
View Full Code Here

     *
     * @param col
     * @param row
     */
    public boolean split(CellPosition pos) {
        CellPosition origin = getOrigin(pos);
        if (origin == null) {
            assert false : "index of bounds";
            return false;
        }
        Dimension size = getSize(origin);
View Full Code Here

        int c = pos.col;
        if(span[pos.row][pos.col][ROW] < 0 || span[pos.row][pos.col][COL] < 0) {
            c += span[pos.row][pos.col][COL];
            r += span[pos.row][pos.col][ROW];
        }
        return new CellPosition(r, c);
    }
View Full Code Here

            super(cols, rows, colsFlat, rowsFlat);
        }

        @Override
        protected void makeCornerCell() {
            CellPosition corner = new CellPosition(0, 0);
            initCell(corner, new CornerCell(parent, format, tableListener));
            if(headHeight > 1 || leftHeadHeight > 1) {
                combine(corner, headHeight, leftHeadHeight);
            }
        }
View Full Code Here

        }

        @Override
        protected void makeHeadCell(ColRowRange range, int col, int row,
                int colspan, int rowspan) throws ReportException {
            CellPosition corner = new CellPosition(row, col);
            initCell(corner, new RangeCell(parent, range, tableListener));
            if(rowspan > 1 || colspan > 1) {
                combine(corner, rowspan, colspan);
            }
        }
View Full Code Here

        protected void buildRowBody(ColRowRange rowRange, int row, int col)
                throws ReportException {
            //шапка закончена - дорисовываем ячейки
            for(ColRowRange colRange: colsFlat) {
                CellValue cell = format.getCell(colRange, rowRange);
                CellPosition corner = new CellPosition(row, col++);
                initCell(corner, new SheetCell(parent, cell, tableListener));
            }
        }
View Full Code Here

                public void mouseClicked(MouseEvent e) {
                    if (e.getClickCount() != 2) {
                        return;
                    }
                    SheetSelectionModel selModel = table.getSelectionModel();
                    CellPosition lead = selModel.getLead();
                    if(lead == null) {
                        return;
                    }
                    CellPosition pos = model.getOrigin(lead);
                    TableCell cell = model.getValueAt(pos);
                    if (cell instanceof ActionListener) {
                        ActionListener al = (ActionListener) cell;
                        al.actionPerformed(null);
                    }
View Full Code Here

        rebuildTable();
    }

    @Override
    public void cellChanged(int row, int col) {
        model.fireSheetCellUpdated(new CellPosition(row, col));
    }
View Full Code Here

TOP

Related Classes of simplesheet.model.selection.CellPosition

Copyright © 2018 www.massapicom. 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.