com.jgoodies.looks.windows
Class WindowsComboBoxUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ComboBoxUI
          extended by javax.swing.plaf.basic.BasicComboBoxUI
              extended by com.sun.java.swing.plaf.windows.WindowsComboBoxUI
                  extended by com.jgoodies.looks.windows.WindowsComboBoxUI

public final class WindowsComboBoxUI
extends com.sun.java.swing.plaf.windows.WindowsComboBoxUI

The JGoodies Windows Look&Feel implementation of ComboBoxUI.

Corrects the editor insets for editable combo boxes as well as the render insets for non-editable combos. Also, it has the same height as text fields - unless you change the renderer.

Version:
$Revision: 1.5 $
Author:
Karsten Lentzsch

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.java.swing.plaf.windows.WindowsComboBoxUI
com.sun.java.swing.plaf.windows.WindowsComboBoxUI.WindowsComboBoxEditor, com.sun.java.swing.plaf.windows.WindowsComboBoxUI.WindowsComboPopup
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicComboBoxUI
javax.swing.plaf.basic.BasicComboBoxUI.ComboBoxLayoutManager, javax.swing.plaf.basic.BasicComboBoxUI.FocusHandler, javax.swing.plaf.basic.BasicComboBoxUI.ItemHandler, javax.swing.plaf.basic.BasicComboBoxUI.KeyHandler, javax.swing.plaf.basic.BasicComboBoxUI.ListDataHandler, javax.swing.plaf.basic.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
WindowsComboBoxUI()
           
 
Method Summary
protected  javax.swing.JButton createArrowButton()
          Creates the arrow button that is to be used in the combo box.
protected  javax.swing.ComboBoxEditor createEditor()
          Creates the editor that is to be used in editable combo boxes.
protected  java.awt.LayoutManager createLayoutManager()
          Creates a layout manager for managing the components which make up the combo box.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)
           
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          The minumum size is the size of the display area plus insets plus the button.
protected  java.awt.Rectangle rectangleForCurrentValue()
          Returns the area that is reserved for drawing the currently selected item.
 
Methods inherited from class com.sun.java.swing.plaf.windows.WindowsComboBoxUI
configureEditor, createPopup, createRenderer, installKeyboardActions, installListeners, installUI, paint, paintCurrentValue, paintCurrentValueBackground, unconfigureEditor, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, createPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, installComponents, installDefaults, isFocusTraversable, isNavigationKey, isPopupVisible, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions
 
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

WindowsComboBoxUI

public WindowsComboBoxUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent b)

getMinimumSize

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

Overrides:
getMinimumSize in class com.sun.java.swing.plaf.windows.WindowsComboBoxUI

createEditor

protected javax.swing.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.

Overrides:
createEditor in class com.sun.java.swing.plaf.windows.WindowsComboBoxUI

createLayoutManager

protected java.awt.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.

Overrides:
createLayoutManager in class com.sun.java.swing.plaf.windows.WindowsComboBoxUI
Returns:
an instance of a layout manager

createArrowButton

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

Overridden to paint black triangles.

Overrides:
createArrowButton in class com.sun.java.swing.plaf.windows.WindowsComboBoxUI

rectangleForCurrentValue

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

Overrides:
rectangleForCurrentValue in class javax.swing.plaf.basic.BasicComboBoxUI


Copyright © 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.