org.opensourcephysics.cabrillo.tracker
Class ReferenceFrame

java.lang.Object
  extended by org.opensourcephysics.media.core.ImageCoordSystem
      extended by org.opensourcephysics.cabrillo.tracker.ReferenceFrame
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class ReferenceFrame
extends ImageCoordSystem
implements java.beans.PropertyChangeListener

A ReferenceFrame is an image coordinate system with its origin determined by the position of a PointMass.

Author:
Douglas Brown

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opensourcephysics.media.core.ImageCoordSystem
ImageCoordSystem.FrameData, ImageCoordSystem.Loader
 
Field Summary
 
Fields inherited from class org.opensourcephysics.media.core.ImageCoordSystem
decimal, firePropChange, sci, support
 
Constructor Summary
ReferenceFrame(ImageCoordSystem coords, PointMass originTrack)
          Constructs a ReferenceFrame with a default initial length.
 
Method Summary
 ImageCoordSystem getCoords()
          Gets the parent image coordinate system.
 PointMass getOriginTrack()
          Gets the origin track of this reference frame.
 boolean isLocked()
          Overrides isLocked method.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
 void setFixedOrigin(boolean fixed, int n)
          Overrides ImageCoordSystem setFixedOrigin method.
 void setLocked(boolean locked)
          Overrides setLocked method.
protected  void setOrigins()
          Sets the origins of the image coordinate system.
 
Methods inherited from class org.opensourcephysics.media.core.ImageCoordSystem
addPropertyChangeListener, addPropertyChangeListener, getAngle, getCosine, getDataString, getKeyFrames, getLength, getLoader, getOriginX, getOriginY, getScaleX, getScaleY, getSine, getToImageTransform, getToWorldTransform, imageToWorldX, imageToWorldXComponent, imageToWorldY, imageToWorldYComponent, isAdjusting, isFixedAngle, isFixedOrigin, isFixedScale, removePropertyChangeListener, removePropertyChangeListener, setAdjusting, setAllAngles, setAllCosineSines, setAllOriginsXY, setAllScalesX, setAllScalesXY, setAllScalesY, setAllValuesToFrame, setAngle, setCosineSine, setCosineSines, setFixedAngle, setFixedAngle, setFixedOrigin, setFixedScale, setFixedScale, setLength, setOriginsXY, setOriginXY, setScalesX, setScalesXY, setScalesY, setScaleX, setScaleXY, setScaleY, worldToImageX, worldToImageXComponent, worldToImageY, worldToImageYComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReferenceFrame

public ReferenceFrame(ImageCoordSystem coords,
                      PointMass originTrack)
Constructs a ReferenceFrame with a default initial length.

Parameters:
coords - the image coordinate system providing angle and scale data
originTrack - the point mass providing origin data
Method Detail

setFixedOrigin

public void setFixedOrigin(boolean fixed,
                           int n)
Overrides ImageCoordSystem setFixedOrigin method. Origin is never fixed for a reference frame.

Overrides:
setFixedOrigin in class ImageCoordSystem
Parameters:
fixed - ignored
n - the frame number

setLocked

public void setLocked(boolean locked)
Overrides setLocked method.

Overrides:
setLocked in class ImageCoordSystem
Parameters:
locked - true to lock the coordinate system

isLocked

public boolean isLocked()
Overrides isLocked method.

Overrides:
isLocked in class ImageCoordSystem
Returns:
true if this is locked

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. ReferenceFrame receives the following events: "step" and "mass" from PointMass (origin), and "transform" from ImageCoordSystem (angle and scale).

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - the property change event

getCoords

public ImageCoordSystem getCoords()
Gets the parent image coordinate system. The parent coords are returned after setting its angles and scales to match this.

Returns:
the parent image coordinate system

getOriginTrack

public PointMass getOriginTrack()
Gets the origin track of this reference frame.

Returns:
the point mass supplying origin data

setOrigins

protected void setOrigins()
Sets the origins of the image coordinate system.