net.sf.sbcc.componentcombo.plaf.metal
Class MetalComponentComboBoxUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by net.sf.sbcc.componentcombo.plaf.ComponentComboBoxUI
          extended by net.sf.sbcc.componentcombo.plaf.basic.BasicComponentComboBoxUI
              extended by net.sf.sbcc.componentcombo.plaf.metal.MetalComponentComboBoxUI
All Implemented Interfaces:
java.io.Serializable

public class MetalComponentComboBoxUI
extends BasicComponentComboBoxUI
implements java.io.Serializable

ComboBox motif look and feel

* 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. A future release of Swing will provide support for long term persistence. SimpleComboBoxUIs are based on a copy of the corresponding ComboBoxUI, just having a few modifications. The behavior is about similar, but without managing the list in the popup. the developer of the specific component must handle the popup closure himself. based on MotifComboBoxUI 1.39, 12/19/03 by Arnaud Weber

Version:
1.0
Author:
Christoph Bimminger
See Also:
Serialized Form

Nested Class Summary
 class MetalComponentComboBoxUI.MetalComboBoxLayoutManager
          This inner class is marked "public" due to a compiler bug.
 class MetalComponentComboBoxUI.MetalComboPopup
          Deprecated. As of Java 2 platform v1.4.
 class MetalComponentComboBoxUI.MetalComponentComboBoxButton
          JButton subclass to help out MetalComboBoxUI Warning: Serialized objects of this class will not be compatible with future Swing releases.
 class MetalComponentComboBoxUI.MetalPropertyChangeListener
          This inner class is marked "public" due to a compiler bug.
 
Nested classes/interfaces inherited from class net.sf.sbcc.componentcombo.plaf.basic.BasicComponentComboBoxUI
BasicComponentComboBoxUI.ComboBoxLayoutManager, BasicComponentComboBoxUI.FocusHandler, BasicComponentComboBoxUI.ItemHandler, BasicComponentComboBoxUI.KeyHandler, BasicComponentComboBoxUI.PropertyChangeHandler, BasicComponentComboBoxUI.SimpleDataHandler
 
Field Summary
private static java.lang.Object NO_BUTTON_ROLLOVER
           
 
Fields inherited from class net.sf.sbcc.componentcombo.plaf.basic.BasicComponentComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, dataListener, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, popup, popupComponent, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener
 
Constructor Summary
MetalComponentComboBoxUI()
           
 
Method Summary
private  boolean _isLeftToRight(javax.swing.JComponent P_component)
          some additional methods required by my implementation
private  boolean _usingOcean()
           
 void configureEditor()
          This protected method is implementation specific and should be private.
protected  javax.swing.JButton createArrowButton()
          Creates an button which will be used as the control to show or hide the popup portion of the combo box.
protected  javax.swing.ComboBoxEditor createEditor()
          Creates the default editor that will 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.
protected  ComponentComboPopup createPopup()
          Creates the popup portion of the combo box.
 java.beans.PropertyChangeListener createPropertyChangeListener()
          Creates a PropertyChangeListener which will be added to the combo box.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
protected  void editablePropertyChanged(java.beans.PropertyChangeEvent e)
          Deprecated. As of Java 2 platform v1.4.
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          The minumum size is the size of the display area plus insets plus the button.
 void layoutComboBox(java.awt.Container parent, MetalComponentComboBoxUI.MetalComboBoxLayoutManager manager)
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
           
 void paintCurrentValue(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)
          If necessary paints the currently selected item.
 void paintCurrentValueBackground(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)
          If necessary paints the background of the currently selected item.
protected  void removeListeners()
          Deprecated. As of Java 2 platform v1.4.
 void unconfigureEditor()
          This protected method is implementation specific and should be private.
private  void updateButtonForOcean(javax.swing.JButton button)
          Resets the necessary state on the ComboBoxButton for ocean.
 
Methods inherited from class net.sf.sbcc.componentcombo.plaf.basic.BasicComponentComboBoxUI
addEditor, configureArrowButton, createDataListener, createFocusListener, createItemListener, createKeyListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
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
 

Field Detail

NO_BUTTON_ROLLOVER

private static java.lang.Object NO_BUTTON_ROLLOVER
Constructor Detail

MetalComponentComboBoxUI

public MetalComponentComboBoxUI()
Method Detail

createUI

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

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Overrides:
paint in class BasicComponentComboBoxUI

paintCurrentValue

public void paintCurrentValue(java.awt.Graphics g,
                              java.awt.Rectangle bounds,
                              boolean hasFocus)
If necessary paints the currently selected item.

Overrides:
paintCurrentValue in class BasicComponentComboBoxUI
Parameters:
g - Graphics to paint to
bounds - Region to paint current value to
hasFocus - whether or not the JComboBox has focus
Throws:
java.lang.NullPointerException - if any of the arguments are null.
Since:
1.5

paintCurrentValueBackground

public void paintCurrentValueBackground(java.awt.Graphics g,
                                        java.awt.Rectangle bounds,
                                        boolean hasFocus)
If necessary paints the background of the currently selected item.

Overrides:
paintCurrentValueBackground in class BasicComponentComboBoxUI
Parameters:
g - Graphics to paint to
bounds - Region to paint background to
hasFocus - whether or not the JComboBox has focus
Throws:
java.lang.NullPointerException - if any of the arguments are null.
Since:
1.5

createEditor

protected javax.swing.ComboBoxEditor createEditor()
Description copied from class: BasicComponentComboBoxUI
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.

Overrides:
createEditor in class BasicComponentComboBoxUI
Returns:
a ComboBoxEditor used for the combo box
See Also:
javax.swing.JAbstractComponentComboBox#setEditor

createPopup

protected ComponentComboPopup createPopup()
Description copied from class: BasicComponentComboBoxUI
Creates the popup portion of the combo box.

Overrides:
createPopup in class BasicComponentComboBoxUI
Returns:
an instance of ComboPopup
See Also:
ComponentComboPopup

createArrowButton

protected javax.swing.JButton createArrowButton()
Description copied from class: BasicComponentComboBoxUI
Creates an button which will be used as the control to show or hide the popup portion of the combo box.

Overrides:
createArrowButton in class BasicComponentComboBoxUI
Returns:
a button which represents the popup control

updateButtonForOcean

private void updateButtonForOcean(javax.swing.JButton button)
Resets the necessary state on the ComboBoxButton for ocean.


createPropertyChangeListener

public java.beans.PropertyChangeListener createPropertyChangeListener()
Description copied from class: BasicComponentComboBoxUI
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.

Overrides:
createPropertyChangeListener in class BasicComponentComboBoxUI
Returns:
an instance of a PropertyChangeListener or null

editablePropertyChanged

@Deprecated
protected void editablePropertyChanged(java.beans.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.


createLayoutManager

protected java.awt.LayoutManager createLayoutManager()
Description copied from class: BasicComponentComboBoxUI
Creates a layout manager for managing the components which make up the combo box.

Overrides:
createLayoutManager in class BasicComponentComboBoxUI
Returns:
an instance of a layout manager

layoutComboBox

public void layoutComboBox(java.awt.Container parent,
                           MetalComponentComboBoxUI.MetalComboBoxLayoutManager manager)

removeListeners

@Deprecated
protected void 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: BasicComponentComboBoxUI
This protected method is implementation specific and should be private. do not call or override.

Overrides:
configureEditor in class BasicComponentComboBoxUI
See Also:
BasicComponentComboBoxUI.addEditor()

unconfigureEditor

public void unconfigureEditor()
Description copied from class: BasicComponentComboBoxUI
This protected method is implementation specific and should be private. Do not call or override.

Overrides:
unconfigureEditor in class BasicComponentComboBoxUI
See Also:
BasicComponentComboBoxUI.addEditor()

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
Description copied from class: BasicComponentComboBoxUI
The minumum size is the size of the display area plus insets plus the button.

Overrides:
getMinimumSize in class BasicComponentComboBoxUI

_isLeftToRight

private boolean _isLeftToRight(javax.swing.JComponent P_component)
some additional methods required by my implementation


_usingOcean

private boolean _usingOcean()