org.opensourcephysics.cabrillo.tracker
Class PointMass

java.lang.Object
  extended by org.opensourcephysics.cabrillo.tracker.TTrack
      extended by org.opensourcephysics.cabrillo.tracker.PointMass
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, Drawable, Interactive, Measurable, Trackable
Direct Known Subclasses:
CenterOfMass, ParticleModel

public class PointMass
extends TTrack

A PointMass tracks the position, velocity and acceleration of a point mass.

Author:
Douglas Brown

Nested Class Summary
static class PointMass.FrameData
          Inner class containing the position data for a single frame number.
 
Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
TTrack.StepArray
 
Field Summary
protected  boolean aAtOrigin
           
protected  javax.swing.JMenu accelerationMenu
           
protected  javax.swing.JMenu accelFootprintMenu
           
protected static Derivative aDeriv
           
protected  int aDerivSpill
           
protected  Footprint aFootprint
           
protected  Footprint[] aFootprints
           
protected  int algorithm
           
protected  java.util.Map<TrackerPanel,TTrack.StepArray> aMap
           
protected  javax.swing.JMenuItem aTailsToOriginItem
           
protected  javax.swing.JMenuItem aTailsToPositionItem
           
protected  javax.swing.JMenuItem autotrackItem
           
protected  javax.swing.JCheckBoxMenuItem aVisibleItem
           
protected  boolean aVisibleOnAll
           
protected  java.util.Map<TrackerPanel,java.lang.Boolean> aVisMap
           
protected static int BOUNCE_DETECT
           
protected static BounceDerivatives bounceDerivs
           
protected  int bounceDerivsSpill
           
protected  java.lang.Object[] derivData
           
protected static int FINITE_DIFF
           
protected  double mass
           
protected  NumberField massField
           
protected  javax.swing.JLabel massLabel
           
protected  java.awt.Component mSeparator
           
protected  int[] params
           
protected  javax.swing.JMenu positionFootprintMenu
           
protected  java.awt.geom.GeneralPath trace
           
protected  java.awt.Stroke traceStroke
           
protected  boolean traceVisible
           
protected  boolean[] validData
           
protected  boolean vAtOrigin
           
protected static Derivative vDeriv
           
protected  int vDerivSpill
           
protected  javax.swing.JMenu velocFootprintMenu
           
protected  javax.swing.JMenu velocityMenu
           
protected  Footprint vFootprint
           
protected  Footprint[] vFootprints
           
protected  java.util.Map<TrackerPanel,TTrack.StepArray> vMap
           
protected  javax.swing.JMenuItem vTailsToOriginItem
           
protected  javax.swing.JMenuItem vTailsToPositionItem
           
protected  javax.swing.JCheckBoxMenuItem vVisibleItem
           
protected  boolean vVisibleOnAll
           
protected  java.util.Map<TrackerPanel,java.lang.Boolean> vVisMap
           
protected  double[] xData
           
protected  boolean xVisibleOnAll
           
protected  java.util.Map<TrackerPanel,java.lang.Boolean> xVisMap
           
protected  double[] yData
           
 
Fields inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
alphabet, angleField, angleLabel, angleSeparator, attachments, autoAdvance, autoAdvanceItem, autoTrackerMarking, circleFootprintListener, clearStepsItem, closeButton, colorItem, constantsLoadedFromXML, data, dataBuilderItem, dataDescriptions, dataFrames, dataProp, dataValid, defaultColors, defaultFootprint, deleteStepItem, deleteTrackItem, description, descriptionItem, enabled, fieldBorder, footprint, footprintListener, footprintMenu, footprints, frc, hint, isMarking, keyFrames, labelFont, locked, lockedItem, magField, magLabel, magSeparator, markByDefault, markByDefaultItem, menu, name, nameAction, nameDialog, nameField, nameItem, panels, partName, point, preferredColumnOrder, properties, refreshDataLater, skippedStepWarningCheckbox, skippedStepWarningDialog, skippedStepWarningOn, skippedStepWarningTextpane, stepLabel, steps, stepSeparator, stepSizeWhenFirstMarked, stepValueLabel, support, targetIndex, tField, tLabel, toolbarPointComponents, toolbarTrackComponents, trackerPanel, trailLength, trailVisible, trailVisibleItem, tSeparator, tValueLabel, viewable, visible, visibleItem, worldBounds, xField, xLabel, xSeparator, xSpinner, yField, yLabel, ySeparator, ySpinner
 
