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 classFlatComboBoxUI.FlatComboBoxButtonprotected classFlatComboBoxUI.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 StringarrowTypeprotected ColorbuttonArrowColorprotected ColorbuttonBackgroundprotected ColorbuttonDisabledArrowColorprotected ColorbuttonDisabledSeparatorColorprotected ColorbuttonEditableBackgroundprotected ColorbuttonFocusedBackgroundprotected ColorbuttonHoverArrowColorprotected ColorbuttonPressedArrowColorprotected ColorbuttonSeparatorColorprotected floatbuttonSeparatorWidthprotected StringbuttonStyleprotected ColordisabledBackgroundprotected ColordisabledForegroundprotected ColoreditableBackgroundprotected inteditorColumnsprotected ColorfocusedBackgroundprotected booleanhoverprotected booleanisIntelliJThemeprotected intminimumWidthprotected ColorpopupBackgroundprotected InsetspopupInsetsprotected booleanpressedprotected intselectionArcprotected InsetsselectionInsets-
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:
installUIin classBasicComboBoxUI
-
installListeners
protected void installListeners()
- Overrides:
installListenersin classBasicComboBoxUI
-
uninstallListeners
protected void uninstallListeners()
- Overrides:
uninstallListenersin classBasicComboBoxUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicComboBoxUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicComboBoxUI
-
createLayoutManager
protected LayoutManager createLayoutManager()
- Overrides:
createLayoutManagerin classBasicComboBoxUI
-
createFocusListener
protected FocusListener createFocusListener()
- Overrides:
createFocusListenerin classBasicComboBoxUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener()
- Overrides:
createPropertyChangeListenerin classBasicComboBoxUI
-
createPopup
protected ComboPopup createPopup()
- Overrides:
createPopupin classBasicComboBoxUI
-
configureEditor
protected void configureEditor()
- Overrides:
configureEditorin classBasicComboBoxUI
-
createArrowButton
protected JButton createArrowButton()
- Overrides:
createArrowButtonin 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:
getStyleableInfosin interfaceFlatStylingSupport.StyleableUI- Since:
- 2
-
getStyleableValue
public Object getStyleableValue(JComponent c, String key)
- Specified by:
getStyleableValuein interfaceFlatStylingSupport.StyleableUI- Since:
- 2.5
-
getLookupForStyling
public MethodHandles.Lookup getLookupForStyling()
- Specified by:
getLookupForStylingin interfaceFlatStylingSupport.StyleableLookupProvider- Since:
- 2.5
-
update
public void update(Graphics g, JComponent c)
- Overrides:
updatein classComponentUI
-
paintCurrentValue
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
- Overrides:
paintCurrentValuein classBasicComboBoxUI
-
paintCurrentValueBackground
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
- Overrides:
paintCurrentValueBackgroundin classBasicComboBoxUI
-
getBackground
protected Color getBackground(boolean enabled)
-
getForeground
protected Color getForeground(boolean enabled)
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSizein classBasicComboBoxUI
-
getDefaultSize
protected Dimension getDefaultSize()
- Overrides:
getDefaultSizein classBasicComboBoxUI
-
getDisplaySize
protected Dimension getDisplaySize()
- Overrides:
getDisplaySizein classBasicComboBoxUI
-
getSizeForComponent
protected Dimension getSizeForComponent(Component comp)
- Overrides:
getSizeForComponentin classBasicComboBoxUI
-
isPermanentFocusOwner
public static boolean isPermanentFocusOwner(JComboBox<?> comboBox)
- Since:
- 1.3
-
-