public abstract class AbstractTextRenderer extends java.lang.Object implements AnimationRenderer
Modifier and Type | Field and Description |
---|---|
protected java.awt.Shape[] |
cachedGlyphShapes |
protected java.awt.font.GlyphVector |
cachedGlyphVector |
protected float |
cachedTextAscent |
protected float |
cachedTextHeight |
protected float |
cachedTextWidth |
protected float |
capitalMAscent |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureValidCache(java.awt.Graphics2D g2) |
protected float |
getAdjustedAscent()
Computes and answers the text ascent using the current height mode.
|
protected float |
getAdjustedDescent()
Computes and answers the text descent using the current height mode.
|
java.awt.Color |
getColor() |
java.awt.Font |
getFont() |
HeightMode |
getHeightMode() |
java.lang.String |
getText() |
protected void |
invalidateCache()
Invalidates the cache.
|
protected boolean |
isCacheValid() |
protected void |
setCacheValid(boolean b) |
void |
setColor(java.awt.Color color) |
void |
setFont(java.awt.Font newFont)
Sets the renderer's font.
|
void |
setHeightMode(HeightMode heightMode) |
void |
setText(java.lang.String newText)
Sets the renderer's text.
|
protected void |
validateCache(java.awt.Graphics2D g2)
Validates the cache, here: creates a
GlyphVector
and computes and stores its size information. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
render
protected java.awt.font.GlyphVector cachedGlyphVector
protected java.awt.Shape[] cachedGlyphShapes
protected float cachedTextWidth
protected float cachedTextAscent
protected float cachedTextHeight
protected float capitalMAscent
public java.awt.Color getColor()
public java.awt.Font getFont()
public java.lang.String getText()
public HeightMode getHeightMode()
public void setColor(java.awt.Color color)
public void setHeightMode(HeightMode heightMode)
public void setFont(java.awt.Font newFont)
newFont
- the font to be setpublic void setText(java.lang.String newText)
newText
- the text to be setprotected float getAdjustedAscent()
getHeightMode()
protected float getAdjustedDescent()
getHeightMode()
protected boolean isCacheValid()
protected void setCacheValid(boolean b)
protected void ensureValidCache(java.awt.Graphics2D g2)
protected void validateCache(java.awt.Graphics2D g2)
GlyphVector
and computes and stores its size information.g2
- the Graphics object used to get the font render contextprotected void invalidateCache()
Copyright © 2001-2011 JGoodies Karsten Lentzsch. All Rights Reserved.