/[classpath]/classpath/javax/swing/plaf/metal/MetalButtonUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/metal/MetalButtonUI.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by rabbit78, Tue Nov 15 20:51:37 2005 UTC revision 1.12 by rabbit78, Wed Nov 16 15:43:34 2005 UTC
# Line 47  import java.awt.Rectangle; Line 47  import java.awt.Rectangle;
47  import javax.swing.AbstractButton;  import javax.swing.AbstractButton;
48  import javax.swing.JButton;  import javax.swing.JButton;
49  import javax.swing.JComponent;  import javax.swing.JComponent;
50    import javax.swing.SwingConstants;
51  import javax.swing.UIManager;  import javax.swing.UIManager;
52  import javax.swing.plaf.ComponentUI;  import javax.swing.plaf.ComponentUI;
53  import javax.swing.plaf.UIResource;  import javax.swing.plaf.UIResource;
# Line 228  public class MetalButtonUI Line 229  public class MetalButtonUI
229          g.drawString(text, textRect.x, textRect.y + fm.getAscent());          g.drawString(text, textRect.x, textRect.y + fm.getAscent());
230        }          }  
231    }    }
232    
233      /**
234       * If the property <code>Button.gradient</code> is set, then a gradient is
235       * painted as background, otherwise the normal superclass behaviour is
236       * called.
237       */
238      public void update(Graphics g, JComponent c)
239      {
240        if (c.isOpaque() && UIManager.get(getPropertyPrefix() + "gradient") != null)
241          {
242            MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(),
243                                     SwingConstants.VERTICAL,
244                                     getPropertyPrefix() + "gradient");
245            paint(g, c);
246          }
247        else
248          super.update(g, c);
249      }
250  }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26