Package org.opensourcephysics.display
Class InteractiveCenteredArrow
java.lang.Object
org.opensourcephysics.display.AbstractInteractive
org.opensourcephysics.display.InteractiveShape
org.opensourcephysics.display.BoundedShape
org.opensourcephysics.display.InteractiveCenteredArrow
- All Implemented Interfaces:
Drawable,Interactive,Measurable,Selectable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA class to save and load InteractiveArrow in an XMLControl.Nested classes/interfaces inherited from class org.opensourcephysics.display.BoundedShape
BoundedShape.BoundedShapeLoaderNested classes/interfaces inherited from class org.opensourcephysics.display.InteractiveShape
InteractiveShape.InteractiveShapeLoader -
Field Summary
Fields 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
ConstructorsConstructorDescriptionInteractiveCenteredArrow(double x, double y, double w, double h) Constructor InteractiveCenteredArrow -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Draws the arrow.static XML.ObjectLoaderGets the XML object loader for this class.Gets the cursor depending on the current hot spot.booleanisInside(DrawingPanel panel, int xpix, int ypix) Determines if the shape is enabled and if the given pixel coordinates are within the shape.voidsetStrokeWidth(double width) Sets the stroke for rendering fat arrows.voidsetTheta(double theta) Rotates the arrow without changing its length.voidsetWidthHeight(double width, double height) Sets the origin, width (horizontal) and height (vertical) components of this arrow.Methods inherited from class org.opensourcephysics.display.BoundedShape
createBoundedArrow, createBoundedCenteredArrow, createBoundedCircle, createBoundedEllipse, createBoundedImage, createBoundedRectangle, createBoundedTriangle, findInteractive, getBounds2D, isHeightDrag, isRotateDrag, isSelected, isWidthDrag, isXYDrag, setHeightDrag, setRotateDrag, setSelected, setWidthDrag, setXYDrag, toggleSelected, toStringMethods 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, getXMax, getXMin, getYMax, getYMin, isMeasured, setHeight, setMarkerColor, setMeasured, setOffset, setPixelSized, setWidth, setX, setXY, setY, 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
getX, getY, isEnabled, isInteractive, setEnabled, setX, setXY, setYMethods inherited from interface org.opensourcephysics.display.Measurable
getXMax, getXMin, getYMax, getYMin, isMeasured
-
Constructor Details
-
InteractiveCenteredArrow
public InteractiveCenteredArrow(double x, double y, double w, double h) Constructor InteractiveCenteredArrow- Parameters:
x-y-w-h-
-
-
Method Details
-
setStrokeWidth
public void setStrokeWidth(double width) Sets the stroke for rendering fat arrows.- Parameters:
width- double
-
isInside
Determines if the shape is enabled and if the given pixel coordinates are within the shape.- Overrides:
isInsidein classBoundedShape- Parameters:
panel- DrawingPanelxpix- intypix- int- Returns:
- boolean
-
setTheta
public void setTheta(double theta) Rotates the arrow without changing its length.- Overrides:
setThetain classInteractiveShape- Parameters:
theta-
-
setWidthHeight
public void setWidthHeight(double width, double height) Sets the origin, width (horizontal) and height (vertical) components of this arrow.- Parameters:
width- doubleheight- double
-
draw
Draws the arrow.- Specified by:
drawin interfaceDrawable- Overrides:
drawin classBoundedShape- Parameters:
panel- the world in which the arrow is viewedg- the graphics context upon which to draw
-
getPreferredCursor
Gets the cursor depending on the current hot spot.- Specified by:
getPreferredCursorin interfaceSelectable- Overrides:
getPreferredCursorin classBoundedShape- Returns:
- Cursor
-
getLoader
Gets the XML object loader for this class.- Returns:
- ObjectLoader
-