220 |
return d; |
return d; |
221 |
} |
} |
222 |
|
|
223 |
private static Icon currentIcon(AbstractButton b) |
static Icon currentIcon(AbstractButton b) |
224 |
{ |
{ |
225 |
Icon i = b.getIcon(); |
Icon i = b.getIcon(); |
226 |
ButtonModel model = b.getModel(); |
ButtonModel model = b.getModel(); |
287 |
if ((b.getModel().isArmed() && b.getModel().isPressed()) |
if ((b.getModel().isArmed() && b.getModel().isPressed()) |
288 |
|| b.isSelected()) |
|| b.isSelected()) |
289 |
paintButtonPressed(g, b); |
paintButtonPressed(g, b); |
|
else |
|
|
paintButtonNormal(g, vr, c); |
|
290 |
|
|
291 |
paintIcon(g, c, ir); |
paintIcon(g, c, ir); |
292 |
if (text != null) |
if (text != null) |
353 |
g.fillRect(area.x, area.y, area.width, area.height); |
g.fillRect(area.x, area.y, area.width, area.height); |
354 |
} |
} |
355 |
} |
} |
|
|
|
|
/** |
|
|
* Paints the background area of an {@link AbstractButton} in the normal, |
|
|
* non-pressed state. This means filling the supplied area with the |
|
|
* {@link normalBackgroundColor}. |
|
|
* |
|
|
* @param g The graphics context to paint with |
|
|
* @param area The area in which to paint |
|
|
* @param b The component to paint the state of |
|
|
*/ |
|
|
private void paintButtonNormal(Graphics g, Rectangle area, JComponent b) |
|
|
{ |
|
|
if (((AbstractButton)b).isContentAreaFilled() && b.isOpaque()) |
|
|
{ |
|
|
g.setColor(b.getBackground()); |
|
|
g.fillRect(area.x, area.y, area.width, area.height); |
|
|
} |
|
|
} |
|
356 |
|
|
357 |
/** |
/** |
358 |
* Paints the "text" property of an {@link AbstractButton}, using the |
* Paints the "text" property of an {@link AbstractButton}, using the |