org.opensourcephysics.display
Class TextBox
java.lang.Object
org.opensourcephysics.display.TextBox
- All Implemented Interfaces:
- Drawable
public class TextBox
- extends java.lang.Object
- implements Drawable
Constructor Summary |
TextBox()
Constructor TextBox |
TextBox(java.lang.String str)
Constructor TextBox |
Method Summary |
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws a representation of an object in a drawing panel. |
void |
resetBoxSize()
|
void |
setText(java.lang.String _text)
|
void |
setText(java.lang.String _text,
double _x,
double _y)
|
void |
setXY(double _x,
double _y)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COORDINATE_PLACEMENT
public static final int COORDINATE_PLACEMENT
- See Also:
- Constant Field Values
PIXEL_PLACEMENT
public static final int PIXEL_PLACEMENT
- See Also:
- Constant Field Values
RELATIVE_PLACEMENT
public static final int RELATIVE_PLACEMENT
- See Also:
- Constant Field Values
BOTTOM_LEFT_PLACEMENT
public static final int BOTTOM_LEFT_PLACEMENT
- See Also:
- Constant Field Values
TOP_LEFT_PLACEMENT
public static final int TOP_LEFT_PLACEMENT
- See Also:
- Constant Field Values
BOTTOM_RIGHT_PLACEMENT
public static final int BOTTOM_RIGHT_PLACEMENT
- See Also:
- Constant Field Values
TOP_RIGHT_PLACEMENT
public static final int TOP_RIGHT_PLACEMENT
- See Also:
- Constant Field Values
BOTTOM_LEFT_GUTTER_PLACEMENT
public static final int BOTTOM_LEFT_GUTTER_PLACEMENT
- See Also:
- Constant Field Values
TOP_LEFT_GUTTER_PLACEMENT
public static final int TOP_LEFT_GUTTER_PLACEMENT
- See Also:
- Constant Field Values
BOTTOM_RIGHT_GUTTER_PLACEMENT
public static final int BOTTOM_RIGHT_GUTTER_PLACEMENT
- See Also:
- Constant Field Values
TOP_RIGHT_GUTTER_PLACEMENT
public static final int TOP_RIGHT_GUTTER_PLACEMENT
- See Also:
- Constant Field Values
TOP_RIGHT_ALIGNMENT
public static final int TOP_RIGHT_ALIGNMENT
- See Also:
- Constant Field Values
TOP_CENTER_ALIGNMENT
public static final int TOP_CENTER_ALIGNMENT
- See Also:
- Constant Field Values
placement_mode
public int placement_mode
alignment_mode
public int alignment_mode
xoffset
public int xoffset
yoffset
public int yoffset
text
protected java.lang.String text
font
protected java.awt.Font font
fontname
protected java.lang.String fontname
fontsize
protected int fontsize
fontstyle
protected int fontstyle
color
protected java.awt.Color color
x
protected double x
y
protected double y
xpix
protected int xpix
ypix
protected int ypix
boxHeight
protected int boxHeight
boxWidth
protected int boxWidth
TextBox
public TextBox()
- Constructor TextBox
TextBox
public TextBox(java.lang.String str)
- Constructor TextBox
- Parameters:
str
-
setXY
public void setXY(double _x,
double _y)
setText
public void setText(java.lang.String _text)
setText
public void setText(java.lang.String _text,
double _x,
double _y)
resetBoxSize
public void resetBoxSize()
draw
public void draw(DrawingPanel panel,
java.awt.Graphics g)
- Description copied from interface:
Drawable
- Draws a representation of an object in a drawing panel.
- Specified by:
draw
in interface Drawable