public class WebPopupMenuUI extends javax.swing.plaf.basic.BasicPopupMenuUI implements Styleable, ShapeProvider, MarginSupport, PaddingSupport, javax.swing.SwingConstants
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Insets |
margin |
protected java.awt.Insets |
padding |
protected IPopupMenuPainter |
painter
Component painter.
|
protected PopupMenuWay |
popupMenuWay
Runtime variables.
|
EMPTYEMPTY| Constructor and Description |
|---|
WebPopupMenuUI() |
| Modifier and Type | Method and Description |
|---|---|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the WebPopupMenuUI for the specified component.
|
java.awt.Insets |
getMargin()
Returns current margin.
|
java.awt.Insets |
getPadding()
Returns current padding.
|
Painter |
getPainter()
Returns popup menu painter.
|
javax.swing.Popup |
getPopup(javax.swing.JPopupMenu popup,
int x,
int y)
Returns the
Popup that will be responsible for displaying the JPopupMenu. |
PopupMenuWay |
getPopupMenuWay()
Returns currently set preferred popup menu display way.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c) |
StyleId |
getStyleId()
Returns component style ID.
|
void |
installUI(javax.swing.JComponent c)
Installs UI in the specified component.
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c) |
java.awt.Shape |
provideShape()
Returns component shape.
|
void |
setMargin(java.awt.Insets margin)
Sets new margin.
|
void |
setPadding(java.awt.Insets padding)
Sets new padding.
|
void |
setPainter(Painter painter)
Sets popup menu painter.
|
void |
setPopupMenuWay(PopupMenuWay way)
Assists popup menu to allow it choose the best position relative to invoker.
|
StyleId |
setStyleId(StyleId id)
Sets new component style ID.
|
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component.
|
installDefaults, installKeyboardActions, installListeners, isPopupTrigger, uninstallDefaults, uninstallKeyboardActions, uninstallListeners@DefaultPainter(value=PopupMenuPainter.class) protected IPopupMenuPainter painter
protected PopupMenuWay popupMenuWay
protected java.awt.Insets margin
protected java.awt.Insets padding
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - component that will use UI instancepublic void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.basic.BasicPopupMenuUIc - component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI in class javax.swing.plaf.basic.BasicPopupMenuUIc - component with this UIpublic StyleId getStyleId()
StyleablegetStyleId in interface Styleablepublic StyleId setStyleId(StyleId id)
StyleablesetStyleId in interface Styleableid - custom component style IDpublic java.awt.Shape provideShape()
ShapeProviderprovideShape in interface ShapeProviderpublic java.awt.Insets getMargin()
MarginSupportgetMargin in interface MarginSupportpublic void setMargin(java.awt.Insets margin)
MarginSupportnull can be provided to set an empty [0,0,0,0] margin.setMargin in interface MarginSupportmargin - new marginpublic java.awt.Insets getPadding()
PaddingSupportgetPadding in interface PaddingSupportpublic void setPadding(java.awt.Insets padding)
PaddingSupportnull can be provided to set an empty [0,0,0,0] padding.setPadding in interface PaddingSupportpadding - new paddingpublic void setPopupMenuWay(PopupMenuWay way)
way - approximate popup menu display waypublic PopupMenuWay getPopupMenuWay()
public Painter getPainter()
public void setPainter(Painter painter)
painter - new popup menu painterpublic javax.swing.Popup getPopup(javax.swing.JPopupMenu popup,
int x,
int y)
Popup that will be responsible for displaying the JPopupMenu.
Also does necessary modifications to popup coordinates in case they are actually required.getPopup in class javax.swing.plaf.PopupMenuUIpopup - JPopupMenu requesting Popupx - screen x location Popup is to be shown aty - screen y location Popup is to be shown atpublic void paint(java.awt.Graphics g,
javax.swing.JComponent c)
paint in class javax.swing.plaf.ComponentUIpublic java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
getPreferredSize in class javax.swing.plaf.ComponentUI