E - component typeU - component UI typepublic abstract class AbstractPopupPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI> extends AbstractPainter<E,U> 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 float |
opacity |
protected PopupStyle |
popupStyle
Style settings.
|
protected int |
relativeCorner |
protected int |
round |
protected NinePatchIcon |
shade |
protected float |
shadeOpacity |
protected int |
shadeWidth |
protected boolean |
shaped
Runtime variables.
|
protected static java.lang.String |
SIMPLE_BORDER_SHAPE |
protected static java.lang.String |
SIMPLE_FILL_SHAPE
Shape cache keys.
|
component, listeners, ltr, propertyChangeListener, ui| Constructor and Description |
|---|
AbstractPopupPainter() |
| 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.
|
java.awt.Insets |
getBorders()
Returns borders required for visual data provided by this painter.
|
protected java.awt.Shape |
getBorderShape(E popup,
java.awt.Dimension popupSize,
boolean fill)
Returns popup border shape.
|
protected java.lang.Object[] |
getCachedShapeSettings(E popup,
java.awt.Dimension popupSize)
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 |
getCurrentShadeOpacity()
Returns current shade opacity.
|
protected java.awt.Shape |
getDropdownCornerShape(E popupMenu,
java.awt.Dimension menuSize,
boolean fill)
Returns dropdown style corner shape.
|
float |
getOpacity()
Returns popup background opacity.
|
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 |
getShadeOpacity()
Returns popup shade opacity.
|
int |
getShadeWidth()
Returns popup shade width.
|
protected int |
getSideWidth()
Returns popup side space width.
|
void |
install(E c,
U ui)
Called when painter is installed onto some component.
|
java.lang.Boolean |
isOpaque()
Returns whether visual data provided by this painter is opaque or not.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E popup,
U ui)
Paints visual data using component graphics context.
|
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 |
setOpacity(float opacity)
Sets popup background opacity.
|
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 |
setShadeOpacity(float opacity)
Sets popup shade opacity.
|
void |
setShadeWidth(int width)
Sets popup shade width.
|
addPainterListener, b, borderChange, getCompleteBorder, getPreferredSize, i, i, i, installPropertyChangeListener, isSectionPainter, isSettingsUpdateAllowed, orientationChange, p, propertyChange, removePainterListener, repaint, repaint, repaint, revalidate, saveOrientation, uninstall, uninstallPropertyChangeListener, updateAll, updateBorder, updateOpacity, updateOrientationprotected 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 shadeOpacity
protected int cornerWidth
protected float opacity
protected boolean shaped
protected int cornerSide
protected int relativeCorner
protected int cornerAlignment
protected NinePatchIcon shade
public void install(E c, U ui)
Painterinstall in interface Painter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>install in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>c - component this painter is being installed ontoui - component UIpublic 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 getShadeOpacity()
public void setShadeOpacity(float opacity)
opacity - new popup shade opacitypublic int getCornerWidth()
public void setCornerWidth(int width)
width - popup dropdown style corner widthpublic float getOpacity()
public void setOpacity(float opacity)
opacity - popup background opacitypublic 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)
PainterShapeProviderprovideShape in interface PainterShapeProvider<E extends javax.swing.JComponent>component - component to processbounds - bounds for painter visual datapublic java.lang.Boolean isOpaque()
PainterisOpaque in interface Painter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>isOpaque in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>public 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.JComponent,U extends javax.swing.plaf.ComponentUI>getBorders in class AbstractPainter<E extends javax.swing.JComponent,U extends javax.swing.plaf.ComponentUI>null in case those aren't neededpublic void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E popup,
U ui)
PainterIt is highly recommended to honor provided painting bounds to avoid painting issues. These bounds might be representing full component size or contain just a small portion of the component.
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 getCurrentShadeOpacity()
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, java.awt.Dimension popupSize)
popup - popup componentpopupSize - popup sizeprotected 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()