|
||||||||||
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>
public class WebLabelPainter<E extends javax.swing.JLabel>
Web-style painter for JLabel component. It is used as WebLabelUI default painter.
Field Summary | |
---|---|
protected Painter |
backgroundPainter
|
protected boolean |
drawShade
Style settings. |
protected java.awt.Rectangle |
paintIconR
Runtime variables. |
protected java.awt.Rectangle |
paintTextR
|
protected java.awt.Color |
shadeColor
|
protected java.lang.Float |
transparency
|
Fields inherited from class com.alee.extended.painter.AbstractPainter |
---|
listeners, margin, opaque, preferredSize |
Constructor Summary | |
---|---|
WebLabelPainter()
Constructs new WebLabelPainter with default settings. |
|
WebLabelPainter(Painter backgroundPainter)
Constructs new WebLabelPainter with the specified background painter. |
Method Summary | |
---|---|
Painter |
getBackgroundPainter()
Returns label background painter. |
java.awt.Insets |
getMargin(E label)
Returns margin required for visual data provided by this painter. |
java.awt.Dimension |
getPreferredSize(E label)
Returns preferred size required for proper painting of visual data provided by this painter. |
java.awt.Color |
getShadeColor()
Returns text shade color. |
java.lang.Float |
getTransparency()
Returns label transparency. |
boolean |
isDrawShade()
Returns whether text shade is displayed or not. |
java.lang.Boolean |
isOpaque(E c)
Returns whether visual data provided by this painter is opaque or not. |
protected java.lang.String |
layout(E label,
java.awt.FontMetrics fm,
int width,
int height)
Updates painted label layout and returns clipped or full label text. |
protected java.lang.String |
layoutCL(E label,
java.awt.FontMetrics fm,
java.lang.String text,
javax.swing.Icon icon,
java.awt.Rectangle viewR,
java.awt.Rectangle iconR,
java.awt.Rectangle textR)
Performs label layout and returns clipped or full label text. |
void |
paint(java.awt.Graphics2D g2d,
java.awt.Rectangle bounds,
E label)
Paints visual data onto the component graphics. |
protected void |
paintDisabledText(E label,
java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Performs disabled text painting. |
protected void |
paintEnabledText(E label,
java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Performs enabled text painting. |
protected void |
paintShadowText(java.awt.Graphics2D g2d,
java.lang.String text,
int textX,
int textY)
Paints custom text shade. |
void |
setBackgroundPainter(Painter painter)
Sets label background painter. |
void |
setDrawShade(boolean drawShade)
Sets whether text shade should be displayed or not. |
void |
setShadeColor(java.awt.Color shadeColor)
Sets text shade color. |
void |
setTransparency(java.lang.Float transparency)
Sets label transparency. |
Methods inherited from class com.alee.extended.painter.AbstractPainter |
---|
addPainterListener, install, p, removePainterListener, repaint, repaint, repaint, revalidate, setMargin, setMargin, setMargin, setOpaque, setPreferredSize, uninstall, 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, install, removePainterListener, uninstall |
Field Detail |
---|
protected boolean drawShade
protected java.awt.Color shadeColor
protected java.lang.Float transparency
protected Painter backgroundPainter
protected java.awt.Rectangle paintIconR
protected java.awt.Rectangle paintTextR
Constructor Detail |
---|
public WebLabelPainter()
public WebLabelPainter(Painter backgroundPainter)
backgroundPainter
- background painterMethod Detail |
---|
public boolean isDrawShade()
public void setDrawShade(boolean drawShade)
setDrawShade
in interface LabelPainter<E extends javax.swing.JLabel>
drawShade
- whether text shade should be displayed or notpublic java.awt.Color getShadeColor()
public void setShadeColor(java.awt.Color shadeColor)
shadeColor
- text shade colorpublic java.lang.Float getTransparency()
public void setTransparency(java.lang.Float transparency)
transparency
- label transparencypublic Painter getBackgroundPainter()
public void setBackgroundPainter(Painter painter)
painter
- label background painterpublic java.lang.Boolean isOpaque(E c)
isOpaque
in interface Painter<E extends javax.swing.JLabel>
isOpaque
in class AbstractPainter<E extends javax.swing.JLabel>
c
- component to process
public java.awt.Insets getMargin(E label)
getMargin
in interface Painter<E extends javax.swing.JLabel>
getMargin
in class AbstractPainter<E extends javax.swing.JLabel>
label
- component to process
public void paint(java.awt.Graphics2D g2d, java.awt.Rectangle bounds, E label)
paint
in interface Painter<E extends javax.swing.JLabel>
g2d
- component graphicsbounds
- bounds for painter visual datalabel
- component to processprotected java.lang.String layout(E label, java.awt.FontMetrics fm, int width, int height)
label
- label to processfm
- label font metricswidth
- label widthheight
- label height
protected java.lang.String layoutCL(E label, java.awt.FontMetrics fm, java.lang.String text, javax.swing.Icon icon, java.awt.Rectangle viewR, java.awt.Rectangle iconR, java.awt.Rectangle textR)
label
- label to processfm
- label font metricstext
- label texticon
- label iconviewR
- rectangle limited by label insetsiconR
- icon rectangle dummytextR
- text rectangle dummy
protected void paintEnabledText(E label, java.awt.Graphics2D g2d, java.lang.String text, int textX, int textY)
label
- label to processg2d
- graphics contexttext
- label texttextX
- text X coordinatetextY
- text Y coordinateprotected void paintDisabledText(E label, java.awt.Graphics2D g2d, java.lang.String text, int textX, int textY)
label
- label to processg2d
- graphics contexttext
- label texttextX
- text X coordinatetextY
- text Y coordinateprotected void paintShadowText(java.awt.Graphics2D g2d, java.lang.String text, int textX, int textY)
g2d
- graphics contexttext
- texttextX
- text X coordinatetextY
- text Y coordinatepublic java.awt.Dimension getPreferredSize(E label)
getPreferredSize
in interface Painter<E extends javax.swing.JLabel>
getPreferredSize
in class AbstractPainter<E extends javax.swing.JLabel>
label
- component to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |