Package org.opensourcephysics.display
Class DrawableTextLine
java.lang.Object
org.opensourcephysics.display.TextLine
org.opensourcephysics.display.DrawableTextLine
- All Implemented Interfaces:
Drawable
- Direct Known Subclasses:
TitleText
DrawableTextLine draws short Strings with subscripts and superscripts.
- Version:
- 1.0
- Author:
- Wolfgang Christian
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A class to save and load InteractiveArrow in an XMLControl. -
Field Summary
FieldsFields inherited from class org.opensourcephysics.display.TextLine
ALGEBRAIC, ascent, background, CENTER, color, descent, font, fontname, fontsize, fontstyle, height, justification, leading, LEFT, lg, list, maxAscent, maxDescent, parse, RIGHT, SCIENTIFIC, script_fraction, sub_offset, sup_offset, text, trTL, width
-
Constructor Summary
ConstructorsConstructorDescriptionDrawableTextLine
(String text, double x, double y) Constructs a DrawableTextLine with the given text and location. -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(DrawingPanel panel, Graphics g) Draws the TextLine.static XML.ObjectLoader
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 coordinate.void
setY
(double y) Sets the y coordinate.Methods inherited from class org.opensourcephysics.display.TextLine
charWidth, copyState, copyState, drawRotatedText, drawText, drawText, drawTextImageRotated, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Field Details
-
pixelXY
protected boolean pixelXY
-
-
Constructor Details
-
DrawableTextLine
Constructs a DrawableTextLine with the given text and location.- Parameters:
text
- Stringx
- doubley
- double
-
-
Method Details
-
setPixelXY
public void setPixelXY(boolean enable) Sets the pixelPosition flag. Pixels are used to position the object.- Parameters:
enable
- boolean
-
setX
public void setX(double x) Sets the x coordinate.- 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 coordinate.- Parameters:
y
- double
-
getY
public double getY()Gets the y coordinate.- Returns:
- double
-
draw
Draws the TextLine. -
getLoader
Gets the XML object loader for this class.- Returns:
- ObjectLoader
-