public class TextOutline extends ShapeAdaptor
Details:
A TextOutline
is an immutable Shape
that represents the outline of a string rendered in a specific font.
This class also encapsulates the outline's origin and rotation.
mShape
Constructor and Description |
---|
TextOutline(Font iFont,
String iText,
Point2D iOrigin,
double iRotation)
Generates text outline as TextOutline.
|
Modifier and Type | Method and Description |
---|---|
static Shape |
createShape(Font iFont,
String iText) |
static Shape |
createShape(Font iFont,
String iText,
Point2D iOrigin,
double iRotation)
Generates text outline as generic Shape.
|
Font |
getFont()
Returns font.
|
Point2D |
getOrigin()
Returns origin.
|
double |
getRotation()
Returns rotation.
|
String |
getText()
Returns text.
|
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, intersects, intersects
public TextOutline(Font iFont, String iText, Point2D iOrigin, double iRotation)
Details:
Use this constructor to generate a TextOutline
representing the given text rendered with the given rendering properties.
See the factory method createShape
for more information on how these rendering properties are used.
iFont
- the font to render the text iniText
- the text to renderiOrigin
- the text originiRotation
- the text originpublic static Shape createShape(Font iFont, String iText, Point2D iOrigin, double iRotation)
Details:
getShape
is a factory that generates a generic Shape
representing the outline of the given text rendered in the given font.
The left end of the text's baseline is the Shape
's origin, which may also be given.
(This value defaults to (0, 0) if null
.)
The text may be rotated by the given angle about the Shape
's origin.
Use this factory if you do not need the generated Shape
to be an instance of TextOutline
.
Otherwise, use the standard constructor.
iFont
- font for textiText
- text to renderiOrigin
- origin of baselineiRotation
- slant of baselinepublic Font getFont()
Details:
getFont
returns the font used for this outline, which was given in the constructor.
public String getText()
Details:
getText
returns the text represented by this outline, which was given in the constructor.
public Point2D getOrigin()
Details:
getOrigin
returns the origin of the text, which was given in the constructor.
public double getRotation()
Details:
getRotation
returns the rotation of this outline, which was given in the constructor.
Copyright © 2013. All Rights Reserved.