public class TextGlyph extends Glyph
Modifier and Type | Field and Description |
---|---|
static boolean |
debug |
_transform, HIGHLIGHT, HIGHLIGHT_FACTOR
Constructor and Description |
---|
TextGlyph(java.lang.String text)
Create glyph with given text.
|
TextGlyph(java.lang.String text,
int size)
Create glyph with given text and font size.
|
TextGlyph(java.lang.String text,
int size,
java.lang.String font)
Create glyph with given text, font size, and font family.
|
TextGlyph(java.lang.String text,
int size,
java.lang.String font,
java.awt.Color color)
Create glyph with given text, font size, font family, and text color.
|
TextGlyph(TextGlyph copy) |
Modifier and Type | Method and Description |
---|---|
void |
alignBottom(java.awt.geom.Rectangle2D bounds) |
void |
alignCenter(java.awt.geom.Rectangle2D bounds) |
void |
alignLeft(java.awt.geom.Rectangle2D bounds) |
void |
alignOnTop(java.awt.geom.Rectangle2D bounds) |
void |
alignRight(java.awt.geom.Rectangle2D bounds) |
void |
alignToDotPoint(java.awt.geom.Point2D point,
int dotCode) |
void |
alignTop(java.awt.geom.Rectangle2D bounds) |
void |
alignToPoint(java.awt.geom.Point2D point) |
java.lang.String |
getFont() |
int |
getFontsize() |
java.lang.String |
getText() |
java.awt.Color |
getTextColor() |
void |
paint(java.awt.Graphics2D g2d) |
void |
setFont(java.lang.String font) |
void |
setFontsize(int fontsize) |
void |
setSize(int size)
Deprecated.
Use
setFontsize(int) instead. |
void |
setText(java.lang.String text) |
void |
setText(java.lang.String text,
int size) |
void |
setTextColor(java.awt.Color textColor) |
java.lang.String |
toString() |
void |
updateText(java.lang.String text) |
getBorder, getBounds, getFill, getHighlighted, getShape, getStroke, inside, intersects, setBorder, setColor, setFill, setGlyph, setHighlighted, setShape, setStroke, transform
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, rotate, rotate, scale, setKeyAction, setMouseAction, shear, translate, unsetMouseAction
_getAttribute, _setAttribute, getAttribute, getAttributeAsBoolean, getAttributeAsByte, getAttributeAsChar, getAttributeAsClosure, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsShort, getAttributeAsString, getKeys, getStaticAttribute, getStaticKeys, isAttribute, isStaticAttribute, removeAllAttributes, removeAllStaticAttributes, removeAttribute, removeStaticAttribute, setAttribute, setStaticAttribute, showAttributes, showAttributes
public TextGlyph(TextGlyph copy)
public TextGlyph(java.lang.String text)
text
- Text to be displayedpublic TextGlyph(java.lang.String text, int size)
text
- Text to be displayedsize
- Font size to be usedpublic TextGlyph(java.lang.String text, int size, java.lang.String font)
text
- Text to be displayedsize
- Font size to be usedfont
- Name of font familypublic TextGlyph(java.lang.String text, int size, java.lang.String font, java.awt.Color color)
text
- Text to be displayedsize
- Font size to be usedfont
- Name of font familycolor
- Text colorpublic void setText(java.lang.String text)
public void setText(java.lang.String text, int size)
public java.lang.String getText()
public void updateText(java.lang.String text)
public void setFontsize(int fontsize)
public int getFontsize()
public void setFont(java.lang.String font)
public java.lang.String getFont()
public void setSize(int size)
setFontsize(int)
instead.size
- the new font size to usepublic void setTextColor(java.awt.Color textColor)
public java.awt.Color getTextColor()
public void alignCenter(java.awt.geom.Rectangle2D bounds)
public void alignLeft(java.awt.geom.Rectangle2D bounds)
public void alignRight(java.awt.geom.Rectangle2D bounds)
public void alignTop(java.awt.geom.Rectangle2D bounds)
public void alignOnTop(java.awt.geom.Rectangle2D bounds)
public void alignBottom(java.awt.geom.Rectangle2D bounds)
public void alignToPoint(java.awt.geom.Point2D point)
public void alignToDotPoint(java.awt.geom.Point2D point, int dotCode)