com.alee.laf.combobox
Class WebComboBoxUI

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.alee.laf.combobox.WebComboBoxUI
All Implemented Interfaces:
ShapeProvider, BorderMethods, SwingMethods

public class WebComboBoxUI
extends javax.swing.plaf.basic.BasicComboBoxUI
implements ShapeProvider, BorderMethods

Custom UI for JComboBox component.

Author:
Mikle Garin

Nested Class Summary
protected  class WebComboBoxUI.WebComboBoxLayout
          Custom layout manager for WebComboBoxUI.
 
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
protected static javax.swing.ListCellRenderer DEFAULT_RENDERER
          Default combobox renderer.
 
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
WebComboBoxUI()
           
 
Method Summary
 void configureArrowButton()
          
protected  javax.swing.JButton createArrowButton()
          
protected  javax.swing.ComboBoxEditor createEditor()
          
protected  java.awt.LayoutManager createLayoutManager()
          
protected  javax.swing.plaf.basic.ComboPopup createPopup()
          
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
           
 javax.swing.ImageIcon getCollapseIcon()
           
protected static javax.swing.ListCellRenderer getDefaultListCellRenderer()
          Returns default list cell renderer instance.
protected  java.awt.Dimension getDefaultSize()
          
protected  java.awt.Dimension getDisplaySize()
          
 javax.swing.ImageIcon getExpandIcon()
           
 int getIconSpacing()
           
 java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
          
 int getRound()
           
 int getShadeWidth()
           
protected  java.awt.Dimension getSizeForComponent(java.awt.Component c)
          Returns renderer component preferred size.
protected  void installComponents()
          
protected  void installRendererListener(java.lang.Object renderer)
          Installs RendererListener into specified renderer if possible.
 void installUI(javax.swing.JComponent c)
          
 boolean isComboboxCellEditor()
           
 boolean isDrawBorder()
           
 boolean isDrawFocus()
           
 boolean isMouseWheelScrollingEnabled()
           
 boolean isUseFirstValueAsPrototype()
           
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          
 void paintCurrentValue(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)
          
 void paintCurrentValueBackground(java.awt.Graphics g, java.awt.Rectangle bounds, boolean hasFocus)
          
 java.awt.Shape provideShape()
          Returns component shape.
 void setCollapseIcon(javax.swing.ImageIcon collapseIcon)
           
 void setDrawBorder(boolean drawBorder)
           
 void setDrawFocus(boolean drawFocus)
           
 void setEditorColumns(int columns)
           
 void setExpandIcon(javax.swing.ImageIcon expandIcon)
           
 void setIconSpacing(int iconSpacing)
           
 void setMouseWheelScrollingEnabled(boolean enabled)
           
 void setRound(int round)
           
 void setShadeWidth(int shadeWidth)
           
 void setUseFirstValueAsPrototype(boolean use)
           
protected  void uninstallRendererListener(java.lang.Object renderer)
          Uninstalls RendererListener from specified renderer if possible.
 void uninstallUI(javax.swing.JComponent c)
          
 void updateBorder()
          Updates custom WebLaF border.
 
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, configureEditor, createFocusListener, createItemListener, createKeyListener, createListDataListener, createPropertyChangeListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getInsets, getMaximumSize, getPreferredSize, installDefaults, installKeyboardActions, installListeners, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, unconfigureEditor, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
 
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

DEFAULT_RENDERER

protected static javax.swing.ListCellRenderer DEFAULT_RENDERER
Default combobox renderer.

Constructor Detail

WebComboBoxUI

public WebComboBoxUI()
Method Detail

createUI

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

installUI

public void installUI(javax.swing.JComponent c)

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

uninstallUI

public void uninstallUI(javax.swing.JComponent c)

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

updateBorder

public void updateBorder()
Description copied from interface: BorderMethods
Updates custom WebLaF border.

Specified by:
updateBorder in interface BorderMethods

installRendererListener

protected void installRendererListener(java.lang.Object renderer)
Installs RendererListener into specified renderer if possible.

Parameters:
renderer - RendererListener to install

uninstallRendererListener

protected void uninstallRendererListener(java.lang.Object renderer)
Uninstalls RendererListener from specified renderer if possible.

Parameters:
renderer - RendererListener to uninstall

installComponents

protected void installComponents()

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

createEditor

protected javax.swing.ComboBoxEditor createEditor()

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

createArrowButton

protected javax.swing.JButton createArrowButton()

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

configureArrowButton

public void configureArrowButton()

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

createPopup

protected javax.swing.plaf.basic.ComboPopup createPopup()

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

isComboboxCellEditor

public boolean isComboboxCellEditor()

provideShape

public java.awt.Shape provideShape()
Returns component shape.

Specified by:
provideShape in interface ShapeProvider
Returns:
component shape

setEditorColumns

public void setEditorColumns(int columns)

isUseFirstValueAsPrototype

public boolean isUseFirstValueAsPrototype()

setUseFirstValueAsPrototype

public void setUseFirstValueAsPrototype(boolean use)

getExpandIcon

public javax.swing.ImageIcon getExpandIcon()

setExpandIcon

public void setExpandIcon(javax.swing.ImageIcon expandIcon)

getCollapseIcon

public javax.swing.ImageIcon getCollapseIcon()

setCollapseIcon

public void setCollapseIcon(javax.swing.ImageIcon collapseIcon)

getIconSpacing

public int getIconSpacing()

setIconSpacing

public void setIconSpacing(int iconSpacing)

isDrawBorder

public boolean isDrawBorder()

setDrawBorder

public void setDrawBorder(boolean drawBorder)

isDrawFocus

public boolean isDrawFocus()

setDrawFocus

public void setDrawFocus(boolean drawFocus)

getRound

public int getRound()

setRound

public void setRound(int round)

getShadeWidth

public int getShadeWidth()

setShadeWidth

public void setShadeWidth(int shadeWidth)

isMouseWheelScrollingEnabled

public boolean isMouseWheelScrollingEnabled()

setMouseWheelScrollingEnabled

public void setMouseWheelScrollingEnabled(boolean enabled)

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)

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

paintCurrentValueBackground

public void paintCurrentValueBackground(java.awt.Graphics g,
                                        java.awt.Rectangle bounds,
                                        boolean hasFocus)

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

paintCurrentValue

public void paintCurrentValue(java.awt.Graphics g,
                              java.awt.Rectangle bounds,
                              boolean hasFocus)

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

createLayoutManager

protected java.awt.LayoutManager createLayoutManager()

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

getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)

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

getDisplaySize

protected java.awt.Dimension getDisplaySize()

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

getDefaultSize

protected java.awt.Dimension getDefaultSize()

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

getDefaultListCellRenderer

protected static javax.swing.ListCellRenderer getDefaultListCellRenderer()
Returns default list cell renderer instance.

Returns:
default list cell renderer instance

getSizeForComponent

protected java.awt.Dimension getSizeForComponent(java.awt.Component c)
Returns renderer component preferred size.

Parameters:
c - renderer component
Returns:
renderer component preferred size