Class CircleFootprint

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

public class CircleFootprint extends Object implements Footprint, Cloneable
A CircleFootprint returns a circle for a Point[] of length 1.
  • Field Details

    • plainStrokeSize

      protected static float plainStrokeSize
    • boldStrokeSize

      protected static float boldStrokeSize
    • name

      protected String name
    • circle

      protected Ellipse2D circle
    • center

      protected Ellipse2D center
    • highlight

      protected Shape highlight
    • outline

      protected Shape outline
    • spot

      protected Shape spot
    • transform

      protected AffineTransform transform
    • alpha

      protected int alpha
    • color

      protected Color color
    • highlightColor

      protected Color highlightColor
    • hitShapes

      protected Shape[] hitShapes
    • baseHighlightStroke

      protected BasicStroke baseHighlightStroke
    • baseOutlineStroke

      protected BasicStroke baseOutlineStroke
    • highlightStroke

      protected BasicStroke highlightStroke
    • outlineStroke

      protected BasicStroke outlineStroke
    • outlined

      protected boolean outlined
    • spotted

      protected boolean spotted
    • dialog

      protected org.opensourcephysics.cabrillo.tracker.CircleFootprint.CircleDialog dialog
    • r

      protected int r
    • prevRadius

      protected int prevRadius
    • prevStrokeSize

      protected float prevStrokeSize
    • prevSpot

      protected boolean prevSpot
  • Constructor Details

    • CircleFootprint

      public CircleFootprint(String name, int radius)
      Constructs a CircleFootprint.
      Parameters:
      name - the name
      radius - radius of the footprint
  • Method Details

    • clone

      protected Object clone() throws CloneNotSupportedException
      Clones a CircleFootprint.
      Overrides:
      clone in class Object
      Returns:
      the clone
      Throws:
      CloneNotSupportedException
    • getFootprint

      public static Footprint getFootprint(String name)
      Gets a named footprint.
      Parameters:
      name - the name of the footprint
      Returns:
      the footprint
    • 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.
      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 stroke
    • getStroke

      public BasicStroke getStroke()
      Gets the stroke. May return null;
      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
    • setRadius

      public void setRadius(int radius)
      Sets the radius.
      Parameters:
      radius - the radius
    • setOutlined

      public void setOutlined(boolean outline)
      Sets the outlined flag.
      Parameters:
      outline - true to draw an outline around the circle
    • setSpotShown

      public void setSpotShown(boolean drawSpot)
      Sets the spotted flag.
      Parameters:
      drawSpot - true to draw a spot at the center of the circle
    • setAlpha

      public void setAlpha(int alpha)
      Sets the alpha of the fill.
      Parameters:
      alpha - 0 for transparent, 255 for solid
    • getProperties

      public String getProperties()
      Gets the properties for saving.
      Returns:
      the properties "r outline spot bold"
    • setProperties

      public void setProperties(String props)
      Sets the properties when loading.
      Parameters:
      props - the properties "r outline spot bold"
    • showProperties

      public void showProperties(TTrack track)
      Shows the properties dialog.
      Parameters:
      track - the track using this footprint
    • showProperties

      public void showProperties(TFrame frame, ActionListener listener)
      Shows the properties dialog.
      Parameters:
      frame - a TFrame
      listener - an ActionListener
    • getShape

      public org.opensourcephysics.cabrillo.tracker.MultiShape getShape(Point[] points, int scale)
      Gets the draw shape for a specified point.
      Specified by:
      getShape in interface Footprint
      Parameters:
      points - an array of points
      scale - an integer magnification
      Returns:
      the draw shape