org.opensourcephysics.cabrillo.tracker
Class PointShapeFootprint

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

public class PointShapeFootprint
extends java.lang.Object
implements Footprint, java.lang.Cloneable

A PointShapeFootprint returns a shape for a Point[] of length 1.


Field Summary
protected  java.awt.Color color
           
protected  double defaultWidth
           
protected static java.util.Collection<PointShapeFootprint> footprints
           
protected  java.awt.Shape highlight
           
protected  java.awt.Shape[] hitShapes
           
protected  java.lang.String name
           
protected  java.awt.Shape shape
           
protected  java.awt.BasicStroke stroke
           
protected  java.awt.geom.AffineTransform transform
           
 
Constructor Summary
PointShapeFootprint(java.lang.String name, java.awt.Shape shape)
          Constructs a PointShapeFootprint with a point shape.
 
Method Summary
 java.awt.Color getColor()
          Gets the color.
 java.lang.String getDisplayName()
          Gets the display name of the footprint.
static PointShapeFootprint getFootprint(java.lang.String name)
          Gets a named footprint.
 java.awt.Shape[] getHitShapes()
          Gets the hit shapes.
 javax.swing.Icon getIcon(int w, int h)
          Gets the icon.
 int getLength()
          Gets the minimum point array length required by this footprint.
 Mark getMark(java.awt.Point[] points)
          Gets the footprint mark.
 java.lang.String getName()
          Gets the name of this footprint.
 java.awt.Shape getShape(java.awt.Point[] points)
          Gets the fill shape for a specified point.
 java.awt.BasicStroke getStroke()
          Gets the stroke.
 void setColor(java.awt.Color color)
          Sets the color.
 void setLineWidth(double w)
          Sets the line width.
 void setStroke(java.awt.BasicStroke stroke)
          Sets the stroke.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

shape

protected java.awt.Shape shape

highlight

protected java.awt.Shape highlight

transform

protected java.awt.geom.AffineTransform transform

stroke

protected java.awt.BasicStroke stroke

color

protected java.awt.Color color

hitShapes

protected java.awt.Shape[] hitShapes

defaultWidth

protected double defaultWidth

footprints

protected static java.util.Collection<PointShapeFootprint> footprints
Constructor Detail

PointShapeFootprint

public PointShapeFootprint(java.lang.String name,
                           java.awt.Shape shape)
Constructs a PointShapeFootprint with a point shape.

Parameters:
name - the name
shape - point shape of the footprint
Method Detail

getFootprint

public static PointShapeFootprint getFootprint(java.lang.String name)
Gets a named footprint.

Parameters:
name - the name of the footprint
Returns:
the footprint

getName

public java.lang.String getName()
Gets the name of this footprint.

Specified by:
getName in interface Footprint
Returns:
the name

getDisplayName

public java.lang.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 javax.swing.Icon 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(java.awt.Point[] points)
Gets the footprint mark.

Specified by:
getMark in interface Footprint
Parameters:
points - a Point array
Returns:
the mark

getHitShapes

public java.awt.Shape[] getHitShapes()
Gets the hit shapes.

Specified by:
getHitShapes in interface Footprint
Returns:
the hit shapes

setStroke

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

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

getStroke

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

Specified by:
getStroke in interface Footprint
Returns:
the stroke

setLineWidth

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

Parameters:
w - the desired line width

setColor

public void setColor(java.awt.Color color)
Sets the color.

Specified by:
setColor in interface Footprint
Parameters:
color - the desired color

getColor

public java.awt.Color getColor()
Gets the color.

Specified by:
getColor in interface Footprint
Returns:
the color

getShape

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

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