Class MetalComboBoxUI
java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ComboBoxUI
javax.swing.plaf.basic.BasicComboBoxUI
javax.swing.plaf.metal.MetalComboBoxUI
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 XMLEncoder.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis class should be treated as a "protected" inner class.classDeprecated.As of Java 2 platform v1.4.classThis class should be treated as a "protected" inner class.Nested classes/interfaces inherited from class BasicComboBoxUI
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler -
Field Summary
Fields inherited from class BasicComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener, squareButton -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidThis protected method is implementation specific and should be private. do not call or override.protected JButtonCreates a button which will be used as the control to show or hide the popup portion of the combo box.protected ComboBoxEditorCreates the default editor that will be used in editable combo boxes.protected LayoutManagerCreates a layout manager for managing the components which make up the combo box.protected ComboPopupCreates the popup portion of the combo box.Creates aPropertyChangeListenerwhich will be added to the combo box.static ComponentUIConstructs an instance ofMetalComboBoxUI.protected voidDeprecated.As of Java 2 platform v1.4.intgetBaseline(JComponent c, int width, int height) Returns the baseline.The minimum size is the size of the display area plus insets plus the button.voidlayoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager) Lays out theJComboBoxin theparentcontainer.voidpaint(Graphics g, JComponent c) Paints the specified component appropriately for the look and feel.voidpaintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) If necessary paints the currently selected item.voidpaintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus) If necessary paints the background of the currently selected item.protected voidDeprecated.As of Java 2 platform v1.4.voidThis protected method is implementation specific and should be private.Methods inherited from class BasicComboBoxUI
addEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, getSizeForComponent, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUIMethods inherited from class ComponentUI
contains, update
-
Constructor Details
-
MetalComboBoxUI
public MetalComboBoxUI()Constructs aMetalComboBoxUI.
-
-
Method Details
-
createUI
Constructs an instance ofMetalComboBoxUI.- Parameters:
c- a component- Returns:
- an instance of
MetalComboBoxUI
-
paint
Description copied from class:ComponentUIPaints the specified component appropriately for the look and feel. This method is invoked from theComponentUI.updatemethod when the specified component is being painted. Subclasses should override this method and use the specifiedGraphicsobject to render the content of the component.- Overrides:
paintin classBasicComboBoxUI- Parameters:
g- theGraphicscontext in which to paintc- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
-
paintCurrentValue
If necessary paints the currently selected item.- Overrides:
paintCurrentValuein classBasicComboBoxUI- Parameters:
g- Graphics to paint tobounds- Region to paint current value tohasFocus- whether or not the JComboBox has focus- Throws:
NullPointerException- if any of the arguments are null.- Since:
- 1.5
-
paintCurrentValueBackground
If necessary paints the background of the currently selected item.- Overrides:
paintCurrentValueBackgroundin classBasicComboBoxUI- Parameters:
g- Graphics to paint tobounds- Region to paint background tohasFocus- whether or not the JComboBox has focus- Throws:
NullPointerException- if any of the arguments are null.- Since:
- 1.5
-
getBaseline
Returns the baseline.- Overrides:
getBaselinein classBasicComboBoxUI- Parameters:
c-JComponentbaseline is being requested forwidth- the width to get the baseline forheight- the height to get the baseline for- Returns:
- baseline or a value < 0 indicating there is no reasonable baseline
- Throws:
NullPointerException- ifcisnullIllegalArgumentException- if width or height is < 0- Since:
- 1.6
- See Also:
-
createEditor
Description copied from class:BasicComboBoxUICreates 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 withsetEditor.- Overrides:
createEditorin classBasicComboBoxUI- Returns:
- a
ComboBoxEditorused for the combo box - See Also:
-
createPopup
Description copied from class:BasicComboBoxUICreates the popup portion of the combo box.- Overrides:
createPopupin classBasicComboBoxUI- Returns:
- an instance of
ComboPopup - See Also:
-
createArrowButton
Description copied from class:BasicComboBoxUICreates a button which will be used as the control to show or hide the popup portion of the combo box.- Overrides:
createArrowButtonin classBasicComboBoxUI- Returns:
- a button which represents the popup control
-
createPropertyChangeListener
Description copied from class:BasicComboBoxUICreates aPropertyChangeListenerwhich will be added to the combo box. If this method returns null then it will not be added to the combo box.- Overrides:
createPropertyChangeListenerin classBasicComboBoxUI- Returns:
- an instance of a
PropertyChangeListeneror null
-
editablePropertyChanged
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- an instance ofPropertyChangeEvent
-
createLayoutManager
Description copied from class:BasicComboBoxUICreates a layout manager for managing the components which make up the combo box.- Overrides:
createLayoutManagerin classBasicComboBoxUI- Returns:
- an instance of a layout manager
-
layoutComboBox
Lays out theJComboBoxin theparentcontainer.- Parameters:
parent- a containermanager- an instance ofMetalComboBoxLayoutManager
-
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:BasicComboBoxUIThis protected method is implementation specific and should be private. do not call or override.- Overrides:
configureEditorin classBasicComboBoxUI- See Also:
-
unconfigureEditor
public void unconfigureEditor()Description copied from class:BasicComboBoxUIThis protected method is implementation specific and should be private. Do not call or override.- Overrides:
unconfigureEditorin classBasicComboBoxUI- See Also:
-
getMinimumSize
Description copied from class:BasicComboBoxUIThe minimum size is the size of the display area plus insets plus the button.- Overrides:
getMinimumSizein classBasicComboBoxUI- Parameters:
c- the component whose minimum size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- Returns:
- a
Dimensionobject ornull - See Also:
-