APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.metal

public Class MetalComboBoxUI

extends BasicComboBoxUI
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.awt.*, java.awt.event.*, javax.swing.*, javax.swing.plaf.*, javax.swing.border.*, javax.swing.plaf.basic.*, java.io.Serializable, java.beans.*

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 JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Author
Tom Santos
See Also
MetalComboBoxEditor, MetalComboBoxButton

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
MetalComboBoxUI.MetalComboBoxLayoutManager

This class should be treated as a "protected" inner class.

public class
MetalComboBoxUI.MetalComboPopup

Deprecated As of Java 2 platform v1.4.
This class should be treated as a "protected" inner class.
public class
MetalComboBoxUI.MetalPropertyChangeListener

This class should be treated as a "protected" inner class.

Field Summary

Inherited from javax.swing.plaf.basic.BasicComboBoxUI:
arrowButtoncachedMinimumSizecomboBoxcurrentValuePaneeditorfocusListenerhasFocusisMinimumSizeDirtyitemListenerkeyListenerlistBoxlistDataListenerpaddingpopuppopupKeyListenerpopupMouseListenerpopupMouseMotionListenerpropertyChangeListenersquareButton

Constructor Summary

AccessConstructor and Description
public
MetalComboBoxUI()

Constructs a MetalComboBoxUI.

Method Summary

Modifier and TypeMethod and Description
public void
configureEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.configureEditor.

This protected method is implementation specific and should be private.

protected JButton
createArrowButton()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createArrowButton.

Creates a button which will be used as the control to show or hide the popup portion of the combo box.

protected ComboBoxEditor
createEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createEditor.

Creates the default editor that will be used in editable combo boxes.

protected LayoutManager
createLayoutManager()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createLayoutManager.

Creates a layout manager for managing the components which make up the combo box.

protected ComboPopup
createPopup()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createPopup.

Creates the popup portion of the combo box.

public PropertyChangeListener
createPropertyChangeListener()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createPropertyChangeListener.

Creates a PropertyChangeListener which will be added to the combo box.

public static ComponentUI

Returns:

an instance of MetalComboBoxUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.basic.BasicComboBoxUI.createUI.

Constructs an instance of MetalComboBoxUI.

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

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

public int
getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.getBaseline.

Returns the baseline.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize.

The minimum size is the size of the display area plus insets plus the button.

public void
layoutComboBox(Container
a container
parent
,
MetalComboBoxUI.MetalComboBoxLayoutManager
an instance of MetalComboBoxLayoutManager
manager
)

Lays out the JComboBox in the parent container.

public void
paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paint.

Paints the specified component appropriately for the look and feel.

public void
paintCurrentValue(Graphics
Graphics to paint to
g
,
Rectangle
Region to paint current value to
bounds
,
boolean
whether or not the JComboBox has focus
hasFocus
)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue.

If necessary paints the currently selected item.

public void
paintCurrentValueBackground(Graphics
Graphics to paint to
g
,
Rectangle
Region to paint background to
bounds
,
boolean
whether or not the JComboBox has focus
hasFocus
)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValueBackground.

If necessary paints the background of the currently selected item.

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

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

public void
unconfigureEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.unconfigureEditor.

This protected method is implementation specific and should be private.

private void
updateButtonForOcean(JButton button)

Resets the necessary state on the ComboBoxButton for ocean.

Inherited from javax.swing.plaf.basic.BasicComboBoxUI:
addEditorconfigureArrowButtoncreateFocusListenercreateItemListenercreateKeyListenercreateListDataListenercreateRenderergetAccessibleChildgetAccessibleChildrenCountgetBaselineResizeBehaviorgetDefaultSizegetDisplaySizegetInsetsgetMaximumSizegetPreferredSizegetSizeForComponentinstallComponentsinstallDefaultsinstallKeyboardActionsinstallListenersinstallUIisFocusTraversableisNavigationKeyisPopupVisiblerectangleForCurrentValueremoveEditorselectNextPossibleValueselectPreviousPossibleValuesetPopupVisibletoggleOpenCloseunconfigureArrowButtonuninstallComponentsuninstallDefaultsuninstallKeyboardActionsuninstallListenersuninstallUI

Constructor Detail

