public class NPLabelPainter<E extends javax.swing.JLabel> extends WebLabelPainter<E>
| Modifier and Type | Field and Description |
|---|---|
protected NinePatchIcon |
backgroundIcon
Used 9-patch icons.
|
protected boolean |
focused |
protected NinePatchIcon |
focusedBackgroundIcon |
protected FocusTracker |
focusTracker
Runtime variables.
|
protected boolean |
paintFocus |
protected boolean |
undecorated
Style settings.
|
backgroundPainter, drawShade, paintIconR, paintTextR, shadeColor, transparencylisteners, margin, opaque, preferredSize| Constructor and Description |
|---|
NPLabelPainter()
Constructs default 9-patch label painter.
|
NPLabelPainter(NinePatchIcon backgroundIcon)
Constructs 9-patch label painter using the specified background icon.
|
NPLabelPainter(NinePatchIcon backgroundIcon,
NinePatchIcon focusedBackgroundIcon)
Constructs 9-patch label painter using the specified background icons.
|
| Modifier and Type | Method and Description |
|---|---|
NinePatchIcon |
getBackgroundIcon()
Returns background 9-patch icon.
|
protected NinePatchIcon |
getCurrentBackgroundIcon()
Returns background 9-patch icon that should be painted right now.
|
NinePatchIcon |
getFocusedBackgroundIcon()
Returns focused background 9-patch icon.
|
java.awt.Insets |
getMargin(E label)
Returns margin required for visual data provided by this painter.
|
void |
install(E c)
Called when painter is intalled into some component.
|
boolean |
isPaintFocus()
Returns whether focus should be painted or not.
|
boolean |
isUndecorated()
Returns whether decoration should be painted or not.
|
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
Paints visual data onto the component graphics.
|
void |
setBackgroundIcon(NinePatchIcon icon)
Sets background 9-patch icon.
|
void |
setFocusedBackgroundIcon(NinePatchIcon icon)
Sets focused background 9-patch icon.
|
void |
setPaintFocus(boolean paint)
Sets whether focus should be painted or not.
|
void |
setUndecorated(boolean undecorated)
Sets whether decoration should be painted or not.
|
void |
uninstall(E c)
Called when painter is intalled into some component.
|
getBackgroundPainter, getPreferredSize, getShadeColor, getTransparency, isDrawShade, isOpaque, layout, layoutCL, paintDisabledText, paintEnabledText, paintShadowText, setBackgroundPainter, setDrawShade, setShadeColor, setTransparencyaddPainterListener, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, updateAll, updateOpacityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPainterListener, removePainterListenerprotected boolean undecorated
protected boolean paintFocus
protected NinePatchIcon backgroundIcon
protected NinePatchIcon focusedBackgroundIcon
protected FocusTracker focusTracker
protected boolean focused
public NPLabelPainter()
public NPLabelPainter(NinePatchIcon backgroundIcon)
backgroundIcon - background 9-patch iconpublic NPLabelPainter(NinePatchIcon backgroundIcon, NinePatchIcon focusedBackgroundIcon)
backgroundIcon - background 9-patch iconfocusedBackgroundIcon - focused background 9-patch iconpublic void install(E c)
public void uninstall(E c)
public boolean isUndecorated()
public void setUndecorated(boolean undecorated)
undecorated - whether decoration should be painted or notpublic boolean isPaintFocus()
public void setPaintFocus(boolean paint)
paint - whether focus should be painted or notpublic NinePatchIcon getBackgroundIcon()
public void setBackgroundIcon(NinePatchIcon icon)
icon - background 9-patch iconpublic NinePatchIcon getFocusedBackgroundIcon()
public void setFocusedBackgroundIcon(NinePatchIcon icon)
icon - focused background 9-patch iconpublic java.awt.Insets getMargin(E label)
public void paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E c)
protected NinePatchIcon getCurrentBackgroundIcon()