Examples of CellPosition


Examples of simplesheet.model.selection.CellPosition

        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

Examples of simplesheet.model.selection.CellPosition

            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

Examples of simplesheet.model.selection.CellPosition

        }

        @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

Examples of simplesheet.model.selection.CellPosition

        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

Examples of simplesheet.model.selection.CellPosition

                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

Examples of simplesheet.model.selection.CellPosition

        rebuildTable();
    }

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

Examples of simplesheet.model.selection.CellPosition

            }
        }

        private void fillCell(int iRow, int iCol,
                AutoFillDlg autoFill, Element savedStream, Style style) throws ReportException {
            TableCell iCell = model.getValueAt(new CellPosition(iRow, iCol));
            if (iCell instanceof SheetCell) {
                SheetCell sc = (SheetCell) iCell;
                if (autoFill.isCopyValue() && savedStream != null) {
                    sc.getCellFormat().restoreState(savedStream);
                }
View Full Code Here

Examples of simplesheet.model.selection.CellPosition

            }
            SheetSelectionModel sm = table.getSelectionModel();
            if(sm.isSelectionEmpty() || sm.getValueIsAdjusting()) {
               return;
            }
            CellPosition lead = getNextLead(e, sm.getLead());
            if(lead == null) {
                return;
            }
            CellPosition ankor = null;
            if((e.getModifiersEx() & KeyEvent.SHIFT_DOWN_MASK) > 0) {
                ankor = sm.getAnchor();
            } else {
                ankor = lead;
            }
View Full Code Here

Examples of simplesheet.model.selection.CellPosition

            lead = model.getOrigin(lead);
            switch(e.getKeyCode()) {
                case KeyEvent.VK_DOWN : {
                    Dimension size = model.getSize(lead);
                    if(lead.row + size.height < model.getRowCount()) {
                        return model.getOrigin(new CellPosition(lead.row+size.height, lead.col));
                    }
                    break;
                }
                case KeyEvent.VK_UP : {
                    if(lead.row -1 >= 0) {
                        return model.getOrigin(new CellPosition(lead.row-1, lead.col));
                    }
                    break;
                }
                case KeyEvent.VK_RIGHT : {
                    Dimension size = model.getSize(lead);
                    if(lead.col + size.width < model.getColumnCount()) {
                        return model.getOrigin(new CellPosition(lead.row, lead.col+size.width));
                    }
                    break;
                }
                case KeyEvent.VK_LEFT : {
                    if(lead.col - 1 >= 0) {
                        return model.getOrigin(new CellPosition(lead.row, lead.col-1));
                    }
                    break;
                }
            }
            return null;
View Full Code Here

Examples of simplesheet.model.selection.CellPosition

    private class MyMouse extends MouseAdapter {
        @Override
        public void mousePressed(MouseEvent e) {
            table.requestFocus();
            SheetSelectionModel semod = table.getSelectionModel();
            CellPosition pos = table.getCellAtPoint(e.getPoint());
            if(pos == null) {
                return;
            }
            pos = table.getModel().getOrigin(pos);
            if(!semod.getValueIsAdjusting()) {
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.