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 intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class org.opensourcephysics.display.DrawableTextLine
pixelXYFields 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 TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws the TextLine offset from the location.voidSets the font used to display the text.voidsetLocation(int location) Sets the location of the text relative to a display area edgevoidsetOffsets(int xoff, int yoff) Sets the x and y offsets.voidSets the text to be displayed.Methods inherited from class org.opensourcephysics.display.DrawableTextLine
getLoader, getX, getY, setPixelXY, setTheta, setX, setYMethods 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, setJustificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
drawin interfaceDrawable- Overrides:
drawin classDrawableTextLine- Parameters:
panel- DrawingPanelg- Graphics
-