org.opensourcephysics.media.core
Class TrackableCircle

java.lang.Object
  extended by org.opensourcephysics.display.Circle
      extended by org.opensourcephysics.media.core.TrackableCircle
All Implemented Interfaces:
Drawable, Trackable

public class TrackableCircle
extends Circle
implements Trackable

This is a circle that implements the Trackable interface and is associated with a single video frame. The draw method illustrates the process of transforming imagespace to worldspace coordinates.

Version:
1.0
Author:
Douglas Brown

Field Summary
protected  int n
           
 
Fields inherited from class org.opensourcephysics.display.Circle
color, pixRadius, x, y
 
Constructor Summary
TrackableCircle(int n, double imageX, double imageY)
          Constructs a TrackableCircle.
 
Method Summary
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Overrides the Circle draw method.
 int getFrameNumber()
          Gets the frame number.
 
Methods inherited from class org.opensourcephysics.display.Circle
getLoader, getX, getY, setX, setXY, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

n

protected int n
Constructor Detail

TrackableCircle

public TrackableCircle(int n,
                       double imageX,
                       double imageY)
Constructs a TrackableCircle.

Parameters:
n - the video frame number
imageX - the x position in imagespace
imageY - the y position in imagespace
Method Detail

getFrameNumber

public int getFrameNumber()
Gets the frame number.

Returns:
the frame number

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Overrides the Circle draw method.

Specified by:
draw in interface Drawable
Overrides:
draw in class Circle
Parameters:
panel - the drawing panel requesting the drawing
g - the graphics context on which to draw