Package com.formdev.flatlaf.ui
Class FlatMenuUI.FlatMenuRenderer
- java.lang.Object
-
- com.formdev.flatlaf.ui.FlatMenuItemRenderer
-
- com.formdev.flatlaf.ui.FlatMenuUI.FlatMenuRenderer
-
- Enclosing class:
- FlatMenuUI
protected class FlatMenuUI.FlatMenuRenderer extends FlatMenuItemRenderer
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
hoverBackground
protected int
menuBarSelectionArc
protected java.awt.Color
menuBarSelectionBackground
protected java.awt.Insets
menuBarSelectionEmbeddedInsets
protected java.awt.Color
menuBarSelectionForeground
protected java.awt.Insets
menuBarSelectionInsets
protected java.awt.Color
menuBarUnderlineSelectionBackground
protected java.awt.Color
menuBarUnderlineSelectionColor
protected int
menuBarUnderlineSelectionHeight
-
Fields inherited from class com.formdev.flatlaf.ui.FlatMenuItemRenderer
acceleratorArrowGap, acceleratorDelimiter, acceleratorFont, arrowIcon, checkBackground, checkIcon, checkMargins, menuItem, minimumIconSize, minimumWidth, selectionArc, selectionInsets, textAcceleratorGap, textNoAcceleratorGap, underlineSelectionBackground, underlineSelectionCheckBackground, underlineSelectionColor, underlineSelectionHeight, verticallyAlignText
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatMenuRenderer(javax.swing.JMenuItem menuItem, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, java.awt.Font acceleratorFont, java.lang.String acceleratorDelimiter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T> T
getStyleFromMenuBarUI(java.util.function.Function<FlatMenuBarUI,T> f, T defaultValue)
private <T> T
getStyleFromMenuBarUI(java.util.function.Function<FlatMenuBarUI,T> f, T defaultValue, T defaultValue2)
private boolean
isHover()
protected void
paintBackground(java.awt.Graphics g)
protected void
paintSelection(java.awt.Graphics g, java.awt.Color selectionBackground, java.awt.Insets selectionInsets, int selectionArc)
protected void
paintText(java.awt.Graphics g, java.awt.Rectangle textRect, java.lang.String text, java.awt.Color selectionForeground, java.awt.Color disabledForeground)
protected void
paintUnderlineSelection(java.awt.Graphics g, java.awt.Color underlineSelectionBackground, java.awt.Color underlineSelectionColor, int underlineSelectionHeight)
-
Methods inherited from class com.formdev.flatlaf.ui.FlatMenuItemRenderer
applyStyleProperty, clearClientProperties, deriveBackground, getMacOSModifiersExText, getPreferredMenuItemSize, getStyleableInfos, getStyleableValue, getTextForAccelerator, isArmedOrSelected, isInVerticalMenuBar, isTopLevelMenu, isUnderlineSelection, paintAccelerator, paintArrowIcon, paintHTMLText, paintIcon, paintIcon, paintMenuItem, paintText
-
-
-
-
Field Detail
-
menuBarSelectionInsets
protected java.awt.Insets menuBarSelectionInsets
- Since:
- 3
-
menuBarSelectionEmbeddedInsets
protected java.awt.Insets menuBarSelectionEmbeddedInsets
- Since:
- 3
-
menuBarSelectionArc
protected int menuBarSelectionArc
- Since:
- 3
-
hoverBackground
protected java.awt.Color hoverBackground
-
menuBarSelectionBackground
protected java.awt.Color menuBarSelectionBackground
- Since:
- 2.5
-
menuBarSelectionForeground
protected java.awt.Color menuBarSelectionForeground
- Since:
- 2.5
-
menuBarUnderlineSelectionBackground
protected java.awt.Color menuBarUnderlineSelectionBackground
-
menuBarUnderlineSelectionColor
protected java.awt.Color menuBarUnderlineSelectionColor
-
menuBarUnderlineSelectionHeight
protected int menuBarUnderlineSelectionHeight
-
-
Method Detail
-
paintBackground
protected void paintBackground(java.awt.Graphics g)
- Overrides:
paintBackground
in classFlatMenuItemRenderer
- Since:
- 3
-
paintSelection
protected void paintSelection(java.awt.Graphics g, java.awt.Color selectionBackground, java.awt.Insets selectionInsets, int selectionArc)
- Overrides:
paintSelection
in classFlatMenuItemRenderer
- Since:
- 3
-
paintUnderlineSelection
protected void paintUnderlineSelection(java.awt.Graphics g, java.awt.Color underlineSelectionBackground, java.awt.Color underlineSelectionColor, int underlineSelectionHeight)
- Overrides:
paintUnderlineSelection
in classFlatMenuItemRenderer
- Since:
- 3
-
paintText
protected void paintText(java.awt.Graphics g, java.awt.Rectangle textRect, java.lang.String text, java.awt.Color selectionForeground, java.awt.Color disabledForeground)
- Overrides:
paintText
in classFlatMenuItemRenderer
-
isHover
private boolean isHover()
-
getStyleFromMenuBarUI
private <T> T getStyleFromMenuBarUI(java.util.function.Function<FlatMenuBarUI,T> f, T defaultValue, T defaultValue2)
-
getStyleFromMenuBarUI
private <T> T getStyleFromMenuBarUI(java.util.function.Function<FlatMenuBarUI,T> f, T defaultValue)
-
-