MetalComboBoxUIback to summary
public MetalComboBoxUI()

Constructs a MetalComboBoxUI.

Method Detail

configureEditorback to summary
public void configureEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.configureEditor.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.configureEditor.

This protected method is implementation specific and should be private. do not call or override.

createArrowButtonback to summary
protected JButton createArrowButton()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createArrowButton.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.createArrowButton.

Creates a button which will be used as the control to show or hide the popup portion of the combo box.

createEditorback to summary
protected ComboBoxEditor createEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createEditor.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.createEditor.

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.

createLayoutManagerback to summary
protected LayoutManager createLayoutManager()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createLayoutManager.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.createLayoutManager.

Creates a layout manager for managing the components which make up the combo box.

createPopupback to summary
protected ComboPopup createPopup()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createPopup.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.createPopup.

Creates the popup portion of the combo box.

createPropertyChangeListenerback to summary
public PropertyChangeListener createPropertyChangeListener()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.createPropertyChangeListener.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.createPropertyChangeListener.

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.

createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.basic.BasicComboBoxUI.createUI.

Constructs an instance of MetalComboBoxUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

an instance of MetalComboBoxUI

editablePropertyChangedback to summary
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.

Parameters
e:PropertyChangeEvent

an instance of PropertyChangeEvent

Annotations
@Deprecated
getBaselineback to summary
public int getBaseline(JComponent c, int width, int height)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.getBaseline.

Returns the baseline.

Exceptions
NullPointerException:
if c is null
IllegalArgumentException:
if width or height is < 0
Since
1.6
See Also
javax.swing.JComponent#getBaseline(int, int)
getMinimumSizeback to summary
public Dimension getMinimumSize(JComponent c)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.getMinimumSize.

The minimum size is the size of the display area plus insets plus the button.

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

Lays out the JComboBox in the parent container.

Parameters
parent:Container

a container

manager:MetalComboBoxUI.MetalComboBoxLayoutManager

an instance of MetalComboBoxLayoutManager

paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paint.

Doc from javax.swing.plaf.ComponentUI.paint.

Paints the specified component appropriately 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.

paintCurrentValueback to summary
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue.

If necessary paints the currently selected item.

Parameters
g:Graphics

Graphics to paint to

bounds:Rectangle

Region to paint current value to

hasFocus:boolean

whether or not the JComboBox has focus

Exceptions
NullPointerException:
if any of the arguments are null.
Since
1.5
paintCurrentValueBackgroundback to summary
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValueBackground.

If necessary paints the background of the currently selected item.

Parameters
g:Graphics

Graphics to paint to

bounds:Rectangle

Region to paint background to

hasFocus:boolean

whether or not the JComboBox has focus

Exceptions
NullPointerException:
if any of the arguments are null.
Since
1.5
removeListenersback to summary
protected void removeListeners()

Deprecated

As of Java 2 platform v1.4.

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

Annotations
@Deprecated
unconfigureEditorback to summary
public void unconfigureEditor()

Overrides javax.swing.plaf.basic.BasicComboBoxUI.unconfigureEditor.

Doc from javax.swing.plaf.basic.BasicComboBoxUI.unconfigureEditor.

This protected method is implementation specific and should be private. Do not call or override.

updateButtonForOceanback to summary
private void updateButtonForOcean(JButton button)

Resets the necessary state on the ComboBoxButton for ocean.

javax.swing.plaf.metal back to summary

public Class MetalComboBoxUI.MetalComboBoxLayoutManager

extends ComboBoxLayoutManager
Class Inheritance

This class should be treated as a "protected" inner class. Instantiate it only within subclasses of MetalComboBoxUI.

Constructor Summary

AccessConstructor and Description
public
MetalComboBoxLayoutManager()

Constructs a MetalComboBoxLayoutManager.

Method Summary

Modifier and TypeMethod and Description
public void
public void
superLayout(Container
a container
parent
)

Lays out the parent container.

Inherited from javax.swing.plaf.basic.BasicComboBoxUI.ComboBoxLayoutManager:
addLayoutComponentminimumLayoutSizepreferredLayoutSizeremoveLayoutComponent

Constructor Detail

MetalComboBoxLayoutManagerback to summary
public MetalComboBoxLayoutManager()

