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 GeneralPath
protected org.opensourcephysics.media.core.TCoordAxes.Origin
protected boolean
protected GeneralPath
protected VideoPanel
protected GeneralPath
protected boolean
Fields inherited from class org.opensourcephysics.media.core.TShape
color, fillShape, hitRect, stroke, visible
Fields inherited from class org.opensourcephysics.media.core.TPoint
attachedTo, coordsEditTrigger, coordsVisibleInMouseBox, enabled, isAdjusting, prevX, prevY, screenPt, stepEditTrigger, support, toScreen, trackEditTrigger, worldPt, xyStringBuilder
Fields inherited from class java.awt.geom.Point2D.Double
x, y
Fields 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 TypeMethodDescriptionvoid
draw
(DrawingPanel panel, Graphics g) Overrides TShape draw method.findInteractive
(DrawingPanel panel, int xpix, int ypix) Overrides TShape findInteractive method.Gets the origin.protected Shape
getShape
(VideoPanel vidPanel) Overrides TShape getShape method.boolean
Gets whether the origin responds to mouse hits.boolean
Gets whether the x-axis responds to mouse hits.void
setOriginEnabled
(boolean enabled) Sets whether the origin responds to mouse hits.void
setStroke
(BasicStroke stroke) Overrides TShape setStroke method.void
setXAxisEnabled
(boolean enabled) Sets whether the x-axis responds to mouse hits.void
setXY
(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, setVisible
Methods 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, translate
Methods inherited from class java.awt.geom.Point2D.Double
getX, getY
Methods inherited from class java.awt.geom.Point2D
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, hashCode, setLocation
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
setXY
in interfaceInteractive
- Overrides:
setXY
in 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
-true
if origin responds to mouse hits.
-
isOriginEnabled
public boolean isOriginEnabled()Gets whether the origin responds to mouse hits.- Returns:
true
if the origin responds to mouse hits.
-
setXAxisEnabled
public void setXAxisEnabled(boolean enabled) Sets whether the x-axis responds to mouse hits.- Parameters:
enabled
-true
if x-axis responds to mouse hits.
-
isXAxisEnabled
public boolean isXAxisEnabled()Gets whether the x-axis responds to mouse hits.- Returns:
true
if the x-axis responds to mouse hits.
-
findInteractive
Overrides TShape findInteractive method.- Specified by:
findInteractive
in interfaceInteractive
- Overrides:
findInteractive
in 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.
-