org.opensourcephysics.media.core
Class TCircle
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.TCircle
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Drawable, Interactive, Measurable, Trackable
public class TCircle
- extends TShape
This is a Trackable circle that extends TShape.
- Version:
- 1.0
- Author:
- Douglas Brown
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Field Summary |
protected java.awt.geom.Ellipse2D |
circle
|
protected int |
n
|
protected int |
radius
|
Fields inherited from class java.awt.geom.Point2D.Double |
x, y |
Constructor Summary |
TCircle(int n)
Constructs a TCircle with image coordinates (0, 0). |
TCircle(int n,
double x,
double y)
Constructs a TCircle with specified image coordinates. |
Method Summary |
Interactive |
findInteractive(DrawingPanel panel,
int xpix,
int ypix)
Returns this if it is enabled and visible and the specified
pixel position falls within the bounds of this circle. |
int |
getFrameNumber(VideoPanel vidPanel)
Overrides TPoint getFrameNumber method. |
int |
getRadius()
Gets the radius of this circle. |
protected java.awt.Shape |
getShape(VideoPanel vidPanel)
Gets the circle shape to be filled in the draw method. |
void |
setRadius(int radius)
Sets the radius of this circle. |
Methods inherited from class org.opensourcephysics.media.core.TPoint |
addPropertyChangeListener, addPropertyChangeListener, angle, angle, center, cos, cos, equals, getScreenPosition, getWorldPosition, getXMax, getXMin, getYMax, getYMin, isCoordsEditTrigger, isEnabled, isMeasured, isStepEditTrigger, isTrackEditTrigger, removePropertyChangeListener, removePropertyChangeListener, setCoordsEditTrigger, setEnabled, setLocation, setPositionOnLine, setScreenPosition, setScreenPosition, setStepEditTrigger, setTrackEditTrigger, setX, setXY, 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 |
circle
protected java.awt.geom.Ellipse2D circle
radius
protected int radius
n
protected int n
TCircle
public TCircle(int n)
- Constructs a TCircle with image coordinates (0, 0).
- Parameters:
n
- the video frame number
TCircle
public TCircle(int n,
double x,
double y)
- Constructs a TCircle with specified image coordinates.
- Parameters:
n
- the video frame numberx
- the x coordinatey
- the y coordinate
setRadius
public void setRadius(int radius)
- Sets the radius of this circle.
- Parameters:
radius
- the radius in screen pixels
getRadius
public int getRadius()
- Gets the radius of this circle.
- Returns:
- the radius in screen pixels
getFrameNumber
public int getFrameNumber(VideoPanel vidPanel)
- Overrides TPoint getFrameNumber method.
- Overrides:
getFrameNumber
in class TPoint
- Parameters:
vidPanel
- the video panel drawing this circle
- Returns:
- the frame number
findInteractive
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
- Returns this if it is enabled and visible and the specified
pixel position falls within the bounds of this circle.
- Specified by:
findInteractive
in interface Interactive
- Overrides:
findInteractive
in class TShape
- Parameters:
panel
- the drawing panelxpix
- the x pixel position on the panelypix
- the y pixel position on the panel
- Returns:
- this if enabled and hit, otherwise null
getShape
protected java.awt.Shape getShape(VideoPanel vidPanel)
- Gets the circle shape to be filled in the draw method.
- Overrides:
getShape
in class TShape
- Parameters:
vidPanel
- the video panel
- Returns:
- the circle shape