public class WebPopupPainter<E extends javax.swing.JComponent> extends AbstractPainter<E> implements PainterShapeProvider<E>, javax.swing.SwingConstants
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
borderColor |
protected int |
cornerAlignment |
protected int |
cornerSide |
protected int |
cornerWidth |
protected static java.lang.String |
DROPDOWN_BORDER_SHAPE |
protected static java.lang.String |
DROPDOWN_FILL_SHAPE |
protected PopupStyle |
popupStyle
Style settings.
|
protected int |
relativeCorner |
protected int |
round |
protected float |
shadeTransparency |
protected int |
shadeWidth |
protected static java.lang.String |
SIMPLE_BORDER_SHAPE |
protected static java.lang.String |
SIMPLE_FILL_SHAPE
Shape cache keys.
|
protected float |
transparency |
protected boolean |
transparent
Runtime variables.
|
listeners, margin, opaque, preferredSize| Constructor and Description |
|---|
WebPopupPainter() |
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.geom.GeneralPath |
createDropdownCornerShape(E popupMenu,
java.awt.Dimension menuSize,
boolean fill)
Creates and returns dropdown style corner shape.
|
protected java.awt.geom.GeneralPath |
createDropdownShape(E popup,
java.awt.Dimension popupSize,
boolean fill)
Creates and returns dropdown style shape.
|
protected java.awt.geom.GeneralPath |
createSimpleShape(E popup,
java.awt.Dimension popupSize,
boolean fill)
Creates and returns simple popup shape.
|
protected java.awt.Color |
getBackgroundColor(E popup)
Returns popup background color.
|
java.awt.Color |
getBorderColor()
Returns popup border color.
|
protected java.awt.Shape |
getBorderShape(E popup,
java.awt.Dimension popupSize,
boolean fill)
Returns popup border shape.
|
protected java.lang.Object[] |
getCachedShapeSettings(E popup)
Returns an array of shape settings cached along with the shape.
|
protected java.awt.Color |
getComponentBackground(E popup)
Returns popup background color.
|
int |
getCornerAlignment()
Returns dropdown corner alignment.
|
int |
getCornerSide()
Returns dropdown style corner side.
|
int |
getCornerWidth()
Returns popup dropdown style corner width.
|
protected float |
getCurrentShadeTransparency()
Returns current shade transparency.
|
protected java.awt.Shape |
getDropdownCornerShape(E popupMenu,
java.awt.Dimension menuSize,
boolean fill)
Returns dropdown style corner shape.
|
java.awt.Insets |
getMargin(E c)
Returns margin required for visual data provided by this painter.
|
PopupStyle |
getPopupStyle()
Returns popup style.
|
int |
getRelativeCorner()
Returns relative dropdown corner position.
|
int |
getRound()
Returns popup border corners rounding.
|
protected java.awt.Rectangle |
getShadeBounds(java.awt.Dimension popupSize)
Returns popup shade bounds.
|
float |
getShadeTransparency()
Returns popup shade transparency.
|
int |
getShadeWidth()
Returns popup shade width.
|
protected int |
getSideWidth()
Returns popup side space width.
|
float |
getTransparency()
Returns popup background transparency.
|
java.lang.Boolean |
isOpaque(E c)
Returns whether visual data provided by this painter is opaque or not.
|
boolean |
isTransparent()
Returns whether popup is transparent or not.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E popup)
Paints visual data onto the component graphics.
|
protected void |
paintBackground(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
Paints popup background fill.
|
protected void |
paintBorder(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
Paints popup border.
|
protected void |
paintShade(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
Paints popup shade.
|
protected void |
paintSimplePopup(java.awt.Graphics2D g2d,
E popup)
Paints simple popup version.
|
protected void |
paintTransparentPopup(java.awt.Graphics2D g2d,
E popup)
Paints transparent popup version.
|
java.awt.Shape |
provideShape(E component,
java.awt.Rectangle bounds)
Returns painted component shape.
|
void |
setBorderColor(java.awt.Color color)
Sets popup border color.
|
void |
setCornerAlignment(int cornerAlignment)
Sets dropdown corner alignment.
|
void |
setCornerSide(int cornerSide)
Sets dropdown style corner side.
|
void |
setCornerWidth(int width)
Sets popup dropdown style corner width.
|
void |
setPopupStyle(PopupStyle style)
Sets popup style.
|
void |
setRelativeCorner(int relativeCorner)
Sets relative dropdown corner position.
|
void |
setRound(int round)
Sets popup border corners rounding.
|
void |
setShadeTransparency(float transparency)
Sets popup shade transparency.
|
void |
setShadeWidth(int width)
Sets popup shade width.
|
void |
setTransparency(float transparency)
Sets popup background transparency.
|
void |
setTransparent(boolean transparent)
Sets whether popup is transparent or not.
|
addPainterListener, getPreferredSize, install, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, uninstall, updateAll, updateOpacityprotected static final java.lang.String SIMPLE_FILL_SHAPE
protected static final java.lang.String SIMPLE_BORDER_SHAPE
protected static final java.lang.String DROPDOWN_FILL_SHAPE
protected static final java.lang.String DROPDOWN_BORDER_SHAPE
protected PopupStyle popupStyle
protected java.awt.Color borderColor
protected int round
protected int shadeWidth
protected float shadeTransparency
protected int cornerWidth
protected float transparency
protected boolean transparent
protected int cornerSide
protected int relativeCorner
protected int cornerAlignment
public 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 - new popup border corners roundingpublic int getShadeWidth()
public void setShadeWidth(int width)
width - new popup shade widthpublic float getShadeTransparency()
public void setShadeTransparency(float transparency)
transparency - new popup shade transparencypublic int getCornerWidth()
public void setCornerWidth(int width)
width - popup dropdown style corner widthpublic float getTransparency()
public void setTransparency(float transparency)
transparency - popup background transparencypublic boolean isTransparent()
public void setTransparent(boolean transparent)
transparent - whether popup is transparent or notpublic int getCornerSide()
public void setCornerSide(int cornerSide)
cornerSide - dropdown style corner sidepublic int getRelativeCorner()
public void setRelativeCorner(int relativeCorner)
relativeCorner - relative dropdown corner positionpublic int getCornerAlignment()
public void setCornerAlignment(int cornerAlignment)
cornerAlignment - dropdown corner alignmentpublic java.awt.Shape provideShape(E component, java.awt.Rectangle bounds)
provideShape in interface PainterShapeProvider<E extends javax.swing.JComponent>component - component to processbounds - bounds for painter visual datapublic java.lang.Boolean isOpaque(E c)
public java.awt.Insets getMargin(E c)
public void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E popup)
protected void paintTransparentPopup(java.awt.Graphics2D g2d,
E popup)
g2d - graphics contextpopup - popup componentprotected void paintSimplePopup(java.awt.Graphics2D g2d,
E popup)
g2d - graphics contextpopup - popup componentprotected void paintShade(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
g2d - graphics contextpopup - popup componentpopupSize - popup sizeprotected float getCurrentShadeTransparency()
protected void paintBackground(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
g2d - graphics contextpopup - popup componentpopupSize - popup sizeprotected void paintBorder(java.awt.Graphics2D g2d,
E popup,
java.awt.Dimension popupSize)
g2d - graphics contextpopup - popup componentpopupSize - popup sizeprotected java.awt.Color getBackgroundColor(E popup)
popup - popup componentprotected java.awt.Color getComponentBackground(E popup)
popup - popup componentprotected java.awt.Rectangle getShadeBounds(java.awt.Dimension popupSize)
popupSize - popup sizeprotected java.awt.Shape getBorderShape(E popup, java.awt.Dimension popupSize, boolean fill)
popup - popup componentpopupSize - popup sizefill - whether it is a fill shape or notprotected java.lang.Object[] getCachedShapeSettings(E popup)
popup - popup componentprotected java.awt.geom.GeneralPath createSimpleShape(E popup, java.awt.Dimension popupSize, boolean fill)
popup - popup componentpopupSize - popup sizefill - whether it is a fill shape or notprotected java.awt.geom.GeneralPath createDropdownShape(E popup, java.awt.Dimension popupSize, boolean fill)
popup - popup componentpopupSize - popup sizefill - whether it is a fill shape or notprotected java.awt.Shape getDropdownCornerShape(E popupMenu, java.awt.Dimension menuSize, boolean fill)
popupMenu - popup menumenuSize - menu sizefill - whether it is a fill shape or notprotected java.awt.geom.GeneralPath createDropdownCornerShape(E popupMenu, java.awt.Dimension menuSize, boolean fill)
popupMenu - popup menumenuSize - menu sizefill - whether it is a fill shape or notprotected int getSideWidth()