|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.PopupMenuUI javax.swing.plaf.basic.BasicPopupMenuUI com.alee.laf.menu.WebPopupMenuUI
public class WebPopupMenuUI
Custom UI for JPopupMenu component.
Field Summary | |
---|---|
protected boolean |
fixLocation
|
protected java.beans.PropertyChangeListener |
jdkSevenFixListener
|
protected java.awt.Insets |
margin
UI style settings. |
protected int |
menuSpacing
|
protected java.beans.PropertyChangeListener |
orientationChangeListener
|
protected PopupMenuPainter |
painter
Component painter. |
protected java.beans.PropertyChangeListener |
popupMenuTypeUpdater
Menu listeners. |
protected PopupMenuWay |
popupMenuWay
|
protected java.lang.String |
styleId
Runtime variables. |
protected boolean |
transparent
|
protected java.beans.PropertyChangeListener |
visibilityChangeListener
|
Fields inherited from class javax.swing.plaf.basic.BasicPopupMenuUI |
---|
popupMenu |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
WebPopupMenuUI()
|
Method Summary | |
---|---|
protected void |
applyPainterSettings(PopupMenuPainter painter)
Applies UI settings to this specific painter. |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
Returns an instance of the WebPopupMenuUI for the specified component. |
java.awt.Color |
getBorderColor()
Returns popup border color. |
int |
getCornerAlignment()
Returns dropdown corner alignment. |
int |
getCornerWidth()
Returns popup dropdown style corner width. |
java.awt.Insets |
getMargin()
Returns popup menu content margin. |
int |
getMenuSpacing()
Returns spacing between menubar popup menus. |
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 . |
PopupStyle |
getPopupStyle()
Returns popup style. |
int |
getRound()
Returns decoration corners rounding. |
float |
getShadeTransparency()
Returns popup shade transparency. |
int |
getShadeWidth()
Returns decoration shade width. |
java.lang.String |
getStyleId()
Returns component style ID. |
float |
getTransparency()
Returns popup background transparency. |
void |
installUI(javax.swing.JComponent c)
Installs UI in the specified component. |
boolean |
isFixLocation()
Returns whether popup menu should try to fix its initial location when displayed or not. |
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
Paints popup menu decorations. |
java.awt.Shape |
provideShape()
Returns component shape. |
void |
setBorderColor(java.awt.Color color)
Sets popup border color. |
void |
setCornerAlignment(int cornerAlignment)
Sets dropdown corner alignment. |
void |
setCornerWidth(int width)
Sets popup dropdown style corner width. |
void |
setFixLocation(boolean fix)
Sets whether popup menu should try to fix its initial location when displayed or not. |
void |
setMargin(java.awt.Insets margin)
Sets popup menu content margin. |
void |
setMenuSpacing(int spacing)
Sets spacing between menubar popup menus. |
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. |
void |
setPopupStyle(PopupStyle style)
Sets popup style. |
void |
setRound(int round)
Sets decoration corners rounding. |
void |
setShadeTransparency(float opacity)
Sets popup shade transparency. |
void |
setShadeWidth(int shadeWidth)
Sets decoration shade width. |
void |
setStyleId(java.lang.String id)
Sets custom component style ID. |
void |
setTransparency(float transparency)
Sets popup background transparency. |
void |
uninstallUI(javax.swing.JComponent c)
Uninstalls UI from the specified component. |
void |
updateBorder()
Updates custom WebLaF border. |
Methods inherited from class javax.swing.plaf.basic.BasicPopupMenuUI |
---|
installDefaults, installKeyboardActions, installListeners, isPopupTrigger, uninstallDefaults, uninstallKeyboardActions, uninstallListeners |
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.Insets margin
protected int menuSpacing
protected boolean fixLocation
protected PopupMenuPainter painter
protected java.beans.PropertyChangeListener popupMenuTypeUpdater
protected java.beans.PropertyChangeListener orientationChangeListener
protected java.beans.PropertyChangeListener visibilityChangeListener
protected java.beans.PropertyChangeListener jdkSevenFixListener
protected java.lang.String styleId
protected boolean transparent
protected PopupMenuWay popupMenuWay
Constructor Detail |
---|
public WebPopupMenuUI()
Method Detail |
---|
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c
- component that will use UI instance
public void installUI(javax.swing.JComponent c)
installUI
in class javax.swing.plaf.basic.BasicPopupMenuUI
c
- component for this UIpublic void uninstallUI(javax.swing.JComponent c)
uninstallUI
in class javax.swing.plaf.basic.BasicPopupMenuUI
c
- component with this UIpublic java.lang.String getStyleId()
getStyleId
in interface Styleable
public void setStyleId(java.lang.String id)
setStyleId
in interface Styleable
id
- custom component style IDpublic java.awt.Shape provideShape()
provideShape
in interface ShapeProvider
public void updateBorder()
updateBorder
in interface BorderMethods
public java.awt.Insets getMargin()
public void setMargin(java.awt.Insets margin)
margin
- new popup menu content marginpublic int getMenuSpacing()
public void setMenuSpacing(int spacing)
spacing
- new spacing between menubar popup menuspublic boolean isFixLocation()
public void setFixLocation(boolean fix)
fix
- whether popup menu should try to fix its initial location when displayed or notpublic void setPopupMenuWay(PopupMenuWay way)
way
- approximate popup menu display waypublic PopupStyle getPopupStyle()
public void setPopupStyle(PopupStyle style)
style
- new popup stylepublic java.awt.Color getBorderColor()
public void setBorderColor(java.awt.Color color)
color
- new popup border colorpublic int getRound()
public void setRound(int round)
round
- decoration corners roundingpublic int getShadeWidth()
public void setShadeWidth(int shadeWidth)
shadeWidth
- decoration shade widthpublic float getShadeTransparency()
public void setShadeTransparency(float opacity)
opacity
- new popup shade transparencypublic int getCornerWidth()
public void setCornerWidth(int width)
width
- popup dropdown style corner widthpublic int getCornerAlignment()
public void setCornerAlignment(int cornerAlignment)
cornerAlignment
- dropdown corner alignmentpublic float getTransparency()
public void setTransparency(float transparency)
transparency
- popup background transparencypublic Painter getPainter()
public void setPainter(Painter painter)
painter
- new popup menu painterprotected void applyPainterSettings(PopupMenuPainter painter)
painter
- 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.PopupMenuUI
popup
- JPopupMenu requesting Popupx
- screen x location Popup is to be shown aty
- screen y location Popup is to be shown at
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint
in class javax.swing.plaf.ComponentUI
g
- graphics contextc
- popup menu component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |