|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jCharts.chartText.TextTag
public class TextTag
Field Summary | |
---|---|
private Hashtable |
attributes
|
private Font |
derivedFont
|
private Font |
font
|
private float |
fontAscent
|
private float |
fontDescent
|
private float |
height
|
private boolean |
isDerived
|
private boolean |
isHidden
|
private String |
text
|
private TextLayout |
textLayout
|
private float |
width
|
private float |
xPosition
|
private float |
yPosition
|
Constructor Summary | |
---|---|
TextTag(String text,
Font baseFont,
Font derivedFont,
FontRenderContext fontRenderContext)
Constructor when using transformed (derived) fonts The need for this arises because the java metrics classes return either 0 or very strange values for the width and height of a string (TextLayout, LineMetrics, etc..) when the font is derived |
|
TextTag(String text,
Font baseFont,
FontRenderContext fontRenderContext)
Default constructor - for untransformed fonts. |
Method Summary | |
---|---|
void |
addAttribute(String name,
Object o)
|
Object |
getAttribute(String name)
|
float |
getBottomSide()
|
float |
getFontAscent()
|
float |
getFontDescent()
|
float |
getHeight()
|
boolean |
getHidden()
|
Rectangle2D.Float |
getRectangle()
|
float |
getRightSide()
|
String |
getText()
|
float |
getWidth()
|
float |
getXPosition()
|
float |
getYPosition()
|
void |
render(Graphics2D g2d,
float x,
float y)
Renders the text, at the position - renders from the top (instead of baseline) |
void |
render(Graphics2D g2d,
Paint fontColor)
Renders the text, at the position - renders from the top (instead of baseline) |
void |
setHidden(boolean b)
|
void |
setPosition(float x,
float y)
|
void |
setXPosition(float x)
|
void |
setYPosition(float y)
|
void |
toHTML(HTMLGenerator htmlGenerator)
Enables the testing routines to display the contents of this Object. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private float xPosition
private float yPosition
private TextLayout textLayout
private Hashtable attributes
private boolean isHidden
private float width
private float height
private float fontAscent
private float fontDescent
private boolean isDerived
private Font derivedFont
private String text
private Font font
Constructor Detail |
---|
public TextTag(String text, Font baseFont, FontRenderContext fontRenderContext)
public TextTag(String text, Font baseFont, Font derivedFont, FontRenderContext fontRenderContext)
text
- baseFont
- is the original (untransformed) font.derivedFont
- is the transformed fontfontRenderContext
- Method Detail |
---|
public float getWidth()
public float getHeight()
public float getFontAscent()
public float getFontDescent()
public void setPosition(float x, float y)
public void setXPosition(float x)
public void setYPosition(float y)
public float getXPosition()
public float getYPosition()
public float getRightSide()
public float getBottomSide()
public Rectangle2D.Float getRectangle()
public void setHidden(boolean b)
public boolean getHidden()
public String getText()
public void addAttribute(String name, Object o)
public Object getAttribute(String name)
public void render(Graphics2D g2d, Paint fontColor)
g2d
- fontColor
- public void render(Graphics2D g2d, float x, float y)
g2d
- public void toHTML(HTMLGenerator htmlGenerator)
toHTML
in interface HTMLTestable
htmlGenerator
- public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |