com.alee.laf.menu
Interface PopupMenuPainter<E extends javax.swing.JPopupMenu>

All Superinterfaces:
Painter<E>, SpecificPainter
All Known Implementing Classes:
AdaptivePopupMenuPainter, WebPopupMenuPainter

public interface PopupMenuPainter<E extends javax.swing.JPopupMenu>
extends Painter<E>, SpecificPainter

Base interface for JPopupMenu component painters.

Author:
Mikle Garin

Method Summary
 java.awt.Point preparePopupMenu(E popupMenu, java.awt.Component invoker, int x, int y)
          Prepares popup menu to be displayed.
 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.
 void setPopupMenuWay(PopupMenuWay way)
          Sets preferred popup menu display way.
 void setTransparent(boolean transparent)
          Sets whether popup menu is transparent or not.
 
Methods inherited from interface com.alee.extended.painter.Painter
addPainterListener, getMargin, getPreferredSize, install, isOpaque, paint, removePainterListener, uninstall
 

Method Detail

setTransparent

void setTransparent(boolean transparent)
Sets whether popup menu is transparent or not. This mark is updated only once per component as it is initialized on UI initialization only.

Parameters:
transparent - whether popup menu is transparent or not

setMenuSpacing

void setMenuSpacing(int spacing)
Sets spacing between popup menus.

Parameters:
spacing - spacing between popup menus

setFixLocation

void setFixLocation(boolean fix)
Sets whether should fix initial popup menu location or not. If set to true popup menu will try to use best possible location to show up.

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.

Parameters:
fix - whether should fix initial popup menu location or not

setPopupMenuWay

void setPopupMenuWay(PopupMenuWay way)
Sets preferred popup menu display way. This value is updated right before preparePopupMenu method call.

Parameters:
way - preferred popup menu display way

setPopupMenuType

void setPopupMenuType(PopupMenuType type)
Sets popup menu type. This value is updated right before popup menu window becomes visible. You can use it to draw different popup menu decoration for each popup menu type.

Parameters:
type - popup menu type

preparePopupMenu

java.awt.Point preparePopupMenu(E popupMenu,
                                java.awt.Component invoker,
                                int x,
                                int y)
Prepares popup menu to be displayed.

Parameters:
popupMenu - JPopupMenu to prepare for display
x - screen x location actual popup is to be shown at
y - screen y location actual popup is to be shown at
Returns:
modified popup display location