Constructor Summary
PointMass()
          Constructs a PointMass with mass 1.0.
PointMass(double mass)
          Constructs a PointMass with specified mass.
 
Method Summary
protected  void cleanup()
          Cleans up associated resources when this track is deleted or cleared.
protected  void createGUI()
          Creates the GUI.
 Step createStep(int n, double x, double y)
          Creates a new position step.
 Step deleteStep(int n)
          Overrides TTrack deleteStep method.
 void draw(DrawingPanel panel, java.awt.Graphics _g)
          Overrides TTrack draw method.
 void erase()
          Overrides TTrack erase method to include v and a.
 void erase(TrackerPanel trackerPanel)
          Overrides TTrack erase method.
 Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
          Overrides TTrack findInteractive method.
protected  TTrack.StepArray getAArray(TrackerPanel trackerPanel)
          Gets the acceleration StepArray for the specified panel.
 VectorStep getAcceleration(int n, TrackerPanel trackerPanel)
          Gets the acceleration for the specified frame number and panel.
 Footprint getAccelerationFootprint()
          Gets the current acceleration footprint.
 Footprint[] getAccelerationFootprints()
          Gets the acceleration footprint choices.
 Step[] getAccelerations(TrackerPanel trackerPanel)
          Gets the acceleration step array for the specified panel.
 Footprint getFootprint(Step step)
          Gets the current footprint of the specified step.
 int getFootprintLength()
          Gets the length of the footprints required by this track.
 Footprint[] getFootprints(Step step)
          Gets the footprint choices.
static XML.ObjectLoader getLoader()
          Returns an ObjectLoader to save and load data for this class.
 double getMass()
          Gets the mass.
 javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
          Returns a menu with items that control this track.
 Step getNextVisibleStep(Step step, TrackerPanel trackerPanel)
          Gets next step after the specified step.
 Step getPreviousVisibleStep(Step step, TrackerPanel trackerPanel)
          Gets step before the specified step.
protected  java.lang.Object[] getRotationData()
          Gets the rotational data.
protected  java.lang.Object[] getRotationData(int startFrame, int stepCount)
          Gets the rotational data for a range of frame numbers.
 Step getStep(TPoint point, TrackerPanel trackerPanel)
          Overrides TTrack getStep method.
 int getStepLength()
          Gets the length of the steps created by this track.
protected  java.lang.String getTargetDescription(int pointIndex)
          Returns a description of the point at a given index.
 java.util.ArrayList<java.awt.Component> getToolbarPointComponents(TrackerPanel trackerPanel, TPoint point)
          Overrides TTrack getToolbarPointComponents method.
 java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
          Overrides TTrack getToolbarTrackComponents method.
protected  TTrack.StepArray getVArray(TrackerPanel trackerPanel)
          Gets the velocity StepArray for the specified panel.
 Step[] getVelocities(TrackerPanel trackerPanel)
          Gets the velocity step array for the specified panel.
 VectorStep getVelocity(int n, TrackerPanel trackerPanel)
          Gets the velocity for the specified frame number and panel.
 Footprint getVelocityFootprint()
          Gets the current velocity footprint.
 Footprint[] getVelocityFootprints()
          Gets the velocity footprint choices.
 java.awt.geom.Point2D getWorldAcceleration(int n, TrackerPanel trackerPanel)
          Gets the world acceleration for the specified frame number and panel.
 java.awt.geom.Point2D getWorldPosition(int n, TrackerPanel trackerPanel)
          Gets the world position for the specified frame number and panel.
 java.awt.geom.Point2D getWorldVelocity(int n, TrackerPanel trackerPanel)
          Gets the world velocity for the specified frame number and panel.
 boolean isAcceleration(Step step)
          Determines whether the specified step is an acceleration step.
