public class PopupMenuPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI> extends AbstractPopupPainter<E,U> implements IPopupMenuPainter<E,U>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dropdownStyleForMenuBar |
protected boolean |
fixLocation |
protected int |
menuSpacing
Style settings.
|
protected PopupMenuType |
popupMenuType
Runtime variables.
|
borderColor, cornerAlignment, cornerSide, cornerWidth, DROPDOWN_BORDER_SHAPE, DROPDOWN_FILL_SHAPE, opacity, popupStyle, relativeCorner, round, shade, shadeOpacity, shadeWidth, shaped, SIMPLE_BORDER_SHAPE, SIMPLE_FILL_SHAPEcomponent, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
PopupMenuPainter() |
| Modifier and Type | Method and Description |
|---|---|
void |
configurePopup(E popupMenu,
java.awt.Component invoker,
int x,
int y,
javax.swing.Popup popup)
Configures created popup to be displayed.
|
protected WebComboBoxUI |
geComboBoxUI(E popupMenu)
Returns combobox UI for the specified combobox popup menu.
|
java.awt.Insets |
getBorders()
Returns borders required for visual data provided by this painter.
|
int |
getMenuSpacing()
Returns spacing between popup menus.
|
protected void |
installPopupSettings(java.awt.Window window,
E popupMenu)
Configures popup menu window opacity and shape.
|
boolean |
isFixLocation()
Returns whether should fix initial popup menu location or not.
|
protected void |
orientationChange()
Performs various updates on orientation change.
|
protected void |
paintDropdownCornerFill(java.awt.Graphics2D g2d,
E popupMenu,
java.awt.Dimension menuSize)
Paints dropdown-styled popup menu corner fill if menu item near it is selected.
|
protected void |
paintTransparentPopup(java.awt.Graphics2D g2d,
E popupMenu)
Paints transparent popup version.
|
java.awt.Point |
preparePopupMenu(E popupMenu,
java.awt.Component invoker,
int x,
int y)
Prepares popup menu to be displayed.
|
protected void |
propertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Performs various updates on property changes.
|
void |
setFixLocation(boolean fix)
Sets whether should fix initial popup menu location or not.
|
void |
setMenuSpacing(int spacing)
Sets spacing between popup menus.
|
void |
setPopupMenuType(PopupMenuType type)
Sets popup menu type.
|
protected void |
uninstallPopupSettings(java.awt.Window window,
E popupMenu)
Unconfigures popup menu window opacity and shape.
|
createDropdownCornerShape, createDropdownShape, createSimpleShape, getBackgroundColor, getBorderColor, getBorderShape, getCachedShapeSettings, getComponentBackground, getCornerAlignment, getCornerSide, getCornerWidth, getCurrentShadeOpacity, getDropdownCornerShape, getOpacity, getPopupStyle, getRelativeCorner, getRound, getShadeBounds, getShadeOpacity, getShadeWidth, getSideWidth, install, isOpaque, paint, paintBackground, paintBorder, paintShade, paintSimplePopup, provideShape, setBorderColor, setCornerAlignment, setCornerSide, setCornerWidth, setOpacity, setPopupStyle, setRelativeCorner, setRound, setShadeOpacity, setShadeWidthaddPainterListener, b, borderChange, getCompleteBorder, getPreferredSize, i, i, i, installPropertyChangeListener, isSectionPainter, isSettingsUpdateAllowed, p, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, getPreferredSize, install, isOpaque, paint, removePainterListener, uninstallprotected int menuSpacing
protected boolean fixLocation
protected boolean dropdownStyleForMenuBar
protected PopupMenuType popupMenuType
protected void propertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
AbstractPainterpropertyChange in class AbstractPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>property - modified propertyoldValue - old property valuenewValue - new property valueprotected void orientationChange()
AbstractPainterorientationChange in class AbstractPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>public int getMenuSpacing()
public void setMenuSpacing(int spacing)
spacing - spacing between popup menuspublic boolean isFixLocation()
public void setFixLocation(boolean fix)
This is set to true by default to place menubar and menu popups correctly. You might want to set this to false for some specific popup menu, but not all of them at once.
fix - whether should fix initial popup menu location or notpublic void setPopupMenuType(PopupMenuType type)
type - popup menu typepublic java.awt.Insets getBorders()
Painter
You may pass null in case additional borders aren't needed for this painter.
getBorders in interface Painter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>getBorders in class AbstractPopupPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>null in case those aren't neededprotected void paintTransparentPopup(java.awt.Graphics2D g2d,
E popupMenu)
AbstractPopupPainterpaintTransparentPopup in class AbstractPopupPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>g2d - graphics contextpopupMenu - popup componentprotected void paintDropdownCornerFill(java.awt.Graphics2D g2d,
E popupMenu,
java.awt.Dimension menuSize)
g2d - graphics contextpopupMenu - popup menumenuSize - menu sizeprotected WebComboBoxUI geComboBoxUI(E popupMenu)
popupMenu - popup menu to retrieve combobox UI forpublic java.awt.Point preparePopupMenu(E popupMenu, java.awt.Component invoker, int x, int y)
IPopupMenuPainterpreparePopupMenu in interface IPopupMenuPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>popupMenu - JPopupMenu to prepare for displayinvoker - popup menu invokerx - screen x location actual popup is to be shown aty - screen y location actual popup is to be shown atpublic void configurePopup(E popupMenu, java.awt.Component invoker, int x, int y, javax.swing.Popup popup)
IPopupMenuPainterconfigurePopup in interface IPopupMenuPainter<E extends javax.swing.JPopupMenu,U extends WebPopupMenuUI>popupMenu - JPopupMenu to prepare for displayinvoker - popup menu invokerx - screen x location actual popup is to be shown aty - screen y location actual popup is to be shown atpopup - popup to be configuredprotected void installPopupSettings(java.awt.Window window,
E popupMenu)
window - popup menu windowpopupMenu - popup menuprotected void uninstallPopupSettings(java.awt.Window window,
E popupMenu)
window - popup menu windowpopupMenu - popup menu