org.opensourcephysics.cabrillo.tracker
Class ArrowFootprint

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

public class ArrowFootprint
extends LineFootprint

An ArrowFootprint returns an arrow shape for a Point array of length 2.

Author:
Douglas Brown

Field Summary
protected  double defaultStretch
           
protected  double stretch
           
protected  int tipLength
           
protected  int tipWidth
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.LineFootprint
color, DASHED_LINE, defaultWidth, DOTTED_LINE, hitShapes, line, name, path, stroke, transform
 
Constructor Summary
ArrowFootprint(java.lang.String name)
          Constructs an ArrowFootprint.
ArrowFootprint(java.lang.String name, double stretch)
          Constructs an ArrowFootprint.
 
Method Summary
 javax.swing.Icon getIcon(int w, int h)
          Gets the icon.
 java.awt.Shape getShape(java.awt.Point[] points)
          Gets the shape of this footprint.
 double getStretch()
          Gets the stretch.
 void setStretch(double stretch)
          Sets the stretch.
 void setTipLength(int tipLength)
          Sets the length of the arrow tip.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.LineFootprint
getColor, getDisplayName, getFootprint, getHitShapes, getLength, getMark, getName, getStroke, setColor, setDashArray, setLineWidth, setStroke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stretch

protected double stretch

defaultStretch

protected double defaultStretch

tipLength

protected int tipLength

tipWidth

protected int tipWidth
Constructor Detail

ArrowFootprint

public ArrowFootprint(java.lang.String name)
Constructs an ArrowFootprint.

Parameters:
name - the name

ArrowFootprint

public ArrowFootprint(java.lang.String name,
                      double stretch)
Constructs an ArrowFootprint.

Parameters:
name - the name
stretch - the default stretch
Method Detail

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

getIcon

public javax.swing.Icon 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 java.awt.Shape getShape(java.awt.Point[] points)
Gets the shape of this footprint.

Specified by:
getShape in interface Footprint
Overrides:
getShape in class LineFootprint
Parameters:
points - an array of Points
Returns:
the shape