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

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

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

revision 1.1 by mark, Sun Sep 5 11:31:06 2004 UTC revision 1.2 by mkoch, Wed Sep 22 12:43:13 2004 UTC
# Line 796  public class BasicComboBoxUI extends Com Line 796  public class BasicComboBoxUI extends Com
796                                                                     currentValue,                                                                     currentValue,
797                                                                     -1,                                                                     -1,
798                                                                     isPressed,                                                                     isPressed,
799                                                                     isPressed);                                                                     hasFocus);
800              if (! comboBox.isEnabled())              if (! comboBox.isEnabled())
801                comp.setEnabled(false);                comp.setEnabled(false);
802    
# Line 1127  public class BasicComboBoxUI extends Com Line 1127  public class BasicComboBoxUI extends Com
1127       */       */
1128      public void intervalRemoved(ListDataEvent e)      public void intervalRemoved(ListDataEvent e)
1129      {      {
1130        // must determine if the size of the combo box should change        
1131        // FIXME: need to implement        // recalculate display size of the JComboBox.
1132          largestItemSize = getLargestItemSize();
1133          comboBox.repaint();
1134      }      }
1135    }    }
1136    
# Line 1142  public class BasicComboBoxUI extends Com Line 1144  public class BasicComboBoxUI extends Com
1144      {      {
1145      }      }
1146    
1147        /**
1148         * This method is invoked whenever bound property of JComboBox changes.
1149         */
1150      public void propertyChange(PropertyChangeEvent e)      public void propertyChange(PropertyChangeEvent e)
1151      {      {
1152        if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY))        if (e.getPropertyName().equals(JComboBox.ENABLED_CHANGED_PROPERTY))
1153          {          {
           // disable arrow button        
1154            arrowButton.setEnabled(comboBox.isEnabled());            arrowButton.setEnabled(comboBox.isEnabled());
1155    
1156            if (comboBox.isEditable())            if (comboBox.isEditable())
# Line 1169  public class BasicComboBoxUI extends Com Line 1173  public class BasicComboBoxUI extends Com
1173            comboBox.revalidate();            comboBox.revalidate();
1174            comboBox.repaint();            comboBox.repaint();
1175          }          }
1176          else if (e.getPropertyName().equals(JComboBox.MODEL_CHANGED_PROPERTY))
1177            {
1178              // remove ListDataListener from old model and add it to new model
1179              ComboBoxModel oldModel = (ComboBoxModel) e.getOldValue();
1180              if (oldModel != null)
1181                oldModel.removeListDataListener(listDataListener);
1182    
1183              if ((ComboBoxModel) e.getNewValue() != null)
1184                comboBox.getModel().addListDataListener(listDataListener);
1185            }
1186    
1187        // FIXME: Need to handle changes in other bound properties.              // FIXME: Need to handle changes in other bound properties.      
1188      }      }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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