Package 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:
Serializable
,Cloneable
,Drawable
,Interactive
,Measurable
,Trackable
This is a Trackable circle that extends TShape.
- 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
FieldsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindInteractive
(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
Gets the radius of this circle.protected 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.TShape
draw, getBounds, getColor, getStroke, isVisible, setColor, setHitRectCenter, setStroke, setVisible, toString
Methods inherited from class org.opensourcephysics.media.core.TPoint
addPropertyChangeListener, addPropertyChangeListener, angle, angle, attachTo, center, cos, cos, detach, equals, 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, 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
Methods inherited from interface org.opensourcephysics.display.Interactive
getX, getY, isInteractive
-
Field Details
-
circle
-
radius
protected int radius -
n
protected int n
-
-
Constructor Details
-
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
-
-
Method Details
-
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
Overrides TPoint getFrameNumber method.- Overrides:
getFrameNumber
in classTPoint
- Parameters:
vidPanel
- the video panel drawing this circle- Returns:
- the frame number
-
findInteractive
Returns this if it is enabled and visible and the specified pixel position falls within the bounds of this circle.- 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:
- this if enabled and hit, otherwise null
-
getShape
Gets the circle shape to be filled in the draw method.
-