Class PencilCaption
java.lang.Object
org.opensourcephysics.display.AbstractInteractive
org.opensourcephysics.display.InteractiveShape
org.opensourcephysics.display.InteractiveTextLine
org.opensourcephysics.cabrillo.tracker.PencilCaption
- All Implemented Interfaces:
Drawable,Interactive,Measurable
A PencilCaption is a text caption for a PencilScene.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveTextLine
InteractiveTextLine.InteractiveTextLineLoaderNested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveShape
InteractiveShape.InteractiveShapeLoader -
Field Summary
Fields inherited from class org.opensourcephysics.display.InteractiveTextLine
textLineFields inherited from class org.opensourcephysics.display.InteractiveShape
edgeColor, height, pixelPt, pixelSized, shape, shapeClass, theta, toPixels, trIS, width, xoff, yoffFields inherited from class org.opensourcephysics.display.AbstractInteractive
color, x, y -
Constructor Summary
ConstructorsConstructorDescriptionPencilCaption(String text, double x, double y, Font font) Constructs a PencilCaption with specified text, position and font. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws the text.findInteractive(DrawingPanel panel, int xpix, int ypix) Finds the interactive object that will respond to mouse actions.static XML.ObjectLoaderReturns the XML.ObjectLoader for this class.doublegetXMax()Implements measurable by getting the x center of the circle.doublegetXMin()Implements measurable by getting the x center of the circle.doublegetYMax()Implements measurable by getting the y center of the circle.doublegetYMin()Implements measurable by getting the y center of the circle.protected booleanhandleMouseAction(MouseEvent e, TrackerPanel trackerPanel) Handles mouse events for a TrackerPanel.booleanDetermines if this circle should effect the scale of a drawing panel.voidSets the font used to display the text.voidSets the text to be displayed.Methods inherited from class org.opensourcephysics.display.InteractiveTextLine
getFont, getText, isInside, setJustificationMethods inherited from class org.opensourcephysics.display.InteractiveShape
contains, createArrow, createCenteredArrow, createCircle, createEllipse, createImage, createRectangle, createSquare, createTextLine, createTriangle, getHeight, getPixelPt, getRotateInstance, getRotateInstance, getScaleInstance, getShape, getTranslateInstance, getWidth, setHeight, setMarkerColor, setMeasured, setOffset, setPixelSized, setTheta, setWidth, setX, setXY, setY, toString, tranform, transformMethods inherited from class org.opensourcephysics.display.AbstractInteractive
getX, getY, isEnabled, setEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
isInteractive
-
Constructor Details
-
PencilCaption
Constructs a PencilCaption with specified text, position and font.- Parameters:
text- the textx- the x-positiony- the y-positionfont- the font
-
-
Method Details
-
draw
Description copied from class:InteractiveTextLineDraws the text.- Specified by:
drawin interfaceDrawable- Overrides:
drawin classInteractiveTextLine- Parameters:
panel- the world in which the arrow is viewedg- the graphics context upon which to draw
-
findInteractive
Description copied from class:AbstractInteractiveFinds the interactive object that will respond to mouse actions.- Specified by:
findInteractivein interfaceInteractive- Overrides:
findInteractivein classAbstractInteractive- Parameters:
panel- DrawingPanelxpix- intypix- int- Returns:
- Interactive
-
setText
Description copied from class:InteractiveTextLineSets the text to be displayed.- Overrides:
setTextin classInteractiveTextLine- Parameters:
text- String
-
setFont
Description copied from class:InteractiveTextLineSets the font used to display the text.- Overrides:
setFontin classInteractiveTextLine- Parameters:
font- Font
-
isMeasured
public boolean isMeasured()Description copied from class:InteractiveShapeDetermines if this circle should effect the scale of a drawing panel.- Specified by:
isMeasuredin interfaceMeasurable- Overrides:
isMeasuredin classInteractiveShape- Returns:
- minimum
-
getXMin
public double getXMin()Description copied from class:InteractiveShapeImplements measurable by getting the x center of the circle.- Specified by:
getXMinin interfaceMeasurable- Overrides:
getXMinin classInteractiveShape- Returns:
- minimum
-
getXMax
public double getXMax()Description copied from class:InteractiveShapeImplements measurable by getting the x center of the circle.- Specified by:
getXMaxin interfaceMeasurable- Overrides:
getXMaxin classInteractiveShape- Returns:
- maximum
-
getYMin
public double getYMin()Description copied from class:InteractiveShapeImplements measurable by getting the y center of the circle.- Specified by:
getYMinin interfaceMeasurable- Overrides:
getYMinin classInteractiveShape- Returns:
- minimum
-
getYMax
public double getYMax()Description copied from class:InteractiveShapeImplements measurable by getting the y center of the circle.- Specified by:
getYMaxin interfaceMeasurable- Overrides:
getYMaxin classInteractiveShape- Returns:
- maximum
-
handleMouseAction
Handles mouse events for a TrackerPanel.- Parameters:
trackerPanel- the TrackerPanele- the mouse event
-
getLoader
Returns the XML.ObjectLoader for this class.- Returns:
- the object loader
-