Package org.opensourcephysics.display
Class TitleText
java.lang.Object
org.opensourcephysics.display.TextLine
org.opensourcephysics.display.DrawableTextLine
org.opensourcephysics.display.TitleText
- All Implemented Interfaces:
Drawable
A text line that is offset relative to a drawing panel's display area.
- Version:
- 1.0
- Author:
- Wolfgang Christian
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.display.DrawableTextLine
DrawableTextLine.DrawableTextLineLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class org.opensourcephysics.display.DrawableTextLine
pixelXY
Fields inherited from class org.opensourcephysics.display.TextLine
ALGEBRAIC, ascent, background, color, descent, font, fontname, fontsize, fontstyle, height, justification, leading, lg, list, maxAscent, maxDescent, parse, SCIENTIFIC, script_fraction, sub_offset, sup_offset, text, trTL, width
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(DrawingPanel panel, Graphics g) Draws the TextLine offset from the location.void
Sets the font used to display the text.void
setLocation
(int location) Sets the location of the text relative to a display area edgevoid
setOffsets
(int xoff, int yoff) Sets the x and y offsets.void
Sets the text to be displayed.Methods inherited from class org.opensourcephysics.display.DrawableTextLine
getLoader, getX, getY, setPixelXY, setTheta, setX, setY
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, setFontName, setFontSize, setFontStyle, setJustification
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
-
CENTER
public static final int CENTER- See Also:
-
BOTTOM
public static final int BOTTOM- See Also:
-
LEFT
public static final int LEFT- See Also:
-
TOP
public static final int TOP- See Also:
-
RIGHT
public static final int RIGHT- See Also:
-
CUSTOM
public static final int CUSTOM- See Also:
-
-
Constructor Details
-
TitleText
TitleText draws a TextLine relative to a drawing panel's edge.- Parameters:
text
- String
-
-
Method Details
-
setOffsets
public void setOffsets(int xoff, int yoff) Sets the x and y offsets.- Parameters:
xoff
- doubleyoff
- double
-
setLocation
public void setLocation(int location) Sets the location of the text relative to a display area edge- Parameters:
location
- int
-
setFont
Sets the font used to display the text. -
setText
Sets the text to be displayed. -
draw
Draws the TextLine offset from the location.- Specified by:
draw
in interfaceDrawable
- Overrides:
draw
in classDrawableTextLine
- Parameters:
panel
- DrawingPanelg
- Graphics
-