org.opensourcephysics.drawing3d
Class ElementText

java.lang.Object
  extended by org.opensourcephysics.drawing3d.Element
      extended by org.opensourcephysics.drawing3d.ElementText
All Implemented Interfaces:
InteractionSource

public class ElementText
extends Element

Title: ElementText

Version:
August 2009
Author:
Francisco Esquembre, Carlos Jara Bravo (CJB)

Field Summary
 
Fields inherited from class org.opensourcephysics.drawing3d.Element
CHANGE_COLOR, CHANGE_GROUP, CHANGE_INTERACTION_POINTS, CHANGE_NONE, CHANGE_POSITION, CHANGE_POSITION_AND_SIZE, CHANGE_PROJECTION, CHANGE_RESOLUTION, CHANGE_SHAPE, CHANGE_SIZE, CHANGE_TRANSFORMATION, CHANGE_VISIBILITY, STD_CENTERED_END, STD_CENTERED_ORIGIN, STD_END, STD_ORIGIN, TARGET_POSITION, TARGET_SIZE, TO_RADIANS, X_UNIT_VECTOR, Y_UNIT_VECTOR, Z_UNIT_VECTOR
 
Constructor Summary
ElementText()
           
 
Method Summary
 double getDiagonalSize()
          Returns the diagonal size of the element, i.e., Math.sqrt(sizeX*sizeX+sizeY*sizeY+sizeZ*sizeZ)
 java.awt.Font getFont()
          Gets the font of the text
 double getRotationAngle()
          Gets the rotationangle of the text
 java.lang.String getText()
          Gets the text displayed
 TextLine getTextLine()
          Returns the TextLine object of the element
 boolean isTrueSize()
          Get whether the size should be that prescribed by the font
 void setFont(java.awt.Font _font)
          Sets the font for the text
 void setRotationAngle(double _angle)
          Sets the rotation angle of the text
 void setSizeX(double _sizeX)
          Sets the size along the X axis
 void setSizeY(double _sizeY)
          Sets the size along the Y axis
 void setSizeZ(double _sizeZ)
          Sets the size along the Z axis
 void setText(java.lang.String _text)
          Sets the text to be displayed
 void setTrueSize(boolean _s)
          Set whether the size should be that prescribed by the font
 
Methods inherited from class org.opensourcephysics.drawing3d.Element
addChange, addInteractionListener, addSecondaryTransformation, addSecondaryTransformation, addSecondaryTransformations, getCanBeMeasured, getDataObject, getGroup, getHotSpot, getImplementingObject, getInteractionTarget, getName, getPanel, getPosition, getPreviousImplementingObject, getScaledPosition, getScaledSize, getSecondaryTransformations, getSize, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, hasChanged, isEnabled, isVisible, processChanges, removeAllSecondaryTransformations, removeInteractionListener, removePanel, removeSecondaryTransformation, setCanBeMeasured, setDataObject, setEnabled, setName, setPanel, setPosition, setSize, setSizeXYZ, setTransformation, setVisible, setX, setXYZ, setY, setZ, sizeAndToSpaceFrame, styleChanged, toBodyFrame, toSpaceFrame
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementText

public ElementText()
Method Detail

setText

public void setText(java.lang.String _text)
Sets the text to be displayed

Parameters:
_text - the String

getText

public java.lang.String getText()
Gets the text displayed


setFont

public void setFont(java.awt.Font _font)
Sets the font for the text

Parameters:
_font - Font

getFont

public java.awt.Font getFont()
Gets the font of the text

Returns:
Font

setRotationAngle

public void setRotationAngle(double _angle)
Sets the rotation angle of the text

Parameters:
_angle - double

getRotationAngle

public double getRotationAngle()
Gets the rotationangle of the text

Returns:
Font

setTrueSize

public void setTrueSize(boolean _s)
Set whether the size should be that prescribed by the font

Parameters:
_s - boolean

isTrueSize

public boolean isTrueSize()
Get whether the size should be that prescribed by the font

Returns:
boolean

setSizeX

public void setSizeX(double _sizeX)
Description copied from class: Element
Sets the size along the X axis

Overrides:
setSizeX in class Element
Parameters:
_sizeX - double

setSizeY

public void setSizeY(double _sizeY)
Description copied from class: Element
Sets the size along the Y axis

Overrides:
setSizeY in class Element
Parameters:
_sizeY - double

setSizeZ

public void setSizeZ(double _sizeZ)
Description copied from class: Element
Sets the size along the Z axis

Overrides:
setSizeZ in class Element
Parameters:
_sizeZ - double

getTextLine

public TextLine getTextLine()
Returns the TextLine object of the element

Returns:
TextLine

getDiagonalSize

public double getDiagonalSize()
Description copied from class: Element
Returns the diagonal size of the element, i.e., Math.sqrt(sizeX*sizeX+sizeY*sizeY+sizeZ*sizeZ)

Overrides:
getDiagonalSize in class Element
Returns:
double