protected  boolean isAutoTrackable()
          Determines if any point in this track is autotrackable.
 boolean isAVisible(TrackerPanel trackerPanel)
          Gets whether the accelerations are visible on the specified panel.
 boolean isLabelsVisible(TrackerPanel panel)
          Gets the labels visibility.
 boolean isPosition(Step step)
          Determines whether the specified step is a position step.
 boolean isPositionVisible(TrackerPanel trackerPanel)
          Gets whether the positions are visible on the specified panel.
 boolean isStepVisible(Step step, TrackerPanel trackerPanel)
          Reports whether or not the specified step is visible.
 boolean isTraceVisible()
          Gets trace visibility.
 boolean isVelocity(Step step)
          Determines whether the specified step is a velocity step.
 boolean isVVisible(TrackerPanel trackerPanel)
          Gets whether the velocities are visible on the specified panel.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
protected  void refreshData(DatasetManager data, TrackerPanel trackerPanel)
          Refreshes the data.
 void remark()
          Overrides TTrack remark method.
 void remark(TrackerPanel trackerPanel)
          Overrides TTrack remark method.
 void setAccelerationFootprint(java.lang.String name)
          Sets the aceleration footprint.
 void setAccelerationFootprints(Footprint[] choices)
          Sets the acceleration footprint choices.
 void setAlgorithm(int type)
          Sets the derivative algorithm type.
 void setAVisible(TrackerPanel trackerPanel, boolean visible)
          Shows and hides accelerations on the specified panel.
 void setAVisibleOnAll(boolean visible)
          Sets whether accelerations are visible on all tracker panels.
 void setColor(java.awt.Color color)
          Overrides TTrack setColor method.
 void setFootprint(java.lang.String name, Step step)
          Sets the footprint to the specified choice.
 void setLabelsVisible(TrackerPanel panel, boolean visible)
          Sets the visibility of labels on the specified panel.
 void setMass(double mass)
          Sets the mass.
 void setPositionVisible(TrackerPanel trackerPanel, boolean visible)
          Shows and hides positions on the specified panel.
 void setPositionVisibleOnAll(boolean visible)
          Sets whether positions are visible on all tracker panels.
 void setTraceVisible(boolean visible)
          Sets whether traces are visible.
 void setVelocityFootprint(java.lang.String name)
          Sets the velocity footprint.
 void setVelocityFootprints(Footprint[] choices)
          Sets the velocity footprint choices.
 void setVVisible(TrackerPanel trackerPanel, boolean visible)
          Shows and hides velocities on the specified panel.
 void setVVisibleOnAll(boolean visible)
          Sets whether velocities are visible on all tracker panels.
protected  void updateDerivatives()
          Updates all velocity and acceleration steps on all TrackerPanels.
protected  void updateDerivatives(int frameNumber)
          Updates velocity and acceleration steps around a give frame number.
protected  void updateDerivatives(int startFrame, int stepCount)
          Updates velocity and acceleration steps for a specified start frame and step count.
protected  void updateDerivatives(TrackerPanel trackerPanel)
          Updates all velocity and acceleration steps on a TrackerPanel.
protected  void updateDerivatives(TrackerPanel trackerPanel, int frameNumber)
          Updates velocity and acceleration steps around a give frame number on a TrackerPanel.
protected  void updateDerivatives(TrackerPanel trackerPanel, int startFrame, int stepCount)
          Updates velocity and acceleration steps for a specified start frame and step count.
 
Methods inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
addFootprint, addPropertyChangeListener, addPropertyChangeListener, autoMarkAt, createWarningDialog, delete, firePropertyChange, getColor, getData, getDataDescription, getDataName, getDescription, getFootprint, getFootprints, getFrameForData, getMarkedPoint, getMarkingCursor, getMessage, getName, getPreferredDataOrder, getProperty, getPropertyNames, getSkippedStepWarningDialog, getStep, getSteps, getStepSizeWarningDialog, getTargetIndex, getTrailLength, getWorldBounds, getX, getXMax, getXMax, getXMin, getXMin, getY, getYMax, getYMax, getYMin, getYMin, isAutoAdvance, isAutoTrackable, isDependent, isEmpty, isEnabled, isLocked, isMarkByDefault, isMeasured, isStepComplete, isTrailVisible, isViewable, isVisible, refreshData, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, setAnglesInRadians, setAutoAdvance, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFootprint, setFootprints, setFootprints, setLocked, setMarkByDefault, setMarking, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTrackerPanel, setTrailLength, setTrailVisible, setViewable, setVisible, setX, setXY, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FINITE_DIFF

