/[classpath]/classpath/javax/swing/plaf/basic/BasicButtonUI.java
ViewVC logotype

Diff of /classpath/javax/swing/plaf/basic/BasicButtonUI.java

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

revision 1.31 by rabbit78, Wed Oct 12 12:09:59 2005 UTC revision 1.32 by rabbit78, Tue Oct 25 19:57:04 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.swing.plaf.basic;  package javax.swing.plaf.basic;
40    
 import java.awt.Color;  
41  import java.awt.Dimension;  import java.awt.Dimension;
42  import java.awt.Font;  import java.awt.Font;
43  import java.awt.FontMetrics;  import java.awt.FontMetrics;
# Line 78  public class BasicButtonUI extends Butto Line 77  public class BasicButtonUI extends Butto
77    
78    private int textShiftOffset;    private int textShiftOffset;
79    
   private Color focusColor;  
   
80    /**    /**
81     * Factory method to create an instance of BasicButtonUI for a given     * Factory method to create an instance of BasicButtonUI for a given
82     * {@link JComponent}, which should be an {@link AbstractButton}.     * {@link JComponent}, which should be an {@link AbstractButton}.
# Line 160  public class BasicButtonUI extends Butto Line 157  public class BasicButtonUI extends Butto
157      LookAndFeel.installColorsAndFont(b, prefix + "background",      LookAndFeel.installColorsAndFont(b, prefix + "background",
158                                       prefix + "foreground", prefix + "font");                                       prefix + "foreground", prefix + "font");
159      LookAndFeel.installBorder(b, prefix + "border");      LookAndFeel.installBorder(b, prefix + "border");
     focusColor = UIManager.getColor(prefix + "focus");  
160      b.setMargin(UIManager.getInsets(prefix + "margin"));      b.setMargin(UIManager.getInsets(prefix + "margin"));
161      b.setIconTextGap(UIManager.getInt(prefix + "textIconGap"));      b.setIconTextGap(UIManager.getInt(prefix + "textIconGap"));
162      b.setInputMap(JComponent.WHEN_FOCUSED,      b.setInputMap(JComponent.WHEN_FOCUSED,
# Line 401  public class BasicButtonUI extends Butto Line 397  public class BasicButtonUI extends Butto
397     */     */
398    protected void paintButtonPressed(Graphics g, AbstractButton b)    protected void paintButtonPressed(Graphics g, AbstractButton b)
399    {    {
400      if (b.isContentAreaFilled())      if (b.isContentAreaFilled() && b.isOpaque())
401        {        {
402          Rectangle area = new Rectangle();          Rectangle area = new Rectangle();
403          SwingUtilities.calculateInnerArea(b, area);          SwingUtilities.calculateInnerArea(b, area);
404          g.setColor(b.getBackground().darker());          g.setColor(UIManager.getColor(getPropertyPrefix() + "shadow"));
405          g.fillRect(area.x, area.y, area.width, area.height);          g.fillRect(area.x, area.y, area.width, area.height);
406        }        }
407    }    }

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

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