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  java.awt.BasicStroke headStroke
           
protected  double stretch
           
protected  int tipLength
           
protected  int tipWidth
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.LineFootprint
color, DASHED_LINE, DOTTED_LINE, highlight, HIGHLIGHT, hitShapes, line, name, path, stroke, transform
 
Constructor Summary
ArrowFootprint(java.lang.String name)
          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 setSolidHead(boolean solid)
          Sets the solid arrowhead property.
 void setStretch(double stretch)
          Sets the stretch.
 void setStroke(java.awt.BasicStroke stroke)
          Sets the stroke.
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stretch

protected double stretch

tipLength

protected int tipLength

tipWidth

protected int tipWidth

headStroke

protected java.awt.BasicStroke headStroke
Constructor Detail

ArrowFootprint

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

Parameters:
name - the name
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

setSolidHead

public void setSolidHead(boolean solid)
Sets the solid arrowhead property.

Parameters:
solid - true for a filled arrowhead

setStroke

public void setStroke(java.awt.BasicStroke stroke)
Sets the stroke.

Specified by:
setStroke in interface Footprint
Overrides:
setStroke in class LineFootprint
Parameters:
stroke - the desired stroke

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