Class CircleFitterFootprint

java.lang.Object
org.opensourcephysics.cabrillo.tracker.CircleFitterFootprint
All Implemented Interfaces:
Cloneable, Footprint

public class CircleFitterFootprint extends Object implements Footprint, Cloneable
A CircleFitterFootprint returns a circle, center point and data point marks. It requires a minimum Point array of length 2 {center, edge} but accommodates many data points.
Author:
Douglas Brown
  • Field Details

    • MAX_RADIUS

      protected static final int MAX_RADIUS
      See Also:
    • name

      protected String name
    • baseStroke

      protected BasicStroke baseStroke
    • stroke

      protected BasicStroke stroke
    • color

      protected Color color
    • hitShapes

      protected ArrayList<Shape> hitShapes
    • circle

      protected Ellipse2D circle
    • radius

      protected double radius
    • marker

      protected Shape marker
    • crosshatch

      protected Shape crosshatch
    • markerSize

      protected int markerSize
    • selectedPoint

      protected Point selectedPoint
    • markedPointCount

      protected int markedPointCount
    • drawCircle

      protected boolean drawCircle
  • Constructor Details

    • CircleFitterFootprint

      public CircleFitterFootprint(String name, int size)
      Constructs a CircleFitterFootprint.
      Parameters:
      name - the name
      size - the radius
  • Method Details

    • getName

      public String getName()
      Gets the name of this footprint.
      Specified by:
      getName in interface Footprint
      Returns:
      the name
    • getDisplayName

      public String getDisplayName()
      Gets the display name of the footprint.
      Specified by:
      getDisplayName in interface Footprint
      Returns:
      the localized display name
    • getLength

      public int getLength()
      Gets the minimum point array length required by this footprint.
      Specified by:
      getLength in interface Footprint
      Returns:
      the length
    • getIcon

      public ResizableIcon getIcon(int w, int h)
      Gets the icon.
      Specified by:
      getIcon in interface Footprint
      Parameters:
      w - width of the icon
      h - height of the icon
      Returns:
      the icon
    • getMark

      public Mark getMark(Point[] points)
      Gets the footprint mark.
      Specified by:
      getMark in interface Footprint
      Parameters:
      points - a Point array
      Returns:
      the mark
    • getHitShapes

      public Shape[] getHitShapes()
      Gets the hit shapes {vertex, end1, end2, line1, line2, rotator}.
      Specified by:
      getHitShapes in interface Footprint
      Returns:
      the hit shapes
    • setStroke

      public void setStroke(BasicStroke stroke)
      Sets the stroke.
      Specified by:
      setStroke in interface Footprint
      Parameters:
      stroke - the desired stroke
    • getStroke

      public BasicStroke getStroke()
      Gets the stroke.
      Specified by:
      getStroke in interface Footprint
      Returns:
      the stroke
    • setColor

      public void setColor(Color color)
      Sets the color.
      Specified by:
      setColor in interface Footprint
      Parameters:
      color - the desired color
    • getColor

      public Color getColor()
      Gets the color.
      Specified by:
      getColor in interface Footprint
      Returns:
      the color
    • setPixelRadius

      protected void setPixelRadius(double r)
      Sets the radius of the datapoint circle.
      Parameters:
      r - the radius
    • setCircleVisible

      protected void setCircleVisible(boolean vis)
      Sets the visibility of the circle.
      Parameters:
      vis - true to draw the circle
    • setSelectedPoint

      protected void setSelectedPoint(Point p)
      Sets the selected screen point. The selected point is not drawn so CircleStep can draw a selection shape instead.
      Parameters:
      p - the selected screen point (may be null)
    • setMarkedPointCount

      protected void setMarkedPointCount(int n)
      Sets the marked point count. Marked points are drawn differently than attached points.
      Parameters:
      n - the number of user-marked points in the step
    • getShape

      public org.opensourcephysics.cabrillo.tracker.MultiShape getShape(Point[] points, int scale)
      Gets the shape of this footprint for a Point array {center, edge, data0, data1, ...}. Also sets up hit shapes {circle, center, data1, data2, ...}
      Specified by:
      getShape in interface Footprint
      Parameters:
      points - an array of Points
      scale - an integer magnification
      Returns:
      the shape
    • getFootprint

      public static Footprint getFootprint(String name)
      Gets a predefined Footprint.
      Parameters:
      name - the name of the footprint
      Returns:
      the footprint