Package com.formdev.flatlaf.ui
Class FlatMenuItemUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- javax.swing.plaf.basic.BasicMenuItemUI
-
- com.formdev.flatlaf.ui.FlatMenuItemUI
-
- All Implemented Interfaces:
FlatStylingSupport.StyleableLookupProvider,FlatStylingSupport.StyleableUI
public class FlatMenuItemUI extends BasicMenuItemUI implements FlatStylingSupport.StyleableUI, FlatStylingSupport.StyleableLookupProvider
Provides the Flat LaF UI delegate forJMenuItem.- UiDefault:
- MenuItem.font Font, MenuItem.background Color, MenuItem.foreground Color, MenuItem.disabledForeground Color, MenuItem.selectionBackground Color, MenuItem.selectionForeground Color, MenuItem.acceleratorForeground Color, MenuItem.acceleratorSelectionForeground Color, MenuItem.acceleratorFont Font defaults to MenuItem.font, MenuItem.acceleratorDelimiter String, MenuItem.border Border, MenuItem.borderPainted boolean, MenuItem.margin Insets, MenuItem.arrowIcon Icon, MenuItem.checkIcon Icon, MenuItem.opaque boolean , MenuItem.iconTextGap int
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI
BasicMenuItemUI.MouseInputHandler
-
-
Field Summary
-
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 FlatMenuItemUI()
-
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 PropertyChangeListenercreatePropertyChangeListener(JComponent c)protected FlatMenuItemRenderercreateRenderer()static ComponentUIcreateUI(JComponent c)MethodHandles.LookupgetLookupForStyling()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.BasicMenuItemUI
createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredSize, getPropertyPrefix, installComponents, installKeyboardActions, installListeners, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallKeyboardActions, uninstallListeners, 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 classBasicMenuItemUI
-
uninstallDefaults
protected void uninstallDefaults()
- Overrides:
uninstallDefaultsin classBasicMenuItemUI
-
createRenderer
protected FlatMenuItemRenderer createRenderer()
-
createPropertyChangeListener
protected PropertyChangeListener createPropertyChangeListener(JComponent c)
- Overrides:
createPropertyChangeListenerin classBasicMenuItemUI
-
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
-
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
-
-