protected static final int FINITE_DIFF
See Also:
Constant Field Values

BOUNCE_DETECT

protected static final int BOUNCE_DETECT
See Also:
Constant Field Values

vDeriv

protected static Derivative vDeriv

aDeriv

protected static Derivative aDeriv

bounceDerivs

protected static BounceDerivatives bounceDerivs

mass

protected double mass

vFootprints

protected Footprint[] vFootprints

vFootprint

protected Footprint vFootprint

aFootprints

protected Footprint[] aFootprints

aFootprint

protected Footprint aFootprint

vMap

protected java.util.Map<TrackerPanel,TTrack.StepArray> vMap

aMap

protected java.util.Map<TrackerPanel,TTrack.StepArray> aMap

xVisMap

protected java.util.Map<TrackerPanel,java.lang.Boolean> xVisMap

vVisMap

protected java.util.Map<TrackerPanel,java.lang.Boolean> vVisMap

aVisMap

protected java.util.Map<TrackerPanel,java.lang.Boolean> aVisMap

xVisibleOnAll

protected boolean xVisibleOnAll

vVisibleOnAll

protected boolean vVisibleOnAll

aVisibleOnAll

protected boolean aVisibleOnAll

algorithm

protected int algorithm

vDerivSpill

protected int vDerivSpill

aDerivSpill

protected int aDerivSpill

bounceDerivsSpill

protected int bounceDerivsSpill

params

protected int[] params

xData

protected double[] xData

yData

protected double[] yData

validData

protected boolean[] validData

derivData

protected java.lang.Object[] derivData

massLabel

protected javax.swing.JLabel massLabel

massField

protected NumberField massField

mSeparator

protected java.awt.Component mSeparator

positionFootprintMenu

protected javax.swing.JMenu positionFootprintMenu

velocFootprintMenu

protected javax.swing.JMenu velocFootprintMenu

accelFootprintMenu

protected javax.swing.JMenu accelFootprintMenu

velocityMenu

protected javax.swing.JMenu velocityMenu

accelerationMenu

protected javax.swing.JMenu accelerationMenu

vTailsToOriginItem

protected javax.swing.JMenuItem vTailsToOriginItem

vTailsToPositionItem

protected javax.swing.JMenuItem vTailsToPositionItem

aTailsToOriginItem

protected javax.swing.JMenuItem aTailsToOriginItem

aTailsToPositionItem

protected javax.swing.JMenuItem aTailsToPositionItem

autotrackItem

protected javax.swing.JMenuItem autotrackItem

vVisibleItem

protected javax.swing.JCheckBoxMenuItem vVisibleItem

aVisibleItem

protected javax.swing.JCheckBoxMenuItem aVisibleItem

vAtOrigin

protected boolean vAtOrigin

aAtOrigin

protected boolean aAtOrigin

traceVisible

protected boolean traceVisible

trace

protected java.awt.geom.GeneralPath trace

traceStroke

protected java.awt.Stroke traceStroke
Constructor Detail

PointMass

public PointMass()
Constructs a PointMass with mass 1.0.


PointMass

public PointMass(double mass)
Constructs a PointMass with specified mass.

Parameters:
mass - the mass
Method Detail

setColor

public void setColor(java.awt.Color color)
Overrides TTrack setColor method.

Overrides:
setColor in class TTrack
Parameters:
color - the desired color

createStep

public Step createStep(int n,
                       double x,
                       double y)
Creates a new position step.

Specified by:
createStep in class TTrack
Parameters:
n - the frame number
x - the x coordinate in image space
y - the y coordinate in image space
Returns:
the new step

deleteStep

public Step deleteStep(int n)
Overrides TTrack deleteStep method.

Overrides:
deleteStep in class TTrack
Parameters:
n - the frame number
Returns:
the deleted step

getStep

public Step getStep(TPoint point,
                    TrackerPanel trackerPanel)
Overrides TTrack getStep method.

Overrides:
getStep in class TTrack
Parameters:
point - a TPoint
trackerPanel - the tracker panel
Returns:
the step containing the TPoint

getNextVisibleStep

public Step getNextVisibleStep(Step step,
                               TrackerPanel trackerPanel)
Gets next step after the specified step. May return null.

Overrides:
getNextVisibleStep in class TTrack
Parameters:
step - the step
trackerPanel - the tracker panel
Returns:
the next step

