|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.PointMass
public class PointMass
A PointMass tracks the position, velocity and acceleration of a point mass.
| Nested Class Summary |
|---|
| 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 Derivative |
aDeriv
|
protected int |
aDerivSpill
|
protected Footprint |
aFootprint
|
protected Footprint[] |
aFootprints
|
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 java.lang.String[] |
dataDescriptions
|
protected java.lang.Object[] |
derivData
|
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 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
|
| 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, a and the autoTracker. |
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. |
java.lang.String |
getDataDescription(int index)
Gets the description of a data variable. |
int |
getDefaultAutoTrackerIndex()
Gets the default step point index. |
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. |
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 |
isStepComplete(int n)
Returns true if the step at the specified frame number is complete. |
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 |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double mass
protected Footprint[] vFootprints
protected Footprint vFootprint
protected Footprint[] aFootprints
protected Footprint aFootprint
protected java.util.Map<TrackerPanel,TTrack.StepArray> vMap
protected java.util.Map<TrackerPanel,TTrack.StepArray> aMap
protected java.util.Map<TrackerPanel,java.lang.Boolean> xVisMap
protected java.util.Map<TrackerPanel,java.lang.Boolean> vVisMap
protected java.util.Map<TrackerPanel,java.lang.Boolean> aVisMap
protected boolean xVisibleOnAll
protected boolean vVisibleOnAll
protected boolean aVisibleOnAll
protected Derivative vDeriv
protected int vDerivSpill
protected Derivative aDeriv
protected int aDerivSpill
protected int[] params
protected double[] xData
protected double[] yData
protected boolean[] validData
protected java.lang.Object[] derivData
protected javax.swing.JLabel massLabel
protected NumberField massField
protected java.awt.Component mSeparator
protected javax.swing.JMenu positionFootprintMenu
protected javax.swing.JMenu velocFootprintMenu
protected javax.swing.JMenu accelFootprintMenu
protected javax.swing.JMenu velocityMenu
protected javax.swing.JMenu accelerationMenu
protected javax.swing.JMenuItem vTailsToOriginItem
protected javax.swing.JMenuItem vTailsToPositionItem
protected javax.swing.JMenuItem aTailsToOriginItem
protected javax.swing.JMenuItem aTailsToPositionItem
protected javax.swing.JMenuItem autotrackItem
protected javax.swing.JCheckBoxMenuItem vVisibleItem
protected javax.swing.JCheckBoxMenuItem aVisibleItem
protected java.lang.String[] dataDescriptions
protected boolean vAtOrigin
protected boolean aAtOrigin
protected boolean traceVisible
protected java.awt.geom.GeneralPath trace
protected java.awt.Stroke traceStroke
| Constructor Detail |
|---|
public PointMass()
public PointMass(double mass)
mass - the mass| Method Detail |
|---|
public void setColor(java.awt.Color color)
setColor in class TTrackcolor - the desired color
public Step createStep(int n,
double x,
double y)
createStep in class TTrackn - the frame numberx - the x coordinate in image spacey - the y coordinate in image space
public Step deleteStep(int n)
deleteStep in class TTrackn - the frame number
public Step getStep(TPoint point,
TrackerPanel trackerPanel)
getStep in class TTrackpoint - a TPointtrackerPanel - the tracker panel
public Step getNextVisibleStep(Step step,
TrackerPanel trackerPanel)
getNextVisibleStep in class TTrackstep - the steptrackerPanel - the tracker panel
public Step getPreviousVisibleStep(Step step,
TrackerPanel trackerPanel)
getPreviousVisibleStep in class TTrackstep - the steptrackerPanel - the tracker panel
public int getStepLength()
getStepLength in class TTrackpublic int getDefaultAutoTrackerIndex()
getDefaultAutoTrackerIndex in class TTrackprotected boolean isAutoTrackable()
isAutoTrackable in class TTrackpublic int getFootprintLength()
getFootprintLength in class TTrackpublic Footprint[] getVelocityFootprints()
public void setVelocityFootprints(Footprint[] choices)
choices - the velocity footprint choicespublic Footprint getVelocityFootprint()
public void setVelocityFootprint(java.lang.String name)
name - the name of the desired footprintpublic Footprint[] getAccelerationFootprints()
public void setAccelerationFootprints(Footprint[] choices)
choices - the acceleration footprint choicespublic Footprint getAccelerationFootprint()
public void setAccelerationFootprint(java.lang.String name)
name - the name of the desired footprintpublic Footprint[] getFootprints(Step step)
getFootprints in class TTrackstep - the step that identifies the step array
public void setFootprint(java.lang.String name,
Step step)
setFootprint in class TTrackname - the name of the desired footprintstep - the step that identifies the step arraypublic Footprint getFootprint(Step step)
getFootprint in class TTrackstep - the step that identifies the step array
public double getMass()
public void setMass(double mass)
mass - the masspublic boolean isStepComplete(int n)
isStepComplete in class TTrackn - the frame number
true if the step is complete
public java.awt.geom.Point2D getWorldPosition(int n,
TrackerPanel trackerPanel)
n - the frame numbertrackerPanel - the tracker panel
public java.awt.geom.Point2D getWorldVelocity(int n,
TrackerPanel trackerPanel)
n - the frame numbertrackerPanel - the tracker panel
public java.awt.geom.Point2D getWorldAcceleration(int n,
TrackerPanel trackerPanel)
n - the frame numbertrackerPanel - the tracker panel
protected java.lang.String getTargetDescription(int pointIndex)
getTargetDescription in class TTrackpointIndex - the points[] index
protected void refreshData(DatasetManager data,
TrackerPanel trackerPanel)
refreshData in class TTrackdata - the DatasetManagertrackerPanel - the tracker panelpublic java.lang.String getDataDescription(int index)
getDataDescription in class TTrackindex - the dataset index
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in interface Drawabledraw in class TTrackpanel - the drawing panel requesting the drawing_g - the graphics context on which to draw
public Interactive findInteractive(DrawingPanel panel,
int xpix,
int ypix)
findInteractive in interface InteractivefindInteractive in class TTrackpanel - the drawing panelxpix - the x pixel position on the panelypix - the y pixel position on the panel
public boolean isStepVisible(Step step,
TrackerPanel trackerPanel)
isStepVisible in class TTrackstep - the steptrackerPanel - the tracker panel
true if the step is visiblepublic void setVVisibleOnAll(boolean visible)
visible - true to show velocities
public void setVVisible(TrackerPanel trackerPanel,
boolean visible)
trackerPanel - the tracker panelvisible - true to show velocitiespublic boolean isVVisible(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
true if velocities are visiblepublic void setPositionVisibleOnAll(boolean visible)
visible - true to show positionspublic void setTraceVisible(boolean visible)
visible - true to show tracespublic boolean isTraceVisible()
true if traces are visiblepublic boolean isPosition(Step step)
step - the step
true if the step is a position
public void setPositionVisible(TrackerPanel trackerPanel,
boolean visible)
trackerPanel - the tracker panelvisible - true to show positionspublic boolean isPositionVisible(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
true if positions are visible
public VectorStep getVelocity(int n,
TrackerPanel trackerPanel)
n - the frame numbertrackerPanel - the tracker panel
public Step[] getVelocities(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
public boolean isVelocity(Step step)
step - the step
true if the step is a velocity VectorSteppublic void setAVisibleOnAll(boolean visible)
visible - true to show accelerations
public void setAVisible(TrackerPanel trackerPanel,
boolean visible)
trackerPanel - the tracker panelvisible - true to show accelerationspublic boolean isAVisible(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
true if accelerations are visible
public VectorStep getAcceleration(int n,
TrackerPanel trackerPanel)
n - the frame numbertrackerPanel - the tracker panel
public Step[] getAccelerations(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
public boolean isAcceleration(Step step)
step - the step
true if the step is an acceleration VectorStep
public void setLabelsVisible(TrackerPanel panel,
boolean visible)
panel - the tracker panelvisible - true to show all labelspublic boolean isLabelsVisible(TrackerPanel panel)
panel - the tracker panel
true if labels are visibleprotected void updateDerivatives()
protected void updateDerivatives(int startFrame,
int stepCount)
startFrame - the start framestepCount - the step countprotected void updateDerivatives(int frameNumber)
frameNumber - the frame number
protected void updateDerivatives(TrackerPanel trackerPanel,
int frameNumber)
trackerPanel - the TrackerPanelframeNumber - the frame numberprotected void updateDerivatives(TrackerPanel trackerPanel)
trackerPanel - the TrackerPanel
protected void updateDerivatives(TrackerPanel trackerPanel,
int startFrame,
int stepCount)
trackerPanel - the TrackerPanelstartFrame - the start framestepCount - the step countprotected java.lang.Object[] getRotationData()
protected java.lang.Object[] getRotationData(int startFrame,
int stepCount)
public void erase()
erase in class TTrackpublic void remark()
remark in class TTrackpublic void erase(TrackerPanel trackerPanel)
erase in class TTracktrackerPanel - the tracker panelpublic void remark(TrackerPanel trackerPanel)
remark in class TTracktrackerPanel - the tracker panelpublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class TTracke - the property change eventpublic javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
getMenu in class TTracktrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
getToolbarTrackComponents in class TTracktrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarPointComponents(TrackerPanel trackerPanel,
TPoint point)
getToolbarPointComponents in class TTracktrackerPanel - the tracker panelpoint - the TPoint
public static XML.ObjectLoader getLoader()
protected void createGUI()
protected TTrack.StepArray getVArray(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
protected TTrack.StepArray getAArray(TrackerPanel trackerPanel)
trackerPanel - the tracker panel
protected void cleanup()
cleanup in class TTrack
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||