org.opensourcephysics.display
Class DrawableTextLine

java.lang.Object
  extended by org.opensourcephysics.display.TextLine
      extended by org.opensourcephysics.display.DrawableTextLine
All Implemented Interfaces:
Drawable
Direct Known Subclasses:
TitleText

public class DrawableTextLine
extends TextLine
implements Drawable

DrawableTextLine draws short Strings with subscripts and superscripts.

Version:
1.0
Author:
Wolfang Christian

Field Summary
 
Fields inherited from class org.opensourcephysics.display.TextLine
ALGEBRAIC, CENTER, LEFT, RIGHT, SCIENTIFIC
 
Constructor Summary
DrawableTextLine(java.lang.String text, double x, double y)
          Constructs a DrawableTextLine with the given text and location.
 
Method Summary
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws the TextLine.
static XML.ObjectLoader getLoader()
          Gets the XML object loader for this class.
 double getX()
          Gets the x coordinate.
 double getY()
          Gets the y coordinate.
 void setPixelXY(boolean enable)
          Sets the pixelPosition flag.
 void setTheta(double theta)
          Sets the angle.
 void setX(double x)
          Sets the x cooridinate.
 void setY(double y)
          Sets the y cooridinate.
 
Methods inherited from class org.opensourcephysics.display.TextLine
charWidth, copyState, copyState, drawText, drawText, getAscent, getBackground, getColor, getDescent, getFM, getFont, getFontName, getFontSize, getFontStyle, getHeight, getJustification, getLeading, getMaxAscent, getMaxDescent, getScriptFont, getStringBounds, getText, getWidth, isNull, log10, parseDouble, parseDouble, parseDouble, parseText, setBackground, setColor, setFont, setFontName, setFontSize, setFontStyle, setJustification, setText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableTextLine

public DrawableTextLine(java.lang.String text,
                        double x,
                        double y)
Constructs a DrawableTextLine with the given text and location.

Parameters:
text - String
x - double
y - double
Method Detail

setPixelXY

public void setPixelXY(boolean enable)
Sets the pixelPosition flag. Pixels are used to postion the object.

Parameters:
enable - boolean

setX

public void setX(double x)
Sets the x cooridinate.

Parameters:
x - double

setTheta

public void setTheta(double theta)
Sets the angle.

Parameters:
theta - double

getX

public double getX()
Gets the x coordinate.

Returns:
double

setY

public void setY(double y)
Sets the y cooridinate.

Parameters:
y - double

getY

public double getY()
Gets the y coordinate.

Returns:
double

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draws the TextLine.

Specified by:
draw in interface Drawable
Parameters:
panel - DrawingPanel
g - Graphics

getLoader

public static XML.ObjectLoader getLoader()
Gets the XML object loader for this class.

Returns:
ObjectLoader