This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 33247
Collapse All | Expand All

(-)openide/src/org/openide/explorer/view/TreeTable.java (+21 lines)
Lines 129-134 Link Here
129
            UIManager.put ("Table.gridColor", new JTable ().getGridColor ()); // NOI18N
129
            UIManager.put ("Table.gridColor", new JTable ().getGridColor ()); // NOI18N
130
        }
130
        }
131
        setUI(new TreeTableUI());
131
        setUI(new TreeTableUI());
132
        needCalcRowHeight = true;
132
    }
133
    }
133
134
134
    /* Workaround for BasicTableUI anomaly. Make sure the UI never tries to 
135
    /* Workaround for BasicTableUI anomaly. Make sure the UI never tries to 
Lines 141-146 Link Here
141
        return (getColumnClass(editingColumn) == TreeTableModelAdapter.class) ? -1 :
142
        return (getColumnClass(editingColumn) == TreeTableModelAdapter.class) ? -1 :
142
	        editingRow;  
143
	        editingRow;  
143
    }
144
    }
145
    
146
    boolean needCalcRowHeight = true;
147
    public void paint (Graphics g) {
148
        if (needCalcRowHeight) {
149
            calcRowHeight(g);
150
        }
151
        super.paint(g);
152
    }
153
    
154
    /** Calculate the height of rows based on the current font.  This is
155
     *  done when the first paint occurs, to ensure that a valid Graphics 
156
     *  object is available.  
157
     *  @since 1.25   */
158
    private void calcRowHeight(Graphics g) {
159
        Font f = getFont();
160
        FontMetrics fm = g.getFontMetrics(f);
161
        int rowHeight = fm.getHeight();
162
        needCalcRowHeight = false;
163
        setRowHeight (rowHeight);
164
    }    
144
165
145
    /*
166
    /*
146
     * Overridden to pass the new rowHeight to the tree.
167
     * Overridden to pass the new rowHeight to the tree.

Return to bug 33247