javax.swing.plaf.metal

Class MetalComboBoxUI


public class MetalComboBoxUI
extends BasicComboBoxUI

A UI delegate for the JComboBox component.

Nested Class Summary

class
MetalComboBoxUI.MetalComboBoxLayoutManager
A layout manager that arranges the editor component (if active) and the button that make up the combo box.
class
MetalComboBoxUI.MetalComboPopup
Deprecated. 1.4
class
MetalComboBoxUI.MetalPropertyChangeListener
A listener used to handle property changes in the JComboBox component, to ensure that the UI delegate accurately reflects the current state in the rendering onscreen.

Nested classes/interfaces 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()
Constructs a new instance of MetalComboBoxUI.

Method Summary

void
configureEditor()
Configures the editor for this combo box.
protected JButton
createArrowButton()
Creates a new button for use in rendering the JComboBox.
protected ComboBoxEditor
createEditor()
Creates an editor for the combo box.
protected LayoutManager
createLayoutManager()
Creates a new layout manager for the UI delegate.
protected ComboPopup
createPopup()
Creates a popup for the combo box.
PropertyChangeListener
createPropertyChangeListener()
Creates a new property change listener.
static ComponentUI
createUI(JComponent component)
Returns an instance of MetalComboBoxUI.
protected void
editablePropertyChanged(PropertyChangeEvent e)
Deprecated. 1.4
Dimension
getMinimumSize(JComponent c)
Returns the minimum size for the combo.
void
layoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager)
Lays out the ComboBox
void
paint(Graphics g, JComponent c)
Paints given menu item using specified graphics context
protected void
removeListeners()
Deprecated. 1.4
void
unconfigureEditor()
Unconfigures the editor for this combo box.

Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI

addEditor, configureArrowButton, configureEditor, createArrowButton, createEditor, createFocusListener, createItemListener, createKeyListener, createLayoutManager, createListDataListener, createPopup, createPropertyChangeListener, createRenderer, createUI, getAccessibleChild, getAccessibleChildrenCount, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, paint, paintCurrentValue, paintCurrentValueBackground, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, unconfigureEditor, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI

Methods inherited from class javax.swing.plaf.ComboBoxUI

isFocusTraversable, isPopupVisible, setPopupVisible

Methods inherited from class javax.swing.plaf.ComponentUI

contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MetalComboBoxUI

public MetalComboBoxUI()
Constructs a new instance of MetalComboBoxUI.

Method Details

configureEditor

public void configureEditor()
Configures the editor for this combo box.
Overrides:
configureEditor in interface BasicComboBoxUI

createArrowButton

protected JButton createArrowButton()
Creates a new button for use in rendering the JComboBox.
Overrides:
createArrowButton in interface BasicComboBoxUI
Returns:
A button.

createEditor

protected ComboBoxEditor createEditor()
Creates an editor for the combo box.
Overrides:
createEditor in interface BasicComboBoxUI
Returns:
An editor.

createLayoutManager

protected LayoutManager createLayoutManager()
Creates a new layout manager for the UI delegate.
Overrides:
createLayoutManager in interface BasicComboBoxUI
Returns:
A new layout manager.

createPopup

protected ComboPopup createPopup()
Creates a popup for the combo box.
Overrides:
createPopup in interface BasicComboBoxUI
Returns:
A popup.

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener()
Creates a new property change listener.
Overrides:
createPropertyChangeListener in interface BasicComboBoxUI
Returns:
A new property change listener.

createUI

public static ComponentUI createUI(JComponent component)
Returns an instance of MetalComboBoxUI.
Overrides:
createUI in interface BasicComboBoxUI
Parameters:
component - the component for which we return an UI instance
Returns:
an instance of MetalComboBoxUI

editablePropertyChanged

protected void editablePropertyChanged(PropertyChangeEvent e)

Deprecated. 1.4

Updates the button and text field to reflect a change in the 'editable' property.
Parameters:
e - the event.

getMinimumSize

public Dimension getMinimumSize(JComponent c)
Returns the minimum size for the combo.
Overrides:
getMinimumSize in interface BasicComboBoxUI
Parameters:
c - the component
Returns:
The minimum size for the combo box.

layoutComboBox

public void layoutComboBox(Container parent,
                           MetalComboBoxUI.MetalComboBoxLayoutManager manager)
Lays out the ComboBox

paint

public void paint(Graphics g,
                  JComponent c)
Paints given menu item using specified graphics context
Overrides:
paint in interface BasicComboBoxUI
Parameters:
g - The graphics context used to paint this combo box
c - comboBox which needs to be painted.

removeListeners

protected void removeListeners()

Deprecated. 1.4

Not used in Classpath.

unconfigureEditor

public void unconfigureEditor()
Unconfigures the editor for this combo box.
Overrides:
unconfigureEditor in interface BasicComboBoxUI

MetalComboBoxUI.java Copyright (C) 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.