org.opensourcephysics.cabrillo.tracker
Class CircleFootprint

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

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

A CircleFootprint returns a circle for a Point[] of length 1.


Field Summary
protected  int alpha
           
protected static float boldStrokeSize
           
protected  java.awt.geom.Ellipse2D center
           
protected  java.awt.geom.Ellipse2D circle
           
protected  java.awt.Color color
           
protected  org.opensourcephysics.cabrillo.tracker.CircleFootprint.CircleDialog dialog
           
protected  java.awt.Shape highlight
           
protected  java.awt.Color highlightColor
           
protected  java.awt.BasicStroke highlightStroke
           
protected  java.awt.Shape[] hitShapes
           
protected  java.lang.String name
           
protected  java.awt.Shape outline
           
protected  boolean outlined
           
protected  java.awt.BasicStroke outlineStroke
           
protected static float plainStrokeSize
           
protected  int prevRadius
           
protected  boolean prevSpot
           
protected  float prevStrokeSize
           
protected  int r
           
protected  java.awt.Shape spot
           
protected  boolean spotted
           
protected  java.awt.geom.AffineTransform transform
           
 
Constructor Summary
CircleFootprint(java.lang.String name, int radius)
          Constructs a CircleFootprint.
 
Method Summary
protected  java.lang.Object clone()
          Clones a CircleFootprint.
 java.awt.Color getColor()
          Gets the color.
 java.lang.String getDisplayName()
          Gets the display name of the footprint.
static Footprint 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.lang.String getProperties()
          Gets the properties for saving.
 java.awt.Shape getShape(java.awt.Point[] points)
          Gets the fill shape for a specified point.
 java.awt.BasicStroke getStroke()
          Gets the stroke.
 void setAlpha(int alpha)
          Sets the alpha of the fill.
 void setColor(java.awt.Color color)
          Sets the color.
 void setOutlined(boolean outline)
          Sets the outlined flag.
 void setProperties(java.lang.String props)
          Sets the properties when loading.
 void setRadius(int radius)
          Sets the radius.
 void setSpotShown(boolean drawSpot)
          Sets the spotted flag.
 void setStroke(java.awt.BasicStroke stroke)
          Sets the stroke.
 void showProperties(TTrack track)
          Shows the properties dialog.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plainStrokeSize

protected static float plainStrokeSize

boldStrokeSize

protected static float boldStrokeSize

name

protected java.lang.String name

circle

protected java.awt.geom.Ellipse2D circle

center

protected java.awt.geom.Ellipse2D center

highlight

protected java.awt.Shape highlight

outline

protected java.awt.Shape outline

spot

protected java.awt.Shape spot

transform

protected java.awt.geom.AffineTransform transform

color

protected java.awt.Color color

highlightColor

protected java.awt.Color highlightColor

hitShapes

protected java.awt.Shape[] hitShapes

highlightStroke

protected java.awt.BasicStroke highlightStroke

outlineStroke

protected java.awt.BasicStroke outlineStroke

outlined

protected boolean outlined

spotted

protected boolean spotted

alpha

protected int alpha

dialog

protected org.opensourcephysics.cabrillo.tracker.CircleFootprint.CircleDialog dialog

r

protected int r

prevRadius

protected int prevRadius

prevStrokeSize

protected float prevStrokeSize

prevSpot

protected boolean prevSpot
Constructor Detail

CircleFootprint

public CircleFootprint(java.lang.String name,
                       int radius)
Constructs a CircleFootprint.

Parameters:
name - the name
radius - radius of the footprint
Method Detail

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Clones a CircleFootprint.

Overrides:
clone in class java.lang.Object
Returns:
the clone
Throws:
java.lang.CloneNotSupportedException

getFootprint

public static Footprint 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.

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

getStroke

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

Specified by:
getStroke in interface Footprint
Returns:
the stroke

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

setRadius

public void setRadius(int radius)
Sets the radius.

Parameters:
radius - the radius

setOutlined

public void setOutlined(boolean outline)
Sets the outlined flag.

Parameters:
outline - true to draw an outline around the circle

setSpotShown

public void setSpotShown(boolean drawSpot)
Sets the spotted flag.

Parameters:
drawSpot - true to draw a spot at the center of the circle

setAlpha

public void setAlpha(int alpha)
Sets the alpha of the fill.

Parameters:
alpha - 0 for transparent, 255 for solid

getProperties

public java.lang.String getProperties()
Gets the properties for saving.

Returns:
the properties "r outline spot bold"

setProperties

public void setProperties(java.lang.String props)
Sets the properties when loading.

Parameters:
props - the properties "r outline spot bold"

showProperties

public void showProperties(TTrack track)
Shows the properties dialog.

Parameters:
track - the track using this footprint

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