Class ArrowFootprint

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

public class ArrowFootprint extends LineFootprint
An ArrowFootprint returns an arrow shape for a Point array of length 2.
Author:
Douglas Brown
  • Field Details

    • stretch

      protected double stretch
    • tipLength

      protected int tipLength
    • tipWidth

      protected int tipWidth
    • headStroke

      protected BasicStroke headStroke
    • tipStroke

      protected BasicStroke tipStroke
  • Constructor Details

    • ArrowFootprint

      public ArrowFootprint(String name)
      Constructs an ArrowFootprint.
      Parameters:
      name - the name
  • Method Details

    • setStretch

      public void setStretch(double stretch)
      Sets the stretch. The length of the arrow is stretched by this factor.
      Parameters:
      stretch - the desired stretch
    • getStretch

      public double getStretch()
      Gets the stretch.
      Returns:
      the stretch
    • setTipLength

      public void setTipLength(int tipLength)
      Sets the length of the arrow tip.
      Parameters:
      tipLength - the desired tip length in pixels
    • setSolidHead

      public void setSolidHead(boolean solid)
      Sets the solid arrowhead property.
      Parameters:
      solid - true for a filled arrowhead
    • setStroke

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

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

      public org.opensourcephysics.cabrillo.tracker.MultiShape getShape(Point[] points, int scale)
      Gets the shape of this footprint.
      Specified by:
      getShape in interface Footprint
      Overrides:
      getShape in class LineFootprint
      Parameters:
      points - an array of Points
      scale - an integer magnification
      Returns:
      the shape