private void calcRowHeight(Graphics g) { int height = Math.max(18, 2 + g.getFontMetrics(getFont()).getHeight()); //Issue 42743/"Jesse mode" String s = System.getProperty("nb.cellrenderer.fixedheight"); //NOI18N if (s != null) { try { height = Integer.parseInt(s); } catch (Exception e) { //do nothing, height not changed } } if (getRowHeight() != height) { setRowHeight(height); } else { revalidate(); repaint(); } }
private void repaintSelection () { int first = getSelectionModel().getMinSelectionRow(); int last = getSelectionModel().getMaxSelectionRow(); if (first != -1) { if (first == last) { Rectangle r = getRowBounds(first); repaint (r.x,r.y,r.width,r.height); } else { Rectangle top = getRowBounds(first); Rectangle bottom = getRowBounds(last); Rectangle r = new Rectangle(); r.x = Math.min (top.x, bottom.x); r.y = top.y; r.width = getWidth(); r.height = bottom.y + bottom.height - top.y; repaint(r.x,r.y,r.width,r.height); } } }
private void repaintSelection () { int first = getSelectionModel().getMinSelectionRow(); int last = getSelectionModel().getMaxSelectionRow(); if (first != -1) { if (first == last) { Rectangle r = getRowBounds(first); repaint (r.x,r.y,r.width,r.height); } else { Rectangle top = getRowBounds(first); Rectangle bottom = getRowBounds(last); Rectangle r = new Rectangle(); r.x = Math.min (top.x, bottom.x); r.y = top.y; r.width = getWidth(); r.height = bottom.y + bottom.height - top.y; repaint(r.x,r.y,r.width,r.height); } } }
private void repaintSelection() { int first = getSelectionModel().getMinSelectionRow(); int last = getSelectionModel().getMaxSelectionRow(); if (first != -1) { if (first == last) { Rectangle r = getRowBounds(first); if (r == null) { repaint(); return; } repaint(r.x, r.y, r.width, r.height); } else { Rectangle top = getRowBounds(first); Rectangle bottom = getRowBounds(last); if (top == null || bottom == null) { repaint(); return; } Rectangle r = new Rectangle(); r.x = Math.min(top.x, bottom.x); r.y = top.y; r.width = getWidth(); r.height = (bottom.y + bottom.height) - top.y; repaint(r.x, r.y, r.width, r.height); } } }
/** * Removes the search field from the tree. */ private void removeSearchField() { if (searchpanel.isDisplayable ()) { remove(searchpanel); TreeView.this.getViewport().setScrollMode(originalScrollMode); Rectangle r = searchpanel.getBounds(); this.repaint(r); } }
/** * Removes the search field from the tree. */ private void removeSearchField() { if (searchpanel.isDisplayable ()) { remove(searchpanel); TreeView.this.getViewport().setScrollMode(originalScrollMode); Rectangle r = searchpanel.getBounds(); this.repaint(r); } }