/[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.27 by rabbit78, Tue Sep 20 09:51:52 2005 UTC revision 1.28 by rabbit78, Wed Sep 28 15:17:42 2005 UTC
# Line 220  public class BasicButtonUI extends Butto Line 220  public class BasicButtonUI extends Butto
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();
# Line 287  public class BasicButtonUI extends Butto Line 287  public class BasicButtonUI extends Butto
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)
# Line 355  public class BasicButtonUI extends Butto Line 353  public class BasicButtonUI extends Butto
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

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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