Class FlatMenuItemRenderer
java.lang.Object
com.formdev.flatlaf.ui.FlatMenuItemRenderer
- Direct Known Subclasses:
FlatMenuUI.FlatMenuRenderer
Renderer for menu items.
- UiDefault:
- MenuItem.verticallyAlignText boolean, MenuItem.minimumWidth int, MenuItem.minimumIconSize Dimension, MenuItem.textAcceleratorGap int, MenuItem.textNoAcceleratorGap int, MenuItem.acceleratorArrowGap int, MenuItem.checkBackground Color, MenuItem.checkMargins Insets, MenuItem.selectionInsets Insets, MenuItem.selectionArc int, MenuItem.selectionType String null (default) or underline, MenuItem.underlineSelectionBackground Color, MenuItem.underlineSelectionCheckBackground Color, MenuItem.underlineSelectionColor Color, MenuItem.underlineSelectionHeight int
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected final Stringprotected Fontprotected Iconprotected Colorprotected Iconprotected Insetsprotected final JMenuItemprotected Dimensionprotected intprotected intprotected Insetsprotected intprotected intprotected Colorprotected Colorprotected Colorprotected intprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectapplyStyleProperty(String key, Object value) protected ColorderiveBackground(Color background) protected StringgetMacOSModifiersExText(int modifiers, boolean leftToRight) protected DimensiongetStyleableValue(String key) protected StringgetTextForAccelerator(KeyStroke accelerator) protected static booleanisArmedOrSelected(JMenuItem menuItem) Returnstrueif either the menu item is armed (mouse over item) or it is aJMenuand selected (shows submenu).static booleanisInVerticalMenuBar(JMenuItem menuItem) protected static booleanisTopLevelMenu(JMenuItem menuItem) protected booleanprotected voidpaintAccelerator(Graphics g, Rectangle accelRect, String accelText, Color foreground, Color selectionForeground, Color disabledForeground) protected voidpaintArrowIcon(Graphics g, Rectangle arrowRect, Icon arrowIcon) protected voidprotected static voidpaintHTMLText(Graphics g, JMenuItem menuItem, Rectangle textRect, View htmlView, Color selectionForeground) protected voidpaintIcon(Graphics g, Rectangle iconRect, Icon icon, Color checkBackground, Color selectionBackground) protected static voidprotected voidpaintMenuItem(Graphics g, Color selectionBackground, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground) protected voidpaintSelection(Graphics g, Color selectionBackground, Insets selectionInsets, int selectionArc) protected voidpaintText(Graphics g, Rectangle textRect, String text, Color selectionForeground, Color disabledForeground) protected static voidpaintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text, int mnemonicIndex, Font font, Color foreground, Color selectionForeground, Color disabledForeground) protected voidpaintUnderlineSelection(Graphics g, Color underlineSelectionBackground, Color underlineSelectionColor, int underlineSelectionHeight)
-
Field Details
-
checkIcon
-
arrowIcon
-
acceleratorFont
-
acceleratorDelimiter
-
verticallyAlignText
protected boolean verticallyAlignText- Since:
- 2
-
minimumWidth
protected int minimumWidth -
minimumIconSize
-
textAcceleratorGap
protected int textAcceleratorGap -
textNoAcceleratorGap
protected int textNoAcceleratorGap -
acceleratorArrowGap
protected int acceleratorArrowGap -
checkBackground
-
checkMargins
-
selectionInsets
- Since:
- 3
-
selectionArc
protected int selectionArc- Since:
- 3
-
underlineSelectionBackground
-
underlineSelectionCheckBackground
-
underlineSelectionColor
-
underlineSelectionHeight
protected int underlineSelectionHeight
-
Constructor Details
-
FlatMenuItemRenderer
-
-
Method Details
-
applyStyleProperty
-
getStyleableInfos
-
getStyleableValue
-
getPreferredMenuItemSize
-
paintMenuItem
-
paintBackground
- Since:
- 3
-
paintSelection
-
paintUnderlineSelection
-
deriveBackground
-
paintIcon
-
paintText
-
paintAccelerator
-
paintArrowIcon
-
paintIcon
-
paintText
-
paintHTMLText
-
isArmedOrSelected
Returnstrueif either the menu item is armed (mouse over item) or it is aJMenuand selected (shows submenu). -
isTopLevelMenu
-
isInVerticalMenuBar
- Since:
- 3.5
-
isUnderlineSelection
protected boolean isUnderlineSelection() -
getTextForAccelerator
-
getMacOSModifiersExText
-