Package simplesheet.model

Examples of simplesheet.model.CellRenderer


            component.setBounds(cellRect);
            component.validate();
        } else {
            drawGrid(g, cellRect);

            CellRenderer renderer = table.getDefaultRenderer();
            Component component  = table.prepareRenderer(renderer, pos);
            component.setBounds(cellRect);

            component.paint(g);
        }
View Full Code Here


     * @param iCol
     */
    private void recalcColWidth(Graphics g, int iCol) {
        int maxWidth = 0;
        SheetModel model = table.getModel();
        CellRenderer renderer = table.getDefaultRenderer();
        for(int iRow=0; iRow<model.getRowCount(); /* ath the end*/) {
            CellPosition pos = model.getOrigin(new CellPosition(iRow, iCol));
            Dimension size = model.getSize(pos);
            if(size.height > 1 || size.width > 1) {
                iRow += size.height;
                continue;
            }
            int iWidth = renderer.getPreferredWidth(table, g, model.getValueAt(pos));
            if(iWidth > maxWidth) {
                maxWidth = iWidth;
            }
            iRow++;
        }
View Full Code Here

    }

    private void recalcRowHeight(Graphics g, int iRow) {
        int maxHeight = 0;
        SheetModel model = table.getModel();
        CellRenderer renderer = table.getDefaultRenderer();
        for(int iCol=0; iCol<model.getColumnCount(); /* ath the end*/) {
            CellPosition pos = model.getOrigin(new CellPosition(iRow, iCol));
            Dimension size = model.getSize(pos);
            if(size.height > 1 || size.width > 1) {
                iCol += size.width;
                continue;
            }
            int width = model.getColumn(iCol).getWidth();
            int iHeight = renderer.getPreferredHeight(table, g, model.getValueAt(pos), width);
            if(iHeight > maxHeight) {
                maxHeight = iHeight;
            }
            iCol++;
        }
View Full Code Here

TOP

Related Classes of simplesheet.model.CellRenderer

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.