< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxButton.java

Print this page




  53         putClientProperty("JButton.buttonType", "comboboxInternal");
  54 
  55         this.ui = ui;
  56         this.comboBox = comboBox;
  57         this.rendererPane = rendererPane;
  58         this.list = list;
  59 
  60         setModel(new DefaultButtonModel() {
  61             public void setArmed(final boolean armed) {
  62                 super.setArmed(isPressed() ? true : armed);
  63             }
  64         });
  65 
  66         setEnabled(comboBox.isEnabled());
  67     }
  68 
  69     public boolean isEnabled() {
  70         return comboBox == null ? true : comboBox.isEnabled();
  71     }
  72 

  73     public boolean isFocusTraversable() {
  74         return false;
  75     }
  76 
  77     protected void setIsPopDown(final boolean isPopDown) {
  78         this.isPopDown = isPopDown;
  79         repaint();
  80     }
  81 
  82     protected void setIsSquare(final boolean isSquare) {
  83         this.isSquare = isSquare;
  84         repaint();
  85     }
  86 
  87     protected State getState(final ButtonModel buttonModel) {
  88         if (!comboBox.isEnabled()) return State.DISABLED;
  89         if (!AquaFocusHandler.isActive(comboBox)) return State.INACTIVE;
  90         if (buttonModel.isArmed()) return State.PRESSED;
  91         return State.ACTIVE;
  92     }




  53         putClientProperty("JButton.buttonType", "comboboxInternal");
  54 
  55         this.ui = ui;
  56         this.comboBox = comboBox;
  57         this.rendererPane = rendererPane;
  58         this.list = list;
  59 
  60         setModel(new DefaultButtonModel() {
  61             public void setArmed(final boolean armed) {
  62                 super.setArmed(isPressed() ? true : armed);
  63             }
  64         });
  65 
  66         setEnabled(comboBox.isEnabled());
  67     }
  68 
  69     public boolean isEnabled() {
  70         return comboBox == null ? true : comboBox.isEnabled();
  71     }
  72 
  73     @SuppressWarnings("deprecation")
  74     public boolean isFocusTraversable() {
  75         return false;
  76     }
  77 
  78     protected void setIsPopDown(final boolean isPopDown) {
  79         this.isPopDown = isPopDown;
  80         repaint();
  81     }
  82 
  83     protected void setIsSquare(final boolean isSquare) {
  84         this.isSquare = isSquare;
  85         repaint();
  86     }
  87 
  88     protected State getState(final ButtonModel buttonModel) {
  89         if (!comboBox.isEnabled()) return State.DISABLED;
  90         if (!AquaFocusHandler.isActive(comboBox)) return State.INACTIVE;
  91         if (buttonModel.isArmed()) return State.PRESSED;
  92         return State.ACTIVE;
  93     }


< prev index next >