goText
Class GoText

java.lang.Object
  |
  +--goText.GoText

public class GoText
extends java.lang.Object


Field Summary
static int CENTER_BOTTOM
           
static int CENTER_CENTER
           
static int CENTER_TOP
           
static int LEFT_BOTTOM
           
static int LEFT_CENTER
           
static int LEFT_TOP
           
static int MODE_2D
           
static int MODE_3D
           
static int RIGHT_BOTTOM
           
static int RIGHT_CENTER
           
static int RIGHT_TOP
           
 
Constructor Summary
GoText(double xPosition, double yPosition, double zPosition, double xPath, double yPath, double zPath, double xUp, double yUp, double zUp, double xScale, double yScale, int alignment, GoFont font, java.lang.String text)
          3D Text string constructor.
GoText(double xPosition, double yPosition, double zPosition, double xPath, double yPath, double xScale, double yScale, int alignment, GoFont font, java.lang.String text)
          2D Text string constructor.
 
Method Summary
 void alignment(int alignment)
          Set the text alignment.
 void font(GoFont font)
          Set the text font type.
 void mode(int mode)
          Set the text mode.
 void path(double x, double y)
          Set the horizontal text alignment.
 void path(double x, double y, double z)
          Set the horizontal text alignment.
 void position(double x, double y, double z)
          Set the relative text coordinate position.
 void render(Go go)
          Render the text.
 void scale(double x, double y)
          Set the text's horizontal and vertical scales.
 void text(java.lang.String text)
          Set the text string.
 void up(double x, double y, double z)
          Set the vertical text alignment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_2D

public static final int MODE_2D

MODE_3D

public static final int MODE_3D

LEFT_BOTTOM

public static final int LEFT_BOTTOM

CENTER_BOTTOM

public static final int CENTER_BOTTOM

RIGHT_BOTTOM

public static final int RIGHT_BOTTOM

LEFT_CENTER

public static final int LEFT_CENTER

CENTER_CENTER

public static final int CENTER_CENTER

RIGHT_CENTER

public static final int RIGHT_CENTER

LEFT_TOP

public static final int LEFT_TOP

CENTER_TOP

public static final int CENTER_TOP

RIGHT_TOP

public static final int RIGHT_TOP
Constructor Detail

GoText

public GoText(double xPosition,
              double yPosition,
              double zPosition,
              double xPath,
              double yPath,
              double zPath,
              double xUp,
              double yUp,
              double zUp,
              double xScale,
              double yScale,
              int alignment,
              GoFont font,
              java.lang.String text)
3D Text string constructor.

This constructor will create a text string placed in a three dimentional scene. Creating text with this constructor will set the text's mode value to MODE_3D (see mode).

Creates a new text string, based on the font type, at position (xPosition, yPosition, zPosition). The text will have a horizontal alignment indicated by (xPath, yPath, zPath) and a vertical alignment indicated by (xUp, yUp, zUp). The horizontal and vertical scale of the text is controlled with xScale and yScale, respectively. The text alignment is specified as a HORIZONTAL_VERTICAL alignment relative to the text's position value; possible values include

  • LEFT_BOTTOM
  • CENTER_BOTTOM
  • RIGHT_BOTTOM
  • LEFT_CENTER
  • CENTER_CENTER
  • RIGHT_CENTER
  • LEFT_TOP
  • CENTER_TOP
  • RIGHT_TOP

GoText

public GoText(double xPosition,
              double yPosition,
              double zPosition,
              double xPath,
              double yPath,
              double xScale,
              double yScale,
              int alignment,
              GoFont font,
              java.lang.String text)
2D Text string constructor.

This constructor will create a text string positioned at a specified three dimensional coordinate position, but the text will always be drawn flat (2D) relative to the screen. Creating text with this constructor will set the text's mode value to MODE_2D (see mode).

Creates a new text string, based on the font type, at position (xPosition, yPosition, zPosition). The text will have a horizontal alignment indicated by (xPath, yPath). The horizontal and vertical scale of the text is controlled with xScale and yScale, respectively. The text alignment is specified as a HORIZONTAL_VERTICAL alignment relative to the text's position value; possible values include

  • LEFT_BOTTOM
  • CENTER_BOTTOM
  • RIGHT_BOTTOM
  • LEFT_CENTER
  • CENTER_CENTER
  • RIGHT_CENTER
  • LEFT_TOP
  • CENTER_TOP
  • RIGHT_TOP
Method Detail

render

public void render(Go go)
Render the text.

Current text is rendered in context go.


mode

public void mode(int mode)
Set the text mode.

The text mode is set to one of

MODE_2D
This text mode positions the text in a three dimensional scene, but the text will always be drawn flat (2D) relative to the screen. The text is drawn according to the specified horizontal alignment. When text is drawn in this mode, the vertical alignment of the text is automatically calculated relative to the screen. The horizontal alignment can be reset with path().
MODE_3D
This text mode positions the text in a three dimensional scene and draws the text according to the specified horizontal and vertical alignments. The horizontal and vertical alignments can be reset with path() and up(), respectively.

position

public void position(double x,
                     double y,
                     double z)
Set the relative text coordinate position.

Location of text is set to (x, y, z).


path

public void path(double x,
                 double y,
                 double z)
Set the horizontal text alignment.

Horizontal alignment of text is set to the vector (x, y, z).

NOTE: This method is used when the text mode is set to MODE_3D (see mode).


up

public void up(double x,
               double y,
               double z)
Set the vertical text alignment.

Vertical alignment of text is set to the vector (x, y, z).

NOTE: This method is used when the text mode is set to MODE_3D (see mode).


path

public void path(double x,
                 double y)
Set the horizontal text alignment.

Horizontal alignment of text is set to the vector (x, y).

NOTE: This method is used when the text mode is set to MODE_2D (see mode).


scale

public void scale(double x,
                  double y)
Set the text's horizontal and vertical scales.

Horizontal and vertical scales are set to a multiple of x and y, respectively.


alignment

public void alignment(int alignment)
Set the text alignment.

The alignment value is sepcified as a HORIZONTAL_VERTICAL position relative to the location value. Possible values include

  • LEFT_BOTTOM
  • CENTER_BOTTOM
  • RIGHT_BOTTOM
  • LEFT_CENTER
  • CENTER_CENTER
  • RIGHT_CENTER
  • LEFT_TOP
  • CENTER_TOP
  • RIGHT_TOP

font

public void font(GoFont font)
Set the text font type.

Font type of text is set to font.


text

public void text(java.lang.String text)
Set the text string.

Text string is set to text.