getPreviousVisibleStep

public Step getPreviousVisibleStep(Step step,
                                   TrackerPanel trackerPanel)
Gets step before the specified step. May return null.

Overrides:
getPreviousVisibleStep in class TTrack
Parameters:
step - the step
trackerPanel - the tracker panel
Returns:
the previous step

getStepLength

public int getStepLength()
Gets the length of the steps created by this track.

Specified by:
getStepLength in class TTrack
Returns:
the footprint length

isAutoTrackable

protected boolean isAutoTrackable()
Determines if any point in this track is autotrackable.

Overrides:
isAutoTrackable in class TTrack
Returns:
true if autotrackable

getFootprintLength

public int getFootprintLength()
Gets the length of the footprints required by this track.

Specified by:
getFootprintLength in class TTrack
Returns:
the footprint length

getVelocityFootprints

public Footprint[] getVelocityFootprints()
Gets the velocity footprint choices.

Returns:
the velocity footprint choices

setVelocityFootprints

public void setVelocityFootprints(Footprint[] choices)
Sets the velocity footprint choices.

Parameters:
choices - the velocity footprint choices

getVelocityFootprint

public Footprint getVelocityFootprint()
Gets the current velocity footprint.

Returns:
the velocity footprint

setVelocityFootprint

public void setVelocityFootprint(java.lang.String name)
Sets the velocity footprint.

Parameters:
name - the name of the desired footprint

getAccelerationFootprints

public Footprint[] getAccelerationFootprints()
Gets the acceleration footprint choices.

Returns:
the acceleration footprint choices

setAccelerationFootprints

public void setAccelerationFootprints(Footprint[] choices)
Sets the acceleration footprint choices.

Parameters:
choices - the acceleration footprint choices

getAccelerationFootprint

public Footprint getAccelerationFootprint()
Gets the current acceleration footprint.

Returns:
the acceleration footprint

setAccelerationFootprint

public void setAccelerationFootprint(java.lang.String name)
Sets the aceleration footprint.

Parameters:
name - the name of the desired footprint

getFootprints

public Footprint[] getFootprints(Step step)
Gets the footprint choices. Overrides TTrack.

Overrides:
getFootprints in class TTrack
Parameters:
step - the step that identifies the step array
Returns:
the array of Footprints available

setFootprint

public void setFootprint(java.lang.String name,
                         Step step)
Sets the footprint to the specified choice. Overrides TTrack.

Overrides:
setFootprint in class TTrack
Parameters:
name - the name of the desired footprint
step - the step that identifies the step array

getFootprint

public Footprint getFootprint(Step step)
Gets the current footprint of the specified step. Overrides TTrack.

Overrides:
getFootprint in class TTrack
Parameters:
step - the step that identifies the step array
Returns:
the footprint

getMass

public double getMass()
Gets the mass.

Returns:
the mass

setMass

public void setMass(double mass)
Sets the mass.

Parameters:
mass - the mass

getWorldPosition

public java.awt.geom.Point2D getWorldPosition(int n,
                                              TrackerPanel trackerPanel)
Gets the world position for the specified frame number and panel. May return null;

Parameters:
n - the frame number
trackerPanel - the tracker panel
Returns:
a Point2D containing the position components

getWorldVelocity

public java.awt.geom.Point2D getWorldVelocity(int n,
                                              TrackerPanel trackerPanel)
Gets the world velocity for the specified frame number and panel. May return null;

Parameters:
n - the frame number
trackerPanel - the tracker panel
Returns:
a Point2D containing the velocity components

getWorldAcceleration

public java.awt.geom.Point2D getWorldAcceleration(int n,
                                                  TrackerPanel trackerPanel)
Gets the world acceleration for the specified frame number and panel. May return null;

Parameters:
n - the frame number
trackerPanel - the tracker panel
Returns:
a Point2D containing the acceleration components

setAlgorithm

public void setAlgorithm(int type)
Sets the derivative algorithm type. Defined types: FINITE_DIFF, BOUNCE_DETECT

Parameters:
type - one of the defined algorithm types

getTargetDescription

protected java.lang.String getTargetDescription(int pointIndex)
Returns a description of the point at a given index. Used by AutoTracker.

