134 |
public void installDefaults(AbstractButton button) |
public void installDefaults(AbstractButton button) |
135 |
{ |
{ |
136 |
super.installDefaults(button); |
super.installDefaults(button); |
137 |
if (button.isRolloverEnabled()) |
button.setRolloverEnabled(UIManager.getBoolean( |
138 |
{ |
getPropertyPrefix() + "rollover")); |
|
if (button.getBorder() instanceof UIResource) |
|
|
button.setBorder(MetalBorders.getRolloverBorder()); |
|
|
} |
|
139 |
} |
} |
140 |
|
|
141 |
/** |
/** |
144 |
public void uninstallDefaults(AbstractButton button) |
public void uninstallDefaults(AbstractButton button) |
145 |
{ |
{ |
146 |
super.uninstallDefaults(button); |
super.uninstallDefaults(button); |
147 |
if (button.getBorder() instanceof UIResource) |
button.setRolloverEnabled(false); |
|
button.setBorder(null); |
|
148 |
} |
} |
149 |
|
|
150 |
/** |
/** |
233 |
*/ |
*/ |
234 |
public void update(Graphics g, JComponent c) |
public void update(Graphics g, JComponent c) |
235 |
{ |
{ |
236 |
if (c.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null) |
AbstractButton b = (AbstractButton) c; |
237 |
|
if (b.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null |
238 |
|
&& !b.getModel().isPressed() && b.isEnabled()) |
239 |
{ |
{ |
240 |
MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), |
MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(), |
241 |
SwingConstants.VERTICAL, |
SwingConstants.VERTICAL, |