JavaTM 2 Platform
Std. Ed. v1.4.2

javax.swing.plaf.metal
Class MetalComboBoxUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byjavax.swing.plaf.ComboBoxUI
          extended byjavax.swing.plaf.basic.BasicComboBoxUI
              extended byjavax.swing.plaf.metal.MetalComboBoxUI

public class MetalComboBoxUI
extends BasicComboBoxUI

Metal UI for JComboBox

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

See Also:
MetalComboBoxEditor, MetalComboBoxButton

Nested Class Summary
 class MetalComboBoxUI.MetalComboBoxLayoutManager
          This inner class is marked "public" due to a compiler bug.
 class MetalComboBoxUI.MetalComboPopup
          Deprecated. As of Java 2 platform v1.4.
 class MetalComboBoxUI.MetalPropertyChangeListener
          This inner class is marked "public" due to a compiler bug.
 
Nested classes inherited from class javax.swing.plaf.basic.BasicComboBoxUI
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener
 
Constructor Summary
MetalComboBoxUI()
           
 
Method Summary
 void configureEditor()
          This protected method is implementation specific and should be private.
protected  JButton createArrowButton()
          Creates an button which will be used as the control to show or hide the popup portion of the combo box.
protected  ComboBoxEditor createEditor()
          Creates the default editor that will be used in editable combo boxes.
protected  LayoutManager createLayoutManager()
          Creates a layout manager for managing the components which make up the combo box.
protected  ComboPopup createPopup()
          Creates the popup portion of the combo box.
 PropertyChangeListener createPropertyChangeListener()
          Creates a PropertyChangeListener which will be added to the combo box.
static ComponentUI createUI(JComponent c)
          Returns an instance of the UI delegate for the specified component.
protected  void editablePropertyChanged(PropertyChangeEvent e)
          Deprecated. As of Java 2 platform v1.4.
 Dimension getMinimumSize(JComponent c)
          The minumum size is the size of the display area plus insets plus the button.
 void layoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager)
           
 void paint(Graphics g, JComponent c)
          Paints the specified component appropriate for the look and feel.
protected  void removeListeners()
          Deprecated. As of Java 2 platform v1.4.
 void unconfigureEditor()
          This protected method is implementation specific and should be private.
 
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, paintCurrentValue, paintCurrentValueBackground, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetalComboBoxUI

public MetalComboBoxUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Description copied from class: ComponentUI
Returns an instance of the UI delegate for the specified component. Each subclass must provide its own static createUI method that returns an instance of that UI delegate subclass. If the UI delegate subclass is stateless, it may return an instance that is shared by multiple components. If the UI delegate is stateful, then it should return a new instance per component. The default implementation of this method throws an error, as it should never be invoked.


paint

public void paint(Graphics g,
                  JComponent c)
Description copied from class: ComponentUI
Paints the specified component appropriate for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

Overrides:
paint in class BasicComboBoxUI

createEditor

protected ComboBoxEditor createEditor()
Description copied from class: BasicComboBoxUI
Creates the default editor that will be used in editable combo boxes. A default editor will be used only if an editor has not been explicitly set with setEditor.

Overrides:
createEditor in class BasicComboBoxUI
Returns:
a ComboBoxEditor used for the combo box
See Also:
JComboBox.setEditor(javax.swing.ComboBoxEditor)

createPopup

protected ComboPopup createPopup()
Description copied from class: BasicComboBoxUI
Creates the popup portion of the combo box.

Overrides:
createPopup in class BasicComboBoxUI
Returns:
an instance of ComboPopup
See Also:
ComboPopup

createArrowButton

protected JButton createArrowButton()
Description copied from class: BasicComboBoxUI
Creates an button which will be used as the control to show or hide the popup portion of the combo box.

Overrides:
createArrowButton in class BasicComboBoxUI
Returns:
a button which represents the popup control

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener()
Description copied from class: BasicComboBoxUI
Creates a PropertyChangeListener which will be added to the combo box. If this method returns null then it will not be added to the combo box.

Overrides:
createPropertyChangeListener in class BasicComboBoxUI
Returns:
an instance of a PropertyChangeListener or null

editablePropertyChanged

protected void editablePropertyChanged(PropertyChangeEvent e)
Deprecated. As of Java 2 platform v1.4.

As of Java 2 platform v1.4 this method is no longer used. Do not call or override. All the functionality of this method is in the MetalPropertyChangeListener.


createLayoutManager

protected LayoutManager createLayoutManager()
Description copied from class: BasicComboBoxUI
Creates a layout manager for managing the components which make up the combo box.

Overrides:
createLayoutManager in class BasicComboBoxUI
Returns:
an instance of a layout manager

layoutComboBox

public void layoutComboBox(Container parent,
                           MetalComboBoxUI.MetalComboBoxLayoutManager manager)

removeListeners

protected void removeListeners()
Deprecated. As of Java 2 platform v1.4.

As of Java 2 platform v1.4 this method is no longer used.


configureEditor

public void configureEditor()
Description copied from class: BasicComboBoxUI
This protected method is implementation specific and should be private. do not call or override.

Overrides:
configureEditor in class BasicComboBoxUI
See Also:
BasicComboBoxUI.addEditor()

unconfigureEditor

public void unconfigureEditor()
Description copied from class: BasicComboBoxUI
This protected method is implementation specific and should be private. Do not call or override.

Overrides:
unconfigureEditor in class BasicComboBoxUI
See Also:
BasicComboBoxUI.addEditor()

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Description copied from class: BasicComboBoxUI
The minumum size is the size of the display area plus insets plus the button.

Overrides:
getMinimumSize in class BasicComboBoxUI

JavaTM 2 Platform
Std. Ed. v1.4.2

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.