Interface ElementText
- All Superinterfaces:
Element
,InteractionSource
- All Known Implementing Classes:
ElementText
Title: ElementSegment
Description: A 3D Segment.
- Version:
- March 2005
- Author:
- Francisco Esquembre
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Center the Text over the pointstatic final int
Position the Text to the Left of the pointstatic final int
Position the Text to the Right of the pointFields inherited from interface org.opensourcephysics.display3d.core.Element
TARGET_POSITION, TARGET_SIZE
-
Method Summary
Modifier and TypeMethodDescriptiongetFont()
Gets the font of the textint
Gets the justification of the textdouble
Gets the rotation angle for the textgetText()
Gets the text displayedvoid
Sets the font for the textvoid
setJustification
(int justification) Sets the justification for the textvoid
setRotationAngle
(double angle) Sets the rotation angle for the text.void
Sets the text to be displayedMethods inherited from interface org.opensourcephysics.display3d.core.Element
getDrawingPanel3D, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isVisible, loadUnmutableObjects, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame
Methods inherited from interface org.opensourcephysics.display3d.core.interaction.InteractionSource
addInteractionListener, getInteractionTarget, removeInteractionListener
-
Field Details
-
JUSTIFICATION_CENTER
static final int JUSTIFICATION_CENTERCenter the Text over the point- See Also:
-
JUSTIFICATION_LEFT
static final int JUSTIFICATION_LEFTPosition the Text to the Left of the point- See Also:
-
JUSTIFICATION_RIGHT
static final int JUSTIFICATION_RIGHTPosition the Text to the Right of the point- See Also:
-
-
Method Details
-
setText
Sets the text to be displayed- Parameters:
text
- the String
-
getText
String getText()Gets the text displayed -
setFont
Sets the font for the text- Parameters:
font
- Font
-
getFont
Font getFont()Gets the font of the text- Returns:
- Font
-
setJustification
void setJustification(int justification) Sets the justification for the text- Parameters:
font
- Font
-
getJustification
int getJustification()Gets the justification of the text- Returns:
- Font
-
setRotationAngle
void setRotationAngle(double angle) Sets the rotation angle for the text. Default is 0.- Parameters:
angle
- the rotation angle
-
getRotationAngle
double getRotationAngle()Gets the rotation angle for the text
-