Class PointShapeFootprint

java.lang.Object
org.opensourcephysics.cabrillo.tracker.PointShapeFootprint
All Implemented Interfaces:
Cloneable, Footprint
Direct Known Subclasses:
PositionVectorFootprint

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

  • Constructor Details

    • PointShapeFootprint

      public PointShapeFootprint(String name, Shape shape)
      Constructs a PointShapeFootprint with a point shape.
      Parameters:
      name - the name
      shape - point shape of the footprint
  • Method Details

    • getFootprint

      public static PointShapeFootprint 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
    • setShape

      protected void setShape(Shape shape)
      Sets the shape.
      Parameters:
      shape - the desired shape
    • setStroke

      public void setStroke(BasicStroke stroke)
      Sets the stroke. May be set to null.
      Specified by:
      setStroke in interface Footprint
      Parameters:
      stroke - the desired 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
    • getShape

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