visad
Class PlotText

java.lang.Object
  extended by visad.PlotText

public class PlotText
extends java.lang.Object

PlotText calculates an array of points to be plotted to the screen as vector pairs, given a String and location, orientation and size in space.

The font is a simple one, and includes characters from the ASCII collating sequence from 0x20 thru 0x7E. Most of this was taken from the original visad.PlotText.


Constructor Summary
PlotText()
           
 
Method Summary
static VisADTriangleArray render_font(java.lang.String str, java.awt.Font font, double[] start, double[] base, double[] up, boolean center)
          Convert a string of characters (ASCII collating sequence) into a series of triangles for drawing.
static VisADTriangleArray render_font(java.lang.String str, java.awt.Font font, double[] start, double[] base, double[] up, TextControl.Justification justification)
          Convert a string of characters (ASCII collating sequence) into a series of triangles for drawing.
static VisADLineArray render_font(java.lang.String str, HersheyFont font, double[] start, double[] base, double[] up, boolean center)
          Convert a string of characters (ASCII collating sequence) into a series of lines for drawing.
static VisADLineArray render_font(java.lang.String str, HersheyFont font, double[] start, double[] base, double[] up, TextControl.Justification justification)
          Convert a string of characters (ASCII collating sequence) into a series of lines for drawing.
static VisADLineArray render_label(int axis, double pos, java.lang.String str, int line, long c)
          Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.
static VisADLineArray render_label(java.lang.String str, double[] start, double[] base, double[] up, boolean center)
          Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.
static VisADLineArray render_label(java.lang.String str, double[] start, double[] base, double[] up, TextControl.Justification justification)
          Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.
static java.lang.String shortString(double val)
          make a short string for value for use in slider label
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotText

public PlotText()
Method Detail

render_label

public static VisADLineArray render_label(int axis,
                                          double pos,
                                          java.lang.String str,
                                          int line,
                                          long c)
Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.

Parameters:
axis - [=0 (x), =1 (y), or =2 (z)
pos - position along axis to put label in [-1,1]
str - the text string to "print"
line - line number for multi-line text (0 = first line)
c - color (not used yet)
Returns:
VisADLineArray of all the vectors needed to draw the characters in this string

render_label

public static VisADLineArray render_label(java.lang.String str,
                                          double[] start,
                                          double[] base,
                                          double[] up,
                                          boolean center)
Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.

Parameters:
str - String to use
start - point (x,y,z)
base - (x,y,z) of baseline vector
up - (x,y,z) of "up" direction vector
center - is true if string is to be centered
Returns:
VisADLineArray of all the vectors needed to draw the characters in this string

render_label

public static VisADLineArray render_label(java.lang.String str,
                                          double[] start,
                                          double[] base,
                                          double[] up,
                                          TextControl.Justification justification)
Convert a string of characters (ASCII collating sequence) into a series of vectors for drawing.

Parameters:
str - String to use
start - point (x,y,z)
base - (x,y,z) of baseline vector
up - (x,y,z) of "up" direction vector
justification - is one of:
  • TextControl.Justification.LEFT - Left justified text (ie: normal text)
  • TextControl.Justification.CENTER - Centered text
  • TextControl.Justification.RIGHT - Right justified text
Returns:
VisADLineArray of all the vectors needed to draw the characters in this string

shortString

public static java.lang.String shortString(double val)
make a short string for value for use in slider label


render_font

public static VisADLineArray render_font(java.lang.String str,
                                         HersheyFont font,
                                         double[] start,
                                         double[] base,
                                         double[] up,
                                         boolean center)
Convert a string of characters (ASCII collating sequence) into a series of lines for drawing.

Parameters:
str - String to use
font - non-null HersheyFont font
start - point (x,y,z)
base - (x,y,z) of baseline vector
up - (x,y,z) of "up" direction vector
center - is true if string is to be centered
Returns:
VisADLineArray of all the lines needed to draw the characters in this string

render_font

public static VisADLineArray render_font(java.lang.String str,
                                         HersheyFont font,
                                         double[] start,
                                         double[] base,
                                         double[] up,
                                         TextControl.Justification justification)
Convert a string of characters (ASCII collating sequence) into a series of lines for drawing.

Parameters:
str - String to use
font - non-null HersheyFont name ?param start ?param base ?param up
justification - is one of:
  • TextControl.Justification.LEFT - Left justified text (ie: normal text)
  • TextControl.Justification.CENTER - Centered text
  • TextControl.Justification.RIGHT - Right justified text
Returns:
VisADLineArray of all the lines needed to draw the characters in this string

render_font

public static VisADTriangleArray render_font(java.lang.String str,
                                             java.awt.Font font,
                                             double[] start,
                                             double[] base,
                                             double[] up,
                                             boolean center)
Convert a string of characters (ASCII collating sequence) into a series of triangles for drawing.

Parameters:
str - String to use
font - non-null font
start - point (x,y,z)
base - (x,y,z) of baseline vector
up - (x,y,z) of "up" direction vector
center - is true if string is to be centered
Returns:
VisADTriangleArray of all the triangles needed to draw the characters in this string

render_font

public static VisADTriangleArray render_font(java.lang.String str,
                                             java.awt.Font font,
                                             double[] start,
                                             double[] base,
                                             double[] up,
                                             TextControl.Justification justification)
Convert a string of characters (ASCII collating sequence) into a series of triangles for drawing.

Parameters:
str - String to use
font - non-null font ?param start ?param base ?param up
justification - is one of:
  • TextControl.Justification.LEFT - Left justified text (ie: normal text)
  • TextControl.Justification.CENTER - Centered text
  • TextControl.Justification.RIGHT - Right justified text
Returns:
VisADTriangleArray of all the triangles needed to draw the characters in this string