Package com.formdev.flatlaf.ui
Class FlatMenuUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- javax.swing.plaf.basic.BasicMenuItemUI
-
- javax.swing.plaf.basic.BasicMenuUI
-
- com.formdev.flatlaf.ui.FlatMenuUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableLookupProvider
,FlatStylingSupport.StyleableUI
public class FlatMenuUI extends BasicMenuUI implements FlatStylingSupport.StyleableUI, FlatStylingSupport.StyleableLookupProvider
Provides the Flat LaF UI delegate forJMenu
.- UiDefault:
- Menu.font Font, Menu.background Color, Menu.foreground Color, Menu.disabledForeground Color, Menu.selectionBackground Color, Menu.selectionForeground Color, Menu.acceleratorForeground Color, Menu.acceleratorSelectionForeground Color, MenuItem.acceleratorFont Font defaults to MenuItem.font, MenuItem.acceleratorDelimiter String, Menu.border Border, Menu.borderPainted boolean, Menu.margin Insets, Menu.arrowIcon Icon, Menu.checkIcon Icon, Menu.opaque boolean, Menu.crossMenuMnemonic boolean default is false, Menu.useMenuBarBackgroundForTopLevel boolean default is false, MenuBar.background Color used if Menu.useMenuBarBackgroundForTopLevel is true , MenuItem.iconTextGap int , MenuBar.selectionInsets Insets, MenuBar.selectionEmbeddedInsets Insets, MenuBar.selectionArc int, MenuBar.hoverBackground Color, MenuBar.selectionBackground Color optional; defaults to Menu.selectionBackground, MenuBar.selectionForeground Color optional; defaults to Menu.selectionForeground, MenuBar.underlineSelectionBackground Color, MenuBar.underlineSelectionColor Color, MenuBar.underlineSelectionHeight int
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FlatMenuUI.FlatMenuRenderer
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuUI
BasicMenuUI.ChangeHandler, BasicMenuUI.MouseInputHandler
-
-
Field Summary
-
Fields inherited from class javax.swing.plaf.basic.BasicMenuUI
changeListener, menuListener
-
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
-
-
Constructor Summary
Constructors Constructor Description FlatMenuUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyStyle(Object style)
protected Object
applyStyleProperty(String key, Object value)
protected MouseInputListener
createMouseInputListener(JComponent c)
protected PropertyChangeListener
createPropertyChangeListener(JComponent c)
protected FlatMenuItemRenderer
createRenderer()
static ComponentUI
createUI(JComponent c)
MethodHandles.Lookup
getLookupForStyling()
Dimension
getMinimumSize(JComponent c)
protected Dimension
getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
Map<String,Class<?>>
getStyleableInfos(JComponent c)
Object
getStyleableValue(JComponent c, String key)
protected void
installDefaults()
protected void
installStyle()
void
installUI(JComponent c)
void
paint(Graphics g, JComponent c)
protected void
uninstallDefaults()
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuUI
createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, getMaximumSize, getPropertyPrefix, installKeyboardActions, installListeners, setupPostTimer, uninstallKeyboardActions, uninstallListeners
-
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
doClick, getPath, getPreferredSize, installComponents, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallUI, update
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
-
-
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent c)
-
installUI
public void installUI(JComponent c)
- Overrides:
installUI
in classBasicMenuItemUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaults
in classBasicMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaults
in classBasicMenuUI
-
createRenderer
protected FlatMenuItemRenderer createRenderer()
-
createMouseInputListener
protected MouseInputListener createMouseInputListener(JComponent c)
- Overrides:
createMouseInputListener
in classBasicMenuUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener(JComponent c)
- Overrides:
createPropertyChangeListener
in classBasicMenuUI
-
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
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSize
in classBasicMenuUI
-
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
- Overrides:
getPreferredMenuItemSize
in classBasicMenuItemUI
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paint
in classBasicMenuItemUI
-
-