Class TCircle

All Implemented Interfaces:
Serializable, 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:
  • Field Details

    • circle

      protected Ellipse2D 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 number
      x - the x coordinate
      y - 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

      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 panel
      xpix - the x pixel position on the panel
      ypix - the y pixel position on the panel
      Returns:
      this if enabled and hit, otherwise null
    • getShape

      protected 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