public class Text extends Object implements Serializable
Line breaks are indicated by the newline character ('\n') within the string.
Titles are drawn relative to a reference point. Alignment determines the position of the reference point on the horizontally-aligned box that bounds the text.
Constructor and Description |
---|
Text(Format format,
double value)
Creates a text object by applying a java.text.Format
to a double.
|
Text(String string)
Construct a
Text object. |
Text(String string,
int alignment)
Construct a
Text object with specified alignment. |
Modifier and Type | Method and Description |
---|---|
int |
getAlignment()
Gets the alignment for this
Text object. |
double |
getOffset()
Returns the offset.
|
String |
getString()
Gets the string for this
Text object. |
void |
setAlignment(int alignment)
Sets the alignment for this
Text object. |
void |
setDefaultAlignment(int alignment)
Sets the alignment to use, if it has not been set using setAlignment(int).
|
void |
setDefaultOffset(double offset)
Sets the default value of the offset.
|
void |
setOffset(double offset)
Sets the offset.
|
void |
setString(String string)
Sets the string for this
Text object. |
public Text(Format format, double value)
format
- a java.text.Format
value
- the double
to which the
java.text.Format
is to be applied.public Text(String string)
Text
object.string
- a String
public Text(String string, int alignment)
Text
object with specified alignment.string
- a String
alignment
- an int
which specifies the alignment.
The alignment determines the position of the reference
point on the horizontally aligned box containing the
drawn text.
It is the bitwise combination of one of
TEXT_X_LEFT, TEXT_X_CENTER, TEXT_X_RIGHT and one of
TEXT_Y_BOTTOM, TEXT_Y_CENTER, TEXT_Y_TOP.ChartNode.TEXT_X_LEFT
,
ChartNode.TEXT_X_CENTER
,
ChartNode.TEXT_X_RIGHT
,
ChartNode.TEXT_Y_BOTTOM
,
ChartNode.TEXT_Y_CENTER
,
ChartNode.TEXT_Y_TOP
public int getAlignment()
Text
object.int
which specifies the
alignment for this Text
object.public double getOffset()
public String getString()
Text
object.String
public void setAlignment(int alignment)
Text
object.alignment
- the int
which specifies the
alignment.public void setDefaultAlignment(int alignment)
alignment
- the int
which specifies the
default alignment.public void setDefaultOffset(double offset)
public void setOffset(double offset)
public void setString(String string)
Text
object.string
- the String
Copyright © 1970-2016 Rogue Wave Software
Built May 19 2016.