Class SubstanceComboBoxUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ComboBoxUI
-
- javax.swing.plaf.basic.BasicComboBoxUI
-
- org.pushingpixels.substance.internal.ui.SubstanceComboBoxUI
-
- All Implemented Interfaces:
TransitionAwareUI
public class SubstanceComboBoxUI extends BasicComboBoxUI implements TransitionAwareUI
UI for combo boxes in Substance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SubstanceComboBoxUI.ComboBoxPropertyChangeHandler
This property change handler changes combo box arrow icon based on the enabled status of the combo box.-
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 Modifier and Type Field Description protected ComboBoxBackgroundDelegate
delegate
Painting delegate.protected Insets
layoutInsets
protected StateTransitionTracker
stateTransitionTracker
protected SubstanceComboBoxUI.ComboBoxPropertyChangeHandler
substanceChangeHandler
Property change handler onenabled
property,componentOrientation
property and onSubstanceLookAndFeel.COMBO_BOX_POPUP_FLYOUT_ORIENTATION
property.protected RolloverTextControlListener
substanceRolloverListener
Listener for transition animations.protected ButtonModel
transitionModel
Surrogate button model for tracking the state transitions.protected Icon
uneditableArrowIcon
-
Fields inherited from class javax.swing.plaf.basic.BasicComboBoxUI
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener, squareButton
-
-
Constructor Summary
Constructors Constructor Description SubstanceComboBoxUI(JComboBox combo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureArrowButton()
protected void
configureArrowButtonStraightSide()
Configures the straight side of the arrow button.protected void
configureEditor()
protected JButton
createArrowButton()
protected ComboBoxEditor
createEditor()
protected LayoutManager
createLayoutManager()
protected ComboPopup
createPopup()
protected ListCellRenderer
createRenderer()
static ComponentUI
createUI(JComponent comp)
protected Dimension
getDefaultSize()
Dimension
getMinimumSize(JComponent c)
ComboPopup
getPopup()
Returns the popup of the associated combobox.StateTransitionTracker
getTransitionTracker()
Returns the model for tracking the transitions.protected void
installDefaults()
protected void
installListeners()
void
installUI(JComponent c)
boolean
isInside(MouseEvent me)
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.void
paint(Graphics g, JComponent c)
protected void
paintFocus(Graphics g, Rectangle bounds)
Paints the focus indication.protected Rectangle
rectangleForCurrentValue()
void
unconfigureArrowButton()
protected void
uninstallListeners()
void
uninstallUI(JComponent c)
-
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, createFocusListener, createItemListener, createKeyListener, createListDataListener, createPropertyChangeListener, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, getSizeForComponent, installComponents, installKeyboardActions, isFocusTraversable, isNavigationKey, isPopupVisible, paintCurrentValue, paintCurrentValueBackground, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureEditor, uninstallComponents, uninstallDefaults, uninstallKeyboardActions
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, update
-
-
-
-
Field Detail
-
substanceChangeHandler
protected SubstanceComboBoxUI.ComboBoxPropertyChangeHandler substanceChangeHandler
Property change handler onenabled
property,componentOrientation
property and onSubstanceLookAndFeel.COMBO_BOX_POPUP_FLYOUT_ORIENTATION
property.
-
stateTransitionTracker
protected StateTransitionTracker stateTransitionTracker
-
transitionModel
protected ButtonModel transitionModel
Surrogate button model for tracking the state transitions.
-
substanceRolloverListener
protected RolloverTextControlListener substanceRolloverListener
Listener for transition animations.
-
delegate
protected ComboBoxBackgroundDelegate delegate
Painting delegate.
-
uneditableArrowIcon
protected Icon uneditableArrowIcon
-
layoutInsets
protected Insets layoutInsets
-
-
Constructor Detail
-
SubstanceComboBoxUI
public SubstanceComboBoxUI(JComboBox combo)
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent comp)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classBasicComboBoxUI
-
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
uninstallUI
in classBasicComboBoxUI
-
createArrowButton
protected JButton createArrowButton()
- Overrides:
createArrowButton
in classBasicComboBoxUI
-
createRenderer
protected ListCellRenderer createRenderer()
- Overrides:
createRenderer
in classBasicComboBoxUI
-
installListeners
protected void installListeners()
- Overrides:
installListeners
in classBasicComboBoxUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListeners
in classBasicComboBoxUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classBasicComboBoxUI
-
createLayoutManager
protected LayoutManager createLayoutManager()
- Overrides:
createLayoutManager
in classBasicComboBoxUI
-
rectangleForCurrentValue
protected Rectangle rectangleForCurrentValue()
- Overrides:
rectangleForCurrentValue
in classBasicComboBoxUI
-
getDefaultSize
protected Dimension getDefaultSize()
- Overrides:
getDefaultSize
in classBasicComboBoxUI
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSize
in classBasicComboBoxUI
-
createPopup
protected ComboPopup createPopup()
- Overrides:
createPopup
in classBasicComboBoxUI
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paint
in classBasicComboBoxUI
-
paintFocus
protected void paintFocus(Graphics g, Rectangle bounds)
Paints the focus indication.- Parameters:
g
- Graphics.bounds
- Bounds for text.
-
getPopup
public ComboPopup getPopup()
Returns the popup of the associated combobox.- Returns:
- The popup of the associated combobox.
-
configureArrowButton
public void configureArrowButton()
- Overrides:
configureArrowButton
in classBasicComboBoxUI
-
configureArrowButtonStraightSide
protected void configureArrowButtonStraightSide()
Configures the straight side of the arrow button.
-
unconfigureArrowButton
public void unconfigureArrowButton()
- Overrides:
unconfigureArrowButton
in classBasicComboBoxUI
-
configureEditor
protected void configureEditor()
- Overrides:
configureEditor
in classBasicComboBoxUI
-
createEditor
protected ComboBoxEditor createEditor()
- Overrides:
createEditor
in classBasicComboBoxUI
-
getTransitionTracker
public StateTransitionTracker getTransitionTracker()
Description copied from interface:TransitionAwareUI
Returns the model for tracking the transitions.- Specified by:
getTransitionTracker
in interfaceTransitionAwareUI
- Returns:
- Model for tracking the transitions.
-
isInside
public boolean isInside(MouseEvent me)
Description copied from interface:TransitionAwareUI
Checks whether the mouse position of the specified event lies inside the area of the component designated for transition effects.- Specified by:
isInside
in interfaceTransitionAwareUI
- Parameters:
me
- Mouse event.- Returns:
true
if the mouse position of the specified event lies inside the area of the component designated for transition effects,false
otherwise.
-
-