public Insets getBorderInsets(Component c) { insets.left = (nestingDepth * DefaultOutlineCellRenderer.getNestingWidth()) +DefaultOutlineCellRenderer.getExpansionHandleWidth()+1; insets.left += icon != null ? icon.getIconWidth() + ICON_TEXT_GAP : 0; insets.top = 1; insets.right = 1; insets.bottom = 1; return insets; }
public Insets getBorderInsets(Component c) { DefaultOutlineCellRenderer ren = (DefaultOutlineCellRenderer) c; if (ren.isShowHandle()) { insets.left = getExpansionHandleWidth() + (ren.getNestingDepth() * getNestingWidth()); //Defensively adjust all the insets fields insets.top = 1; insets.right = 1; insets.bottom = 1; } else { //Defensively adjust all the insets fields insets.left = 1; insets.top = 1; insets.right = 1; insets.bottom = 1; } return insets; }
public void paintBorder(Component c, java.awt.Graphics g, int x, int y, int width, int height) { DefaultOutlineCellRenderer ren = (DefaultOutlineCellRenderer) c; if (ren.isShowHandle() && !ren.isLeaf()) { Icon icon = ren.isExpanded() ? getExpandedIcon() : getCollapsedIcon(); int iconY; int iconX = ren.getNestingDepth() * getNestingWidth(); if (icon.getIconHeight() < height) { iconY = (height / 2) - (icon.getIconHeight() / 2); } else { iconY = 0; } icon.paintIcon(c, g, iconX, iconY); } } }
public void paintBorder(Component c, java.awt.Graphics g, int x, int y, int width, int height) { int iconY; int iconX = nestingDepth * DefaultOutlineCellRenderer.getNestingWidth(); if( !isLeaf ) { Icon expIcon = isExpanded ? DefaultOutlineCellRenderer.getExpandedIcon() : DefaultOutlineCellRenderer.getCollapsedIcon(); if (expIcon.getIconHeight() < height) { iconY = (height / 2) - (expIcon.getIconHeight() / 2); } else { iconY = 0; } expIcon.paintIcon(c, g, iconX, iconY); } if( null != icon ) { iconX += DefaultOutlineCellRenderer.getExpansionHandleWidth() + 1; if (icon.getIconHeight() < height) { iconY = (height / 2) - (icon.getIconHeight() / 2); } else { iconY = 0; } icon.paintIcon(c, g, iconX, iconY); } } }
nd = 0; int handleStart = ins.left + (nd * DefaultOutlineCellRenderer.getNestingWidth()); int handleEnd = ins.left + handleStart + handleWidth;