Overrides:
getTargetDescription in class TTrack
Parameters:
pointIndex - the points[] index
Returns:
the description

refreshData

protected void refreshData(DatasetManager data,
                           TrackerPanel trackerPanel)
Refreshes the data.

Overrides:
refreshData in class TTrack
Parameters:
data - the DatasetManager
trackerPanel - the tracker panel

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics _g)
Overrides TTrack draw method.

Specified by:
draw in interface Drawable
Overrides:
draw in class TTrack
Parameters:
panel - the drawing panel requesting the drawing
_g - the graphics context on which to draw

findInteractive

public Interactive findInteractive(DrawingPanel panel,
                                   int xpix,
                                   int ypix)
Overrides TTrack findInteractive method.

Specified by:
findInteractive in interface Interactive
Overrides:
findInteractive in class TTrack
Parameters:
panel - the drawing panel
xpix - the x pixel position on the panel
ypix - the y pixel position on the panel
Returns:
the first step or motion vector that is hit

isStepVisible

public boolean isStepVisible(Step step,
                             TrackerPanel trackerPanel)
Reports whether or not the specified step is visible.

Overrides:
isStepVisible in class TTrack
Parameters:
step - the step
trackerPanel - the tracker panel
Returns:
true if the step is visible

setVVisibleOnAll

public void setVVisibleOnAll(boolean visible)
Sets whether velocities are visible on all tracker panels.

Parameters:
visible - true to show velocities

setVVisible

public void setVVisible(TrackerPanel trackerPanel,
                        boolean visible)
Shows and hides velocities on the specified panel.

Parameters:
trackerPanel - the tracker panel
visible - true to show velocities

isVVisible

public boolean isVVisible(TrackerPanel trackerPanel)
Gets whether the velocities are visible on the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
true if velocities are visible

setPositionVisibleOnAll

public void setPositionVisibleOnAll(boolean visible)
Sets whether positions are visible on all tracker panels.

Parameters:
visible - true to show positions

setTraceVisible

public void setTraceVisible(boolean visible)
Sets whether traces are visible.

Parameters:
visible - true to show traces

isTraceVisible

public boolean isTraceVisible()
Gets trace visibility.

Returns:
true if traces are visible

isPosition

public boolean isPosition(Step step)
Determines whether the specified step is a position step.

Parameters:
step - the step
Returns:
true if the step is a position

setPositionVisible

public void setPositionVisible(TrackerPanel trackerPanel,
                               boolean visible)
Shows and hides positions on the specified panel.

Parameters:
trackerPanel - the tracker panel
visible - true to show positions

isPositionVisible

public boolean isPositionVisible(TrackerPanel trackerPanel)
Gets whether the positions are visible on the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
true if positions are visible

getVelocity

public VectorStep getVelocity(int n,
                              TrackerPanel trackerPanel)
Gets the velocity for the specified frame number and panel.

Parameters:
n - the frame number
trackerPanel - the tracker panel
Returns:
the velocity

getVelocities

public Step[] getVelocities(TrackerPanel trackerPanel)
Gets the velocity step array for the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
the velocity step array

isVelocity

public boolean isVelocity(Step step)
Determines whether the specified step is a velocity step.

Parameters:
step - the step
Returns:
true if the step is a velocity VectorStep

setAVisibleOnAll

public void setAVisibleOnAll(boolean visible)
Sets whether accelerations are visible on all tracker panels.

Parameters:
visible - true to show accelerations

setAVisible

public void setAVisible(TrackerPanel trackerPanel,
                        boolean visible)
Shows and hides accelerations on the specified panel.

Parameters:
trackerPanel - the tracker panel
visible - true to show accelerations

isAVisible

public boolean isAVisible(TrackerPanel trackerPanel)
Gets whether the accelerations are visible on the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
true if accelerations are visible

getAcceleration

public VectorStep getAcceleration(int n,
                                  TrackerPanel trackerPanel)
Gets the acceleration for the specified frame number and panel.

Parameters:
n - the frame number
trackerPanel - the tracker panel
Returns:
the acceleration vector

getAccelerations

public Step[] getAccelerations(TrackerPanel trackerPanel)
Gets the acceleration step array for the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
the acceleration step array

isAcceleration

public boolean isAcceleration(Step step)
Determines whether the specified step is an acceleration step.

