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 classFlatMenuUI.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 voidapplyStyle(Object style)protected ObjectapplyStyleProperty(String key, Object value)protected MouseInputListenercreateMouseInputListener(JComponent c)protected PropertyChangeListenercreatePropertyChangeListener(JComponent c)protected FlatMenuItemRenderercreateRenderer()static ComponentUIcreateUI(JComponent c)MethodHandles.LookupgetLookupForStyling()DimensiongetMinimumSize(JComponent c)protected DimensiongetPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)Map<String,Class<?>>getStyleableInfos(JComponent c)ObjectgetStyleableValue(JComponent c, String key)protected voidinstallDefaults()protected voidinstallStyle()voidinstallUI(JComponent c)voidpaint(Graphics g, JComponent c)protected voiduninstallDefaults()-
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:
installUIin classBasicMenuItemUI
-
installDefaults
protected void installDefaults()
- Overrides:
installDefaultsin classBasicMenuUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicMenuUI
-
createRenderer
protected FlatMenuItemRenderer createRenderer()
-
createMouseInputListener
protected MouseInputListener createMouseInputListener(JComponent c)
- Overrides:
createMouseInputListenerin classBasicMenuUI
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener(JComponent c)
- Overrides:
createPropertyChangeListenerin 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:
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
-
getMinimumSize
public Dimension getMinimumSize(JComponent c)
- Overrides:
getMinimumSizein classBasicMenuUI
-
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap)
- Overrides:
getPreferredMenuItemSizein classBasicMenuItemUI
-
paint
public void paint(Graphics g, JComponent c)
- Overrides:
paintin classBasicMenuItemUI
-
-