|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.extended.painter.AbstractPainter<E> com.alee.managers.style.skin.web.WebLabelPainter<E> com.alee.managers.style.skin.ninepatch.NPLabelPainter<E>
public class NPLabelPainter<E extends javax.swing.JLabel>
Base 9-patch painter for JLabel component.
Field Summary | |
---|---|
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. |
Fields inherited from class com.alee.managers.style.skin.web.WebLabelPainter |
---|
backgroundPainter, drawShade, paintIconR, paintTextR, shadeColor, transparency |
Fields inherited from class com.alee.extended.painter.AbstractPainter |
---|
listeners, margin, opaque, preferredSize |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class com.alee.managers.style.skin.web.WebLabelPainter |
---|
getBackgroundPainter, getPreferredSize, getShadeColor, getTransparency, isDrawShade, isOpaque, layout, layoutCL, paintDisabledText, paintEnabledText, paintShadowText, setBackgroundPainter, setDrawShade, setShadeColor, setTransparency |
Methods inherited from class com.alee.extended.painter.AbstractPainter |
---|
addPainterListener, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, updateAll, updateOpacity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.alee.extended.painter.Painter |
---|
addPainterListener, removePainterListener |
Field Detail |
---|
protected boolean undecorated
protected boolean paintFocus
protected NinePatchIcon backgroundIcon
protected NinePatchIcon focusedBackgroundIcon
protected FocusTracker focusTracker
protected boolean focused
Constructor Detail |
---|
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 iconMethod Detail |
---|
public void install(E c)
install
in interface Painter<E extends javax.swing.JLabel>
install
in class AbstractPainter<E extends javax.swing.JLabel>
c
- component to processpublic void uninstall(E c)
uninstall
in interface Painter<E extends javax.swing.JLabel>
uninstall
in class AbstractPainter<E extends javax.swing.JLabel>
c
- component to processpublic 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)
getMargin
in interface Painter<E extends javax.swing.JLabel>
getMargin
in class WebLabelPainter<E extends javax.swing.JLabel>
label
- component to process
public void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, E c)
paint
in interface Painter<E extends javax.swing.JLabel>
paint
in class WebLabelPainter<E extends javax.swing.JLabel>
g2d
- component graphicsbounds
- bounds for painter visual datac
- component to processprotected NinePatchIcon getCurrentBackgroundIcon()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |