org.opensourcephysics.display
Class TextBox

java.lang.Object
  extended by org.opensourcephysics.display.TextBox
All Implemented Interfaces:
Drawable

public class TextBox
extends java.lang.Object
implements Drawable


Field Summary
 int alignment_mode
           
static int BOTTOM_LEFT_GUTTER_PLACEMENT
           
static int BOTTOM_LEFT_PLACEMENT
           
static int BOTTOM_RIGHT_GUTTER_PLACEMENT
           
static int BOTTOM_RIGHT_PLACEMENT
           
protected  int boxHeight
           
protected  int boxWidth
           
protected  java.awt.Color color
           
static int COORDINATE_PLACEMENT
           
protected  java.awt.Font font
           
protected  java.lang.String fontname
           
protected  int fontsize
           
protected  int fontstyle
           
static int PIXEL_PLACEMENT
           
 int placement_mode
           
static int RELATIVE_PLACEMENT
           
protected  java.lang.String text
           
static int TOP_CENTER_ALIGNMENT
           
static int TOP_LEFT_GUTTER_PLACEMENT
           
static int TOP_LEFT_PLACEMENT
           
static int TOP_RIGHT_ALIGNMENT
           
static int TOP_RIGHT_GUTTER_PLACEMENT
           
static int TOP_RIGHT_PLACEMENT
           
protected  double x
           
 int xoffset
           
protected  int xpix
           
protected  double y
           
 int yoffset
           
protected  int ypix
           
 
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
 

Field Detail

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
Constructor Detail

TextBox

public TextBox()
Constructor TextBox


TextBox

public TextBox(java.lang.String str)
Constructor TextBox

Parameters:
str -
Method Detail

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