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

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

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

revision 1.6 by rabbit78, Wed Oct 19 13:46:02 2005 UTC revision 1.7 by trebligd, Wed Oct 19 14:54:55 2005 UTC
# Line 41  package javax.swing.plaf.metal; Line 41  package javax.swing.plaf.metal;
41  import java.awt.Container;  import java.awt.Container;
42  import java.awt.Dimension;  import java.awt.Dimension;
43  import java.awt.Graphics;  import java.awt.Graphics;
44    import java.awt.Insets;
45  import java.awt.LayoutManager;  import java.awt.LayoutManager;
46  import java.awt.Rectangle;  import java.awt.Rectangle;
47  import java.awt.event.MouseEvent;  import java.awt.event.MouseEvent;
# Line 49  import java.beans.PropertyChangeListener Line 50  import java.beans.PropertyChangeListener
50    
51  import javax.swing.CellRendererPane;  import javax.swing.CellRendererPane;
52  import javax.swing.ComboBoxEditor;  import javax.swing.ComboBoxEditor;
53    import javax.swing.Icon;
54  import javax.swing.JButton;  import javax.swing.JButton;
55  import javax.swing.JComboBox;  import javax.swing.JComboBox;
56  import javax.swing.JComponent;  import javax.swing.JComponent;
# Line 210  public class MetalComboBoxUI extends Bas Line 212  public class MetalComboBoxUI extends Bas
212     */     */
213    protected JButton createArrowButton()    protected JButton createArrowButton()
214    {    {
215      return new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(),      JButton button = new MetalComboBoxButton(comboBox, new MetalComboBoxIcon(),
216              new CellRendererPane(), listBox);                new CellRendererPane(), listBox);  
217        button.setMargin(new Insets(0, 1, 1, 3));
218        return button;
219    }    }
220        
221    /**    /**
# Line 291  public class MetalComboBoxUI extends Bas Line 295  public class MetalComboBoxUI extends Bas
295     */     */
296    public Dimension getMinimumSize(JComponent c)    public Dimension getMinimumSize(JComponent c)
297    {    {
298      // FIXME: this needs work      MetalComboBoxButton b = (MetalComboBoxButton) arrowButton;
299      Dimension result = super.getMinimumSize(c);      Icon icon = b.getComboIcon();
300      result.height = result.height + 9;      Insets insets = b.getInsets();
301      return result;        Dimension d = getDisplaySize();
302        int insetsH = insets.top + insets.bottom;
303        int insetsW = insets.left + insets.right;
304        int iconWidth = icon.getIconWidth() + 6;
305        return new Dimension(d.width + insetsW + iconWidth,
306                d.height + insetsH);
307    }    }
308        
309  }  }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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