| java.lang.Object org.jfree.text.TextFragment
TextFragment | public class TextFragment implements Serializable(Code) | | A text item, with an associated font, that fits on a single line (see
TextLine ). Instances of the class are immutable.
|
Method Summary | |
public float | calculateBaselineOffset(Graphics2D g2, TextAnchor anchor) Calculates the vertical offset between the baseline and the specified
text anchor.
Parameters: g2 - the graphics device. Parameters: anchor - the anchor. | public Size2D | calculateDimensions(Graphics2D g2) Calculates the dimensions of the text fragment.
Parameters: g2 - the graphics device. | public void | draw(Graphics2D g2, float anchorX, float anchorY, TextAnchor anchor, float rotateX, float rotateY, double angle) Draws the text fragment. | public boolean | equals(Object obj) Tests this instance for equality with an arbitrary object.
Parameters: obj - the object to test against (null permitted). | public float | getBaselineOffset() Returns the baseline offset. | public Font | getFont() Returns the font. | public Paint | getPaint() Returns the text paint. | public String | getText() Returns the text. | public int | hashCode() Returns a hash code for this object. |
DEFAULT_FONT | final public static Font DEFAULT_FONT(Code) | | The default font.
|
DEFAULT_PAINT | final public static Paint DEFAULT_PAINT(Code) | | The default text color.
|
logger | final protected static LogContext logger(Code) | | Access to logging facilities.
|
TextFragment | public TextFragment(String text)(Code) | | Creates a new text fragment.
Parameters: text - the text (null not permitted). |
TextFragment | public TextFragment(String text, Font font)(Code) | | Creates a new text fragment.
Parameters: text - the text (null not permitted). Parameters: font - the font (null not permitted). |
TextFragment | public TextFragment(String text, Font font, Paint paint)(Code) | | Creates a new text fragment.
Parameters: text - the text (null not permitted). Parameters: font - the font (null not permitted). Parameters: paint - the text color (null not permitted). |
TextFragment | public TextFragment(String text, Font font, Paint paint, float baselineOffset)(Code) | | Creates a new text fragment.
Parameters: text - the text (null not permitted). Parameters: font - the font (null not permitted). Parameters: paint - the text color (null not permitted). Parameters: baselineOffset - the baseline offset. |
calculateBaselineOffset | public float calculateBaselineOffset(Graphics2D g2, TextAnchor anchor)(Code) | | Calculates the vertical offset between the baseline and the specified
text anchor.
Parameters: g2 - the graphics device. Parameters: anchor - the anchor. the offset. |
calculateDimensions | public Size2D calculateDimensions(Graphics2D g2)(Code) | | Calculates the dimensions of the text fragment.
Parameters: g2 - the graphics device. The width and height of the text. |
draw | public void draw(Graphics2D g2, float anchorX, float anchorY, TextAnchor anchor, float rotateX, float rotateY, double angle)(Code) | | Draws the text fragment.
Parameters: g2 - the graphics device. Parameters: anchorX - the x-coordinate of the anchor point. Parameters: anchorY - the y-coordinate of the anchor point. Parameters: anchor - the location of the text that is aligned to the anchor point. Parameters: rotateX - the x-coordinate of the rotation point. Parameters: rotateY - the y-coordinate of the rotation point. Parameters: angle - the angle. |
equals | public boolean equals(Object obj)(Code) | | Tests this instance for equality with an arbitrary object.
Parameters: obj - the object to test against (null permitted). A boolean. |
getBaselineOffset | public float getBaselineOffset()(Code) | | Returns the baseline offset.
The baseline offset. |
getFont | public Font getFont()(Code) | | Returns the font.
The font (never null ). |
getPaint | public Paint getPaint()(Code) | | Returns the text paint.
The text paint (never null ). |
getText | public String getText()(Code) | | Returns the text.
The text (possibly null ). |
hashCode | public int hashCode()(Code) | | Returns a hash code for this object.
A hash code. |
|
|