|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.display.AbstractInteractive
org.opensourcephysics.display.InteractiveShape
org.opensourcephysics.display.InteractiveTextLine
public class InteractiveTextLine
An InteractiveTextLine is a single line of text that can be moved and rotated like other interactive shapes.
| Nested Class Summary | |
|---|---|
protected static class |
InteractiveTextLine.InteractiveTextLineLoader
A class to save and load InteractiveArrow in an XMLControl. |
| Nested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveShape |
|---|
InteractiveShape.InteractiveShapeLoader |
| Field Summary |
|---|
| Fields inherited from class org.opensourcephysics.display.InteractiveShape |
|---|
edgeColor, height, pixelSized, shape, shapeClass, theta, width, xoff, yoff |
| Fields inherited from class org.opensourcephysics.display.AbstractInteractive |
|---|
color, x, y |
| Constructor Summary | |
|---|---|
InteractiveTextLine(java.lang.String text,
double x,
double y)
Constructs an interactive TextLinme with the given text and location. |
|
| Method Summary | |
|---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the text. |
java.awt.Font |
getFont()
Gets the font used to display the text. |
static XML.ObjectLoader |
getLoader()
Gets the XML object loader for this class. |
java.lang.String |
getText()
Gets the text to be dispalyed. |
boolean |
isInside(DrawingPanel panel,
int xpix,
int ypix)
Determines if the shape is enabled and if the given pixel coordinates are within the image. |
void |
setFont(java.awt.Font font)
Sets the font used to display the text. |
void |
setJustification(int justification)
Sets the justification to center, left, or right. |
void |
setText(java.lang.String text)
Sets the text to be displayed. |
| Methods inherited from class org.opensourcephysics.display.InteractiveShape |
|---|
contains, createArrow, createCenteredArrow, createCircle, createEllipse, createImage, createRectangle, createSquare, createTextLine, createTriangle, getHeight, getShape, getWidth, getXMax, getXMin, getYMax, getYMin, isMeasured, setHeight, setMarkerColor, setMeasured, setOffset, setPixelSized, setTheta, setWidth, setX, setXY, setY, toString, tranform, transform |
| Methods inherited from class org.opensourcephysics.display.AbstractInteractive |
|---|
findInteractive, getX, getY, isEnabled, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InteractiveTextLine(java.lang.String text,
double x,
double y)
text - Stringx - doubley - double| Method Detail |
|---|
public void setJustification(int justification)
TextLine.CENTER, TextLine.LEFT, TextLine.RIGHT
justification - intpublic void setText(java.lang.String text)
text - Stringpublic java.lang.String getText()
public void setFont(java.awt.Font font)
font - Fontpublic java.awt.Font getFont()
public boolean isInside(DrawingPanel panel,
int xpix,
int ypix)
isInside in class InteractiveShapepanel - DrawingPanelxpix - intypix - int
public void draw(DrawingPanel panel,
java.awt.Graphics g)
draw in interface Drawabledraw in class InteractiveShapepanel - the world in which the arrow is viewedg - the graphics context upon which to drawpublic static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||