Constructs a MetalComboBoxLayoutManager.

Method Detail

layoutContainerback to summary
public void layoutContainer(Container parent)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.ComboBoxLayoutManager.layoutContainer.

Implements java.awt.LayoutManager.layoutContainer.

Doc from java.awt.LayoutManager.layoutContainer.

Lays out the specified container.

superLayoutback to summary
public void superLayout(Container parent)

Lays out the parent container.

Parameters
parent:Container

a container

javax.swing.plaf.metal back to summary

public Class MetalComboBoxUI.MetalComboPopup

extends BasicComboPopup
Class Inheritance
Annotations
@Deprecated

Deprecated

As of Java 2 platform v1.4.

This class should be treated as a "protected" inner class. Instantiate it only within subclasses of MetalComboBoxUI. This class is now obsolete and doesn't do anything and is only included for backwards API compatibility. Do not call or override.

Field Summary

Inherited from javax.swing.plaf.basic.BasicComboPopup:
autoscrollTimercomboBoxhasEnteredisAutoScrollingitemListenerkeyListenerlistlistDataListenerlistMouseListenerlistMouseMotionListenerlistSelectionListenermouseListenermouseMotionListenerpropertyChangeListenerSCROLL_DOWNSCROLL_UPscrollDirectionscrollervalueIsAdjusting

Constructor Summary

AccessConstructor and Description
public
MetalComboPopup(JComboBox<Object>
an instance of JComboBox
cBox
)

Constructs a new instance of MetalComboPopup.

Method Summary

Modifier and TypeMethod and Description
public void
delegateFocus(MouseEvent e)

Overrides javax.swing.plaf.basic.BasicComboPopup.delegateFocus.

This is a utility method that helps event handlers figure out where to send the focus when the popup is brought up.

Inherited from javax.swing.plaf.basic.BasicComboPopup:
autoScrollDownautoScrollUpcomputePopupBoundsconfigureListconfigurePopupconfigureScrollerconvertMouseEventcreateItemListenercreateKeyListenercreateListcreateListDataListenercreateListMouseListenercreateListMouseMotionListenercreateListSelectionListenercreateMouseListenercreateMouseMotionListenercreatePropertyChangeListenercreateScrollerfirePopupMenuCanceledfirePopupMenuWillBecomeInvisiblefirePopupMenuWillBecomeVisiblegetAccessibleContextgetKeyListenergetListgetMouseListenergetMouseMotionListenergetPopupHeightForRowCounthideinstallComboBoxListenersinstallComboBoxModelListenersinstallKeyboardActionsinstallListListenersisFocusTraversableshowstartAutoScrollingstopAutoScrollingtogglePopupuninstallComboBoxModelListenersuninstallingUIuninstallKeyboardActionsupdateListBoxSelectionForEvent

Constructor Detail

MetalComboPopupback to summary
public MetalComboPopup(JComboBox<Object> cBox)

Constructs a new instance of MetalComboPopup.

Parameters
cBox:JComboBox<Object>

an instance of JComboBox

Method Detail

delegateFocusback to summary
public void delegateFocus(MouseEvent e)

Overrides javax.swing.plaf.basic.BasicComboPopup.delegateFocus.

Doc from javax.swing.plaf.basic.BasicComboPopup.delegateFocus.

This is a utility method that helps event handlers figure out where to send the focus when the popup is brought up. The standard implementation delegates the focus to the editor (if the combo box is editable) or to the JComboBox if it is not editable.

javax.swing.plaf.metal back to summary

public Class MetalComboBoxUI.MetalPropertyChangeListener

extends PropertyChangeHandler
Class Inheritance

This class should be treated as a "protected" inner class. Instantiate it only within subclasses of MetalComboBoxUI.

Constructor Summary

AccessConstructor and Description
public
MetalPropertyChangeListener()

Constructs a MetalPropertyChangeListener.

Method Summary

Modifier and TypeMethod and Description
public void

Constructor Detail

MetalPropertyChangeListenerback to summary
public MetalPropertyChangeListener()

Constructs a MetalPropertyChangeListener.

Method Detail

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Overrides javax.swing.plaf.basic.BasicComboBoxUI.PropertyChangeHandler.propertyChange.

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.