public class MenuPainter<E extends javax.swing.JMenu,U extends WebMenuUI> extends AbstractMenuItemPainter<E,U> implements IMenuPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected int |
arrowGap |
static javax.swing.ImageIcon |
arrowLeftIcon |
static javax.swing.ImageIcon |
arrowRightIcon
Used icons.
|
protected java.awt.event.MouseAdapter |
mouseAdapter
Listeners.
|
protected boolean |
mouseover
Runtime variables.
|
protected int |
round
Style settings.
|
protected int |
shadeWidth |
acceleratorBg, acceleratorDisabledFg, acceleratorFg, acceleratorFont, acceleratorGap, alignTextToMenuIcons, buttonModelChangeListener, disabledFg, iconAlignment, selectedBottomBg, selectedTopBgcomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
MenuPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.swing.Icon |
getArrowIcon(javax.swing.JMenu menu)
Returns arrow icon displayed when sub-menu is available.
|
java.awt.Dimension |
getPreferredSize()
Returns preferred size required for proper painting of visual data provided by this painter.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
Paints visual data using component graphics context.
|
protected void |
paintBackground(java.awt.Graphics2D g2d,
boolean selected)
Paints menu item background.
|
void |
uninstall(E c,
U ui)
Called when painter is installed into some component.
|
fillCorner, getSelectedBounds, paintAcceleratorText, paintIcon, paintText, setAcceleratorFontaddPainterListener, b, borderChange, getBorders, getCompleteBorder, i, i, i, installPropertyChangeListener, isOpaque, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, propertyChange, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, getBorders, isOpaque, removePainterListenerpublic static final javax.swing.ImageIcon arrowRightIcon
public static final javax.swing.ImageIcon arrowLeftIcon
protected int round
protected int shadeWidth
protected int arrowGap
protected java.awt.event.MouseAdapter mouseAdapter
protected boolean mouseover
public void install(E c, U ui)
Painterpublic void uninstall(E c, U ui)
Painterpublic void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c,
U ui)
PainterIt is highly recommended to honor provided painting bounds to avoid painting issues. These bounds might be representing full component size or contain just a small portion of the component.
protected void paintBackground(java.awt.Graphics2D g2d,
boolean selected)
AbstractMenuItemPainterpaintBackground in class AbstractMenuItemPainter<E extends javax.swing.JMenu,U extends WebMenuUI>g2d - graphics contextselected - whether menu item is selected or notprotected javax.swing.Icon getArrowIcon(javax.swing.JMenu menu)
menu - menupublic java.awt.Dimension getPreferredSize()
PaintergetPreferredSize in interface Painter<E extends javax.swing.JMenu,U extends WebMenuUI>getPreferredSize in class AbstractMenuItemPainter<E extends javax.swing.JMenu,U extends WebMenuUI>