public class TextPainter<T> extends AbstractAreaPainter<T>
AbstractAreaPainter.StyleAbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignmentAbstractPainter.Interpolation| Constructor and Description |
|---|
TextPainter()
Creates a new instance of TextPainter
|
TextPainter(java.lang.String text)
Create a new TextPainter which will paint the specified text
|
TextPainter(java.lang.String text,
java.awt.Font font)
Create a new TextPainter which will paint the specified text with the specified font.
|
TextPainter(java.lang.String text,
java.awt.Font font,
java.awt.Paint paint)
Create a new TextPainter which will paint the specified text with the specified font and paint.
|
TextPainter(java.lang.String text,
java.awt.Paint paint)
Create a new TextPainter which will paint the specified text with the specified paint.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doPaint(java.awt.Graphics2D g,
T component,
int width,
int height)
Subclasses must implement this method and perform custom painting operations
here.
|
java.awt.Font |
getFont()
gets the font (and font size and style) to be used when drawing the text
|
java.lang.String |
getText()
gets the text currently used to draw
|
protected java.awt.Shape |
provideShape(java.awt.Graphics2D g2,
T comp,
int width,
int height)
Returns the outline shape of this painter.
|
void |
setFont(java.awt.Font f)
Set the font (and font size and style) to be used when drawing the text
|
void |
setText(java.lang.String text)
Sets the text to draw
|
getAreaEffects, getBorderPaint, getBorderWidth, getFillPaint, getStyle, isPaintStretched, setAreaEffects, setBorderPaint, setBorderWidth, setFillPaint, setPaintStretched, setStylecalculateLayout, getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignmentclearCache, configureGraphics, getFilters, getInterpolation, isAntialiasing, isCacheable, isDirty, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInterpolation, setVisible, shouldUseCache, validateaddPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListenerpublic TextPainter()
public TextPainter(java.lang.String text)
text - the text to paintpublic TextPainter(java.lang.String text,
java.awt.Font font)
text - the text to paintfont - the font to paint the text withpublic TextPainter(java.lang.String text,
java.awt.Paint paint)
text - the text to paintpaint - the paint to paint withpublic TextPainter(java.lang.String text,
java.awt.Font font,
java.awt.Paint paint)
text - the text to paintfont - the font to paint the text withpaint - the paint to paint withpublic void setFont(java.awt.Font f)
f - the new fontpublic java.awt.Font getFont()
public void setText(java.lang.String text)
text - the text to drawpublic java.lang.String getText()
protected void doPaint(java.awt.Graphics2D g,
T component,
int width,
int height)
doPaint in class AbstractPainter<T>g - The Graphics2D object in which to paintprotected java.awt.Shape provideShape(java.awt.Graphics2D g2,
T comp,
int width,
int height)
provideShape in class AbstractAreaPainter<T>g2 - graphicscomp - The Object this painter will be painted on.width - the width to paintheight - the height to paint