com.jgoodies.looks.plastic

Class PlasticComboBoxUI

public class PlasticComboBoxUI extends MetalComboBoxUI

The JGoodies Plastic Look and Feel implementation of ComboBoxUI. Has the same height as text fields - unless you change the renderer.

Also, this class offers to use the combo's popup prototype display value to compute the popup menu width. This is an optional feature of the JGoodies Plastic L&fs implemented via a client property key.

Version: $Revision: 1.15 $

Author: Karsten Lentzsch

See Also: COMBO_POPUP_PROTOTYPE_DISPLAY_VALUE_KEY

Method Summary
protected JButtoncreateArrowButton()
Creates and answers the arrow button that is to be used in the combo box.

Overridden to use a button that can have a pseudo 3D effect.

protected ComboBoxEditorcreateEditor()
Creates the editor that is to be used in editable combo boxes.
protected LayoutManagercreateLayoutManager()
Creates a layout manager for managing the components which make up the combo box.

Overriden to use a layout that has a fixed width arrow button.

protected ComboPopupcreatePopup()
PropertyChangeListenercreatePropertyChangeListener()
protected ListCellRenderercreateRenderer()
Creates the default renderer that will be used in a non-editiable combo box.
static ComponentUIcreateUI(JComponent b)
DimensiongetMinimumSize(JComponent c)
The minumum size is the size of the display area plus insets plus the button.
DimensiongetPreferredSize(JComponent c)
Delegates to #getMinimumSize(Component).
protected voidinstallListeners()
voidinstallUI(JComponent c)
protected booleanisToolBarComboBox(JComponent c)
Checks and answers if this combo is in a tool bar.
protected RectanglerectangleForCurrentValue()
Returns the area that is reserved for drawing the currently selected item.
protected voiduninstallListeners()
voidupdate(Graphics g, JComponent c)

Method Detail

createArrowButton

protected JButton createArrowButton()
Creates and answers the arrow button that is to be used in the combo box.

Overridden to use a button that can have a pseudo 3D effect.

createEditor

protected ComboBoxEditor createEditor()
Creates the editor that is to be used in editable combo boxes. This method only gets called if a custom editor has not already been installed in the JComboBox.

createLayoutManager

protected LayoutManager createLayoutManager()
Creates a layout manager for managing the components which make up the combo box.

Overriden to use a layout that has a fixed width arrow button.

Returns: an instance of a layout manager

createPopup

protected ComboPopup createPopup()

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener()

createRenderer

protected ListCellRenderer createRenderer()
Creates the default renderer that will be used in a non-editiable combo box. A default renderer will used only if a renderer has not been explicitly set with setRenderer.

This method differs from the superclass implementation in that it uses an empty border with wider left and right margins of 2 pixels instead of 1.

Returns: a ListCellRender used for the combo box

See Also: javax.swing.JComboBox#setRenderer

createUI

public static ComponentUI createUI(JComponent b)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
The minumum size is the size of the display area plus insets plus the button.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Delegates to #getMinimumSize(Component). Overridden to return the same result in JDK 1.5 as in JDK 1.4.

installListeners

protected void installListeners()

installUI

public void installUI(JComponent c)

isToolBarComboBox

protected boolean isToolBarComboBox(JComponent c)
Checks and answers if this combo is in a tool bar.

Parameters: c the component to check

Returns: true if in tool bar, false otherwise

rectangleForCurrentValue

protected Rectangle rectangleForCurrentValue()
Returns the area that is reserved for drawing the currently selected item.

uninstallListeners

protected void uninstallListeners()

update

public void update(Graphics g, JComponent c)
Copyright © 2001-2008 JGoodies Karsten Lentzsch. All Rights Reserved.