Package com.formdev.flatlaf.ui
Class FlatComboBoxUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ComboBoxUI
-
- javax.swing.plaf.basic.BasicComboBoxUI
-
- com.formdev.flatlaf.ui.FlatComboBoxUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableLookupProvider
,FlatStylingSupport.StyleableUI
public class FlatComboBoxUI extends BasicComboBoxUI implements FlatStylingSupport.StyleableUI, FlatStylingSupport.StyleableLookupProvider
Provides the Flat LaF UI delegate forJComboBox
.- UiDefault:
- ComboBox.font Font, ComboBox.background Color, ComboBox.foreground Color, ComboBox.border Border, ComboBox.padding Insets, ComboBox.squareButton boolean default is true , ComboBox.selectionBackground Color, ComboBox.selectionForeground Color , ComboBox.minimumWidth int, ComboBox.editorColumns int, ComboBox.maximumRowCount int, ComboBox.buttonStyle String auto (default), button, mac or none, Component.arrowType String chevron (default) or triangle, Component.isIntelliJTheme boolean, ComboBox.editableBackground Color optional; defaults to ComboBox.background, ComboBox.focusedBackground Color optional, ComboBox.disabledBackground Color, ComboBox.disabledForeground Color, ComboBox.buttonBackground Color optional, ComboBox.buttonEditableBackground Color optional, ComboBox.buttonFocusedBackground Color optional; defaults to ComboBox.focusedBackground, ComboBox.buttonSeparatorWidth int or float optional; defaults to Component.borderWidth, ComboBox.buttonSeparatorColor Color optional, ComboBox.buttonDisabledSeparatorColor Color optional, ComboBox.buttonArrowColor Color, ComboBox.buttonDisabledArrowColor Color, ComboBox.buttonHoverArrowColor Color, ComboBox.buttonPressedArrowColor Color, ComboBox.popupBackground Color optional, ComboBox.popupInsets Insets, ComboBox.selectionInsets Insets, ComboBox.selectionArc int
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FlatComboBoxUI.FlatComboBoxButton
protected class
FlatComboBoxUI.FlatComboPopup
-
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 String
arrowType
protected Color
buttonArrowColor
protected Color
buttonBackground
protected Color
buttonDisabledArrowColor
protected Color
buttonDisabledSeparatorColor
protected Color
buttonEditableBackground
protected Color
buttonFocusedBackground
protected Color
buttonHoverArrowColor
protected Color
buttonPressedArrowColor
protected Color
buttonSeparatorColor
protected float
buttonSeparatorWidth
protected String
buttonStyle
protected Color
disabledBackground
protected Color
disabledForeground
protected Color
editableBackground
protected int
editorColumns
protected Color
focusedBackground
protected boolean
hover
protected boolean
isIntelliJTheme
protected int
minimumWidth
protected Color
popupBackground
protected Insets
popupInsets
protected boolean
pressed
protected int
selectionArc
protected Insets
selectionInsets
-
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 FlatComboBoxUI()
-
Method Summary
-
Methods inherited from class javax.swing.plaf.basic.BasicComboBoxUI
addEditor, configureArrowButton, createEditor, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getInsets, getMaximumSize, getPreferredSize, installComponents, installKeyboardActions, isFocusTraversable, isNavigationKey, isPopupVisible, paint, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, unconfigureEditor, uninstallComponents, uninstallKeyboardActions, uninstallUI
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains
-
-
-
-
Field Detail
-
minimumWidth
protected int minimumWidth
-
editorColumns
protected int editorColumns
-
buttonStyle
protected String buttonStyle
-
arrowType
protected String arrowType
-
isIntelliJTheme
protected boolean isIntelliJTheme
-
editableBackground
protected Color editableBackground
-
focusedBackground
protected Color focusedBackground
-
disabledBackground
protected Color disabledBackground
-
disabledForeground
protected Color disabledForeground
-
buttonBackground
protected Color buttonBackground
-
buttonEditableBackground
protected Color buttonEditableBackground
-
buttonFocusedBackground
protected Color buttonFocusedBackground
-
buttonSeparatorWidth
protected float buttonSeparatorWidth
- Since:
- 2
-
buttonSeparatorColor
protected Color buttonSeparatorColor
- Since:
- 2
-
buttonDisabledSeparatorColor
protected Color buttonDisabledSeparatorColor
- Since:
- 2
-
buttonArrowColor
protected Color buttonArrowColor
-
buttonDisabledArrowColor
protected Color buttonDisabledArrowColor
-
buttonHoverArrowColor
protected Color buttonHoverArrowColor
-
buttonPressedArrowColor
protected Color buttonPressedArrowColor
-
popupBackground
protected Color popupBackground
-
popupInsets
protected Insets popupInsets
- Since:
- 3
-
selectionInsets
protected Insets selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc
- Since:
- 3
-
hover
protected boolean hover
-
pressed
protected boolean pressed
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
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
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classBasicComboBoxUI
-
createLayoutManager
protected LayoutManager createLayoutManager()
- Overrides:
createLayoutManager
in classBasicComboBoxUI
-
createFocusListener
protected FocusListener createFocusListener()
- Overrides:
createFocusListener
in classBasicComboBoxUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListener
in classBasicComboBoxUI
-
createPopup
protected ComboPopup createPopup()
- Overrides:
createPopup
in classBasicComboBoxUI
-
configureEditor
protected void configureEditor()
- Overrides:
configureEditor
in classBasicComboBoxUI
-
createArrowButton
protected JButton createArrowButton()
- Overrides:
createArrowButton
in classBasicComboBoxUI
-
installStyle
protected void installStyle()
- Since:
- 2
-
applyStyle
protected void applyStyle(Object style)
- Since:
- 2
-
getStyleableInfos
public Map<String,Class<?>> getStyleableInfos(JComponent c)
- Specified by:
getStyleableInfos
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValue
in interfaceFlatStylingSupport.StyleableUI
- Since:
- 2.5
-
getLookupForStyling
public MethodHandles.Lookup getLookupForStyling()
- Specified by:
getLookupForStyling
in interfaceFlatStylingSupport.StyleableLookupProvider
- Since:
- 2.5
-
update
public void update(Graphics g, JComponent c)
- Overrides:
update
in classComponentUI
-
paintCurrentValue
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
- Overrides:
paintCurrentValue
in classBasicComboBoxUI
-
paintCurrentValueBackground
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
- Overrides:
paintCurrentValueBackground
in classBasicComboBoxUI
-
getBackground
protected Color getBackground(boolean enabled)
-
getForeground
protected Color getForeground(boolean enabled)
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSize
in classBasicComboBoxUI
-
getDefaultSize
protected Dimension getDefaultSize()
- Overrides:
getDefaultSize
in classBasicComboBoxUI
-
getDisplaySize
protected Dimension getDisplaySize()
- Overrides:
getDisplaySize
in classBasicComboBoxUI
-
getSizeForComponent
protected Dimension getSizeForComponent(Component comp)
- Overrides:
getSizeForComponent
in classBasicComboBoxUI
-
isPermanentFocusOwner
public static boolean isPermanentFocusOwner(JComboBox<?> comboBox)
- Since:
- 1.3
-
-