void (Graphics g) { int height = getHeight(); int width = getWidth(); int borderX = myLabelInsets.left - 1; int borderY = myLabelInsets.top - 1; int borderW = width - borderX - myLabelInsets.right + 2; int borderH = height - borderY - myLabelInsets.bottom + 1; if (myIcon != null) { int verticalIconPosition = (height - myIcon.getIconHeight())/2; myIcon.paintIcon(this, g, 0, isIconVerticallyCentered() ? verticalIconPosition : myTextInsets.top); borderX += myIcon.getIconWidth(); borderW -= myIcon.getIconWidth(); } Color bgColor = UIUtil.getTreeBackground(mySelected, myHasFocus); Color fgColor = UIUtil.getTreeForeground(mySelected, myHasFocus); // fill background if (!WideSelectionTreeUI.isWideSelection(myTree)) { g.setColor(bgColor); g.fillRect(borderX, borderY, borderW, borderH); // draw border if (mySelected) { g.setColor(UIUtil.getTreeSelectionBorderColor()); UIUtil.drawDottedRectangle(g, borderX, borderY, borderX + borderW - 1, borderY + borderH - 1); } } // paint text recalculateWraps(); if (myTooSmall) { // TODO ??? return; } int fontHeight = getCurrFontMetrics().getHeight(); int currBaseLine = getCurrFontMetrics().getAscent(); currBaseLine += myTextInsets.top; g.setFont(getFont()); g.setColor(fgColor); UISettings.setupAntialiasing(g); if (!StringUtil.isEmpty(myPrefix)) { g.drawString(myPrefix, myTextInsets.left - myPrefixWidth + 1, currBaseLine); } for (int i = 0; i < myWraps.size(); i++) { String currLine = (String)myWraps.get(i); g.drawString(currLine, myTextInsets.left, currBaseLine); currBaseLine += fontHeight; // first is getCurrFontMetrics().getAscent() } }