Package simplesheet.model.cell

Examples of simplesheet.model.cell.TableCell


    }

    @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


            if (!autoFill.isOK()) {
                return;
            }

            //save SRC value to stream
            TableCell tableCell = model.getValueAt(anchor);
            Element savedStream = null;
            if(tableCell instanceof SheetCell) {
                SheetCell sc = (SheetCell) tableCell;
                savedStream = new Element("save");
                sc.getCellFormat().saveState(savedStream);
            }
            Style style = tableCell.getStyle();

            //iterate dest
            int dif = (anchor.row < lead.row) ? 1 : -1;
            int dif2 = (anchor.col < lead.col) ? 1 : -1;
            int failed = 0;
View Full Code Here

            }
        }

        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);
                }
            }
            if (style == null) {
                return;
            }
            Style newStyle = iCell.getStyle();
            if (autoFill.isCopyStyle() && newStyle == null) {
                newStyle = new StyleDefault();
            }
            if (autoFill.isCopyColor()) {
                newStyle.setForeground(style.getForeground());
                newStyle.setBackground(style.getBackground());
            }
            if (autoFill.isCopyFont()) {
                newStyle.setFont(style.getFont());
            }
            if (autoFill.isCopyMargin()) {
                newStyle.setMargin(style.getMargin());
            }
            if (autoFill.isCopyBorder()) {
                newStyle.setBorder(style.getBorder());
            }
            if (autoFill.isCopyAlign()) {
                newStyle.setTextAlign(style.getTextAlign());
                newStyle.setTextVAlign(style.getTextVAlign());
            }
            iCell.setStyle(newStyle);
        }
View Full Code Here

                    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

    public void setGridColor(Color gridColor) {
        this.gridColor = gridColor;
    }

    public Component prepareRenderer(CellRenderer renderer, CellPosition pos) {
        TableCell value = model.getValueAt(pos);
        CellPosition lead = selectionModel.getLead();
        boolean focused = (lead != null) && pos.equals(lead) ? true : false;
        return renderer.getSheetCellRendererComponent(this, value,
                selectionModel.isSelected(pos), focused);
    }
View Full Code Here

TOP

Related Classes of simplesheet.model.cell.TableCell

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.