Package org.opensourcephysics.media.core
Class TCoordAxes
java.lang.Object
java.awt.geom.Point2D
java.awt.geom.Point2D.Double
org.opensourcephysics.media.core.TPoint
org.opensourcephysics.media.core.TShape
org.opensourcephysics.media.core.TCoordAxes
- All Implemented Interfaces:
Serializable,Cloneable,Drawable,Interactive,Measurable,Trackable
This draws the worldspace origin and axes of an image coordinate system.
- Version:
- 1.0
- Author:
- Douglas Brown
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Point2D
Point2D.Double, Point2D.Float -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GeneralPathprotected org.opensourcephysics.media.core.TCoordAxes.Originprotected booleanprotected GeneralPathprotected VideoPanelprotected GeneralPathprotected booleanFields inherited from class org.opensourcephysics.media.core.TShape
color, fillShape, hitRect, stroke, visibleFields inherited from class org.opensourcephysics.media.core.TPoint
attachedTo, coordsEditTrigger, coordsVisibleInMouseBox, enabled, isAdjusting, prevX, prevY, screenPt, stepEditTrigger, support, toScreen, trackEditTrigger, worldPt, xyStringBuilderFields inherited from class java.awt.geom.Point2D.Double
x, yFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING -
Constructor Summary
ConstructorsConstructorDescriptionTCoordAxes(VideoPanel panel) Constructs a TCoordAxes object for the specified video panel. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(DrawingPanel panel, Graphics g) Overrides TShape draw method.findInteractive(DrawingPanel panel, int xpix, int ypix) Overrides TShape findInteractive method.Gets the origin.protected ShapegetShape(VideoPanel vidPanel) Overrides TShape getShape method.booleanGets whether the origin responds to mouse hits.booleanGets whether the x-axis responds to mouse hits.voidsetOriginEnabled(boolean enabled) Sets whether the origin responds to mouse hits.voidsetStroke(BasicStroke stroke) Overrides TShape setStroke method.voidsetXAxisEnabled(boolean enabled) Sets whether the x-axis responds to mouse hits.voidsetXY(double x, double y) Overrides TPoint setXY method.toString()Returns a String describing this object.Methods inherited from class org.opensourcephysics.media.core.TShape
getBounds, getColor, getStroke, isVisible, setColor, setHitRectCenter, setVisibleMethods inherited from class org.opensourcephysics.media.core.TPoint
addPropertyChangeListener, addPropertyChangeListener, angle, angle, attachTo, center, cos, cos, detach, equals, getFrameNumber, getScreenPosition, getWorldPosition, getXMax, getXMin, getYMax, getYMin, isAdjusting, isAttached, isCoordsEditTrigger, isEnabled, isMeasured, isStepEditTrigger, isTrackEditTrigger, removePropertyChangeListener, removePropertyChangeListener, setAdjusting, setCoordsEditTrigger, setEnabled, setLocation, setPositionOnLine, setScreenPosition, setScreenPosition, setStepEditTrigger, setTrackEditTrigger, setWorldPosition, setX, setY, showCoordinates, sin, sin, translateMethods inherited from class java.awt.geom.Point2D.Double
getX, getYMethods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocationMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Interactive
getX, getY, isInteractive
-
Field Details
-
vidPanel
-
axes
-
origin
protected org.opensourcephysics.media.core.TCoordAxes.Origin origin -
originEnabled
protected boolean originEnabled -
xaxisEnabled
protected boolean xaxisEnabled -
originShape
-
xaxis
-
-
Constructor Details
-
TCoordAxes
Constructs a TCoordAxes object for the specified video panel.- Parameters:
panel- the video panel
-
-
Method Details
-
getOrigin
Gets the origin.- Returns:
- the origin
-
draw
Overrides TShape draw method. -
setXY
public void setXY(double x, double y) Overrides TPoint setXY method. Sets the angle of the x axis.- Specified by:
setXYin interfaceInteractive- Overrides:
setXYin classTPoint- Parameters:
x- the x positiony- the y position
-
setStroke
Overrides TShape setStroke method. -
setOriginEnabled
public void setOriginEnabled(boolean enabled) Sets whether the origin responds to mouse hits.- Parameters:
enabled-trueif origin responds to mouse hits.
-
isOriginEnabled
public boolean isOriginEnabled()Gets whether the origin responds to mouse hits.- Returns:
trueif the origin responds to mouse hits.
-
setXAxisEnabled
public void setXAxisEnabled(boolean enabled) Sets whether the x-axis responds to mouse hits.- Parameters:
enabled-trueif x-axis responds to mouse hits.
-
isXAxisEnabled
public boolean isXAxisEnabled()Gets whether the x-axis responds to mouse hits.- Returns:
trueif the x-axis responds to mouse hits.
-
findInteractive
Overrides TShape findInteractive method.- Specified by:
findInteractivein interfaceInteractive- Overrides:
findInteractivein classTShape- Parameters:
panel- the drawing panelxpix- the x pixel position on the panelypix- the y pixel position on the panel- Returns:
- the interactive drawable object
-
toString
Returns a String describing this object. -
getShape
Overrides TShape getShape method.
-