Parameters:
step - the step
Returns:
true if the step is an acceleration VectorStep

setLabelsVisible

public void setLabelsVisible(TrackerPanel panel,
                             boolean visible)
Sets the visibility of labels on the specified panel.

Parameters:
panel - the tracker panel
visible - true to show all labels

isLabelsVisible

public boolean isLabelsVisible(TrackerPanel panel)
Gets the labels visibility.

Parameters:
panel - the tracker panel
Returns:
true if labels are visible

updateDerivatives

protected void updateDerivatives()
Updates all velocity and acceleration steps on all TrackerPanels.


updateDerivatives

protected void updateDerivatives(int startFrame,
                                 int stepCount)
Updates velocity and acceleration steps for a specified start frame and step count.

Parameters:
startFrame - the start frame
stepCount - the step count

updateDerivatives

protected void updateDerivatives(int frameNumber)
Updates velocity and acceleration steps around a give frame number.

Parameters:
frameNumber - the frame number

updateDerivatives

protected void updateDerivatives(TrackerPanel trackerPanel,
                                 int frameNumber)
Updates velocity and acceleration steps around a give frame number on a TrackerPanel.

Parameters:
trackerPanel - the TrackerPanel
frameNumber - the frame number

updateDerivatives

protected void updateDerivatives(TrackerPanel trackerPanel)
Updates all velocity and acceleration steps on a TrackerPanel.

Parameters:
trackerPanel - the TrackerPanel

updateDerivatives

protected void updateDerivatives(TrackerPanel trackerPanel,
                                 int startFrame,
                                 int stepCount)
Updates velocity and acceleration steps for a specified start frame and step count.

Parameters:
trackerPanel - the TrackerPanel
startFrame - the start frame
stepCount - the step count

getRotationData

protected java.lang.Object[] getRotationData()
Gets the rotational data.

Returns:
Object[] {theta, omega, alpha}

getRotationData

protected java.lang.Object[] getRotationData(int startFrame,
                                             int stepCount)
Gets the rotational data for a range of frame numbers.

Parameters:
startFrame - the start frame
stepCount - the number of steps
Returns:
Object[] {theta, omega, alpha}

erase

public void erase()
Overrides TTrack erase method to include v and a.

Overrides:
erase in class TTrack

remark

public void remark()
Overrides TTrack remark method.

Overrides:
remark in class TTrack

erase

public void erase(TrackerPanel trackerPanel)
Overrides TTrack erase method.

Overrides:
erase in class TTrack
Parameters:
trackerPanel - the tracker panel

remark

public void remark(TrackerPanel trackerPanel)
Overrides TTrack remark method.

Overrides:
remark in class TTrack
Parameters:
trackerPanel - the tracker panel

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. PointMass listens for the following events: "transform" from TrackerPanel.

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

getMenu

public javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
Returns a menu with items that control this track.

Overrides:
getMenu in class TTrack
Parameters:
trackerPanel - the tracker panel
Returns:
a menu

getToolbarTrackComponents

public java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
Overrides TTrack getToolbarTrackComponents method.

Overrides:
getToolbarTrackComponents in class TTrack
Parameters:
trackerPanel - the tracker panel
Returns:
a list of components

getToolbarPointComponents

public java.util.ArrayList<java.awt.Component> getToolbarPointComponents(TrackerPanel trackerPanel,
                                                                         TPoint point)
Overrides TTrack getToolbarPointComponents method.

Overrides:
getToolbarPointComponents in class TTrack
Parameters:
trackerPanel - the tracker panel
point - the TPoint
Returns:
a list of components

getLoader

public static XML.ObjectLoader getLoader()
Returns an ObjectLoader to save and load data for this class.

Returns:
the object loader

createGUI

protected void createGUI()
Creates the GUI.


getVArray

protected TTrack.StepArray getVArray(TrackerPanel trackerPanel)
Gets the velocity StepArray for the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
the velocity StepArray

getAArray

protected TTrack.StepArray getAArray(TrackerPanel trackerPanel)
Gets the acceleration StepArray for the specified panel.

Parameters:
trackerPanel - the tracker panel
Returns:
the acceleration StepArray

cleanup

protected void cleanup()
Cleans up associated resources when this track is deleted or cleared.

Overrides:
cleanup in class TTrack