JMSLTM Numerical Library 4.0

com.imsl.chart
Class Text

java.lang.Object
  extended bycom.imsl.chart.Text
All Implemented Interfaces:
Serializable

public class Text
extends Object
implements Serializable

The value of the attribute "Title". A Title is a multi-line string with alignment information.

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.

See Also:
Serialized Form

Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Text

public Text(Format format,
            double value)
Creates a text object by applying a java.text.Format to a double.

Parameters:
format - a java.text.Format
value - the double to which the java.text.Format is to be applied.

Text

public Text(String string)
Construct a Text object.

Parameters:
string - a String

Text

public Text(String string,
            int alignment)
Construct a Text object with specified alignment.

Parameters:
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.
See Also:
ChartNode.TEXT_X_LEFT, ChartNode.TEXT_X_CENTER, ChartNode.TEXT_X_RIGHT, ChartNode.TEXT_Y_BOTTOM, ChartNode.TEXT_Y_CENTER, ChartNode.TEXT_Y_TOP
Method Detail

getAlignment

public int getAlignment()
Gets the alignment for this Text object.

Returns:
the int which specifies the alignment for this Text object.

getOffset

public double getOffset()
Returns the offset.


getString

public String getString()
Gets the string for this Text object.

Returns:
the String

setAlignment

public void setAlignment(int alignment)
Sets the alignment for this Text object.

Parameters:
alignment - the int which specifies the alignment.

setDefaultAlignment

public void setDefaultAlignment(int alignment)
Sets the alignment to use, if it has not been set using setAlignment(int).

Parameters:
alignment - the int which specifies the default alignment.

setDefaultOffset

public void setDefaultOffset(double offset)
Sets the default value of the offset. Offset is in units of the default marker size. Text drawn is offset in the direction of the alignment.


setOffset

public void setOffset(double offset)
Sets the offset. Offset is in units of the default marker size. Text drawn is offset in the direction of the alignment.


setString

public void setString(String string)
Sets the string for this Text object.

Parameters:
string - the String

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.