org.opensourcephysics.cabrillo.tracker
Class PositionVectorFootprint

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

public class PositionVectorFootprint
extends PointShapeFootprint

A PositionVectorFootprint returns a vector shape for a Point[] of length 2, but creates a hit shape only at the tip of the vector.


Field Summary
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.PointShapeFootprint
color, defaultWidth, footprints, highlight, hitShapes, name, shape, stroke, transform
 
Constructor Summary
PositionVectorFootprint(TTrack track, java.lang.String name, int w)
          Constructs a PositionVectorFootprint.
 
Method Summary
 javax.swing.Icon getIcon(int w, int h)
          Gets the icon.
 java.awt.Shape getShape(java.awt.Point[] points)
          Gets the fill shape for a specified point.
 java.awt.BasicStroke getStroke()
          Gets the stroke.
 void setLineWidth(double w)
          Sets the line width.
 void setStroke(java.awt.BasicStroke stroke)
          Sets the stroke.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.PointShapeFootprint
getColor, getDisplayName, getFootprint, getHitShapes, getLength, getMark, getName, setColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionVectorFootprint

public PositionVectorFootprint(TTrack track,
                               java.lang.String name,
                               int w)
Constructs a PositionVectorFootprint.

Parameters:
track - the (PointMass) track that will use this footprint
name - the name of the footprint
w - the stroke line width
Method Detail

getShape

public java.awt.Shape getShape(java.awt.Point[] points)
Gets the fill shape for a specified point.

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

getIcon

public javax.swing.Icon getIcon(int w,
                                int h)
Gets the icon.

Specified by:
getIcon in interface Footprint
Overrides:
getIcon in class PointShapeFootprint
Parameters:
w - width of the icon
h - height of the icon
Returns:
the icon

setStroke

public void setStroke(java.awt.BasicStroke stroke)
Sets the stroke. May be set to null.

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

getStroke

public java.awt.BasicStroke getStroke()
Gets the stroke. May return null;

Specified by:
getStroke in interface Footprint
Overrides:
getStroke in class PointShapeFootprint
Returns:
the stroke

setLineWidth

public void setLineWidth(double w)
Sets the line width.

Overrides:
setLineWidth in class PointShapeFootprint
Parameters:
w - the desired line width