Package com.formdev.flatlaf.ui
Class FlatMenuItemRenderer
- java.lang.Object
-
- com.formdev.flatlaf.ui.FlatMenuItemRenderer
-
- Direct Known Subclasses:
FlatMenuUI.FlatMenuRenderer
public class FlatMenuItemRenderer extends Object
Renderer for menu items.- UiDefault:
- MenuItem.minimumWidth int, MenuItem.minimumIconSize Dimension, MenuItem.textAcceleratorGap int, MenuItem.textNoAcceleratorGap int, MenuItem.acceleratorArrowGap int, MenuItem.checkBackground Color, MenuItem.underlineSelectionBackground Color, MenuItem.underlineSelectionCheckBackground Color, MenuItem.underlineSelectionColor Color, MenuItem.underlineSelectionHeight int, MenuItem.selectionBackground Color
-
-
Field Summary
Fields Modifier and Type Field Description protected intacceleratorArrowGapprotected StringacceleratorDelimiterprotected FontacceleratorFontprotected IconarrowIconprotected ColorcheckBackgroundprotected IconcheckIconprotected InsetscheckMarginsprotected JMenuItemmenuItemprotected DimensionminimumIconSizeprotected intminimumWidthprotected ColorselectionBackgroundprotected inttextAcceleratorGapprotected inttextNoAcceleratorGapprotected ColorunderlineSelectionBackgroundprotected ColorunderlineSelectionCheckBackgroundprotected ColorunderlineSelectionColorprotected intunderlineSelectionHeight
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ColorderiveBackground(Color background)protected StringgetMacOSModifiersExText(int modifiers, boolean leftToRight)protected DimensiongetPreferredMenuItemSize()protected StringgetTextForAccelerator(KeyStroke accelerator)protected static booleanisArmedOrSelected(JMenuItem menuItem)protected static booleanisTopLevelMenu(JMenuItem menuItem)protected booleanisUnderlineSelection()protected voidpaintAccelerator(Graphics g, Rectangle accelRect, String accelText, Color foreground, Color selectionForeground, Color disabledForeground)protected voidpaintArrowIcon(Graphics g, Rectangle arrowRect, Icon arrowIcon)protected voidpaintBackground(Graphics g, Color selectionBackground)protected static voidpaintHTMLText(Graphics g, JMenuItem menuItem, Rectangle textRect, View htmlView, Color selectionForeground)protected voidpaintIcon(Graphics g, Rectangle iconRect, Icon icon, Color checkBackground)protected static voidpaintIcon(Graphics g, JMenuItem menuItem, Icon icon, Rectangle iconRect)protected voidpaintMenuItem(Graphics g, Color selectionBackground, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground)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 underlineSelectionColor, int underlineSelectionHeight)
-
-
-
Field Detail
-
menuItem
protected final JMenuItem menuItem
-
checkIcon
protected final Icon checkIcon
-
arrowIcon
protected final Icon arrowIcon
-
acceleratorFont
protected final Font acceleratorFont
-
acceleratorDelimiter
protected final String acceleratorDelimiter
-
minimumWidth
protected final int minimumWidth
-
minimumIconSize
protected final Dimension minimumIconSize
-
textAcceleratorGap
protected final int textAcceleratorGap
-
textNoAcceleratorGap
protected final int textNoAcceleratorGap
-
acceleratorArrowGap
protected final int acceleratorArrowGap
-
checkBackground
protected final Color checkBackground
-
checkMargins
protected final Insets checkMargins
-
underlineSelectionBackground
protected final Color underlineSelectionBackground
-
underlineSelectionCheckBackground
protected final Color underlineSelectionCheckBackground
-
underlineSelectionColor
protected final Color underlineSelectionColor
-
underlineSelectionHeight
protected final int underlineSelectionHeight
-
selectionBackground
protected final Color selectionBackground
-
-
Method Detail
-
getPreferredMenuItemSize
protected Dimension getPreferredMenuItemSize()
-
paintMenuItem
protected void paintMenuItem(Graphics g, Color selectionBackground, Color selectionForeground, Color disabledForeground, Color acceleratorForeground, Color acceleratorSelectionForeground)
-
paintUnderlineSelection
protected void paintUnderlineSelection(Graphics g, Color underlineSelectionColor, int underlineSelectionHeight)
-
paintIcon
protected void paintIcon(Graphics g, Rectangle iconRect, Icon icon, Color checkBackground)
-
paintText
protected void paintText(Graphics g, Rectangle textRect, String text, Color selectionForeground, Color disabledForeground)
-
paintAccelerator
protected void paintAccelerator(Graphics g, Rectangle accelRect, String accelText, Color foreground, Color selectionForeground, Color disabledForeground)
-
paintIcon
protected static void paintIcon(Graphics g, JMenuItem menuItem, Icon icon, Rectangle iconRect)
-
paintText
protected static void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text, int mnemonicIndex, Font font, Color foreground, Color selectionForeground, Color disabledForeground)
-
paintHTMLText
protected static void paintHTMLText(Graphics g, JMenuItem menuItem, Rectangle textRect, View htmlView, Color selectionForeground)
-
isArmedOrSelected
protected static boolean isArmedOrSelected(JMenuItem menuItem)
-
isTopLevelMenu
protected static boolean isTopLevelMenu(JMenuItem menuItem)
-
isUnderlineSelection
protected boolean isUnderlineSelection()
-
getMacOSModifiersExText
protected String getMacOSModifiersExText(int modifiers, boolean leftToRight)
-
-