/** Paints the horizontal bars for the */ public void paintIcon(Component c, Graphics g, int x, int y) { JComponent component = (JComponent) c; int iconWidth = getIconWidth(); g.translate(x, y); g.setColor( component.isEnabled() ? MetalLookAndFeel.getControlInfo() : MetalLookAndFeel.getControlShadow()); g.drawLine(0, 0, iconWidth - 1, 0); g.drawLine(1, 1, 1 + (iconWidth - 3), 1); g.drawLine(2, 2, 2 + (iconWidth - 5), 2); g.drawLine(3, 3, 3 + (iconWidth - 7), 3); g.drawLine(4, 4, 4 + (iconWidth - 9), 4); g.translate(-x, -y); }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { g.translate(x, y); if (MetalLookAndFeel.usingOcean()) { g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawRect(0, 0, w, h - 1); g.setColor(MetalLookAndFeel.getControlShadow()); g.drawRect(1, 1, w - 2, h - 3); } else { g.setColor(MetalLookAndFeel.getControlDarkShadow()); g.drawLine(0, 0, w - 1, 0); g.drawLine(0, 0, 0, h - 2); g.drawLine(0, h - 2, w - 1, h - 2); g.setColor(MetalLookAndFeel.getControlHighlight()); g.drawLine(1, 1, w - 1, 1); g.drawLine(1, 1, 1, h - 1); g.drawLine(1, h - 1, w - 1, h - 1); g.setColor(MetalLookAndFeel.getControl()); g.drawLine(1, h - 2, 1, h - 2); } g.translate(-x, -y); }