Class PointMass
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.PointMass
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,Drawable
,Interactive
,Measurable
,Trackable
- Direct Known Subclasses:
CenterOfMass
,ParticleModel
A PointMass tracks the position, velocity and acceleration of a point mass.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Inner class containing the position data for a single frame number.Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
TTrack.NameDialog, TTrack.StepArray, TTrack.TextLineLabel, TTrack.TrackDecimalField, TTrack.TrackNumberField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected JMenu
protected JMenuItem
protected static final Derivative
protected int
protected Footprint
protected JMenu
protected Footprint[]
protected int
protected JMenuItem
protected JMenuItem
protected JMenuItem
protected JCheckBoxMenuItem
protected boolean
protected static final int
protected static final BounceDerivatives
protected int
protected static final String[]
protected Object[]
protected boolean
protected static final String[]
protected static final int
protected static final int
protected static final String[]
protected static final String[]
protected boolean
protected static boolean
protected boolean
protected boolean
protected double
protected NumberField
protected JLabel
protected static final double
protected Component
protected int[]
protected boolean
protected GeneralPath
protected Stroke
protected boolean
protected boolean[]
protected boolean
protected JMenuItem
protected static final Derivative
protected int
protected NumberField[][]
protected JMenu
protected Footprint
protected JMenu
protected Footprint[]
protected JMenuItem
protected JMenuItem
protected JCheckBoxMenuItem
protected boolean
protected double[]
protected boolean
protected double[]
Fields inherited from class org.opensourcephysics.cabrillo.tracker.TTrack
angleField, angleLabel, angleSeparator, attachmentNames, attachments, autoAdvance, autoAdvanceItem, autoTrackerMarking, circleFootprintListener, clearStepsItem, closeButton, colorItem, constantsLoadedFromXML, customNumberFormats, dataBuilderItem, dataDescriptions, dataFrames, dataProp, datasetManager, dataValid, defaultColors, defaultFootprint, deleteStepItem, deleteTrackItem, description, descriptionItem, enabled, fieldBorder, fixedItem, footprint, footprintListener, footprintMenu, footprints, formatAngleMouseListener, formatMouseListener, hint, HINT_STEP_ADDED_OR_REMOVED, HINT_STEPS_SELECTED, initialized, isMarking, keyFrames, labelFont, locked, lockedItem, magField, magLabel, magSeparator, markByDefault, markByDefaultItem, name, nameDialog, nameItem, nextID, NOMAP, NOMAPS, NOVARA, NOVARS, numberFields, partName, points, positionFields, preferredColumnOrder, properties, PROPERTY_TTRACK_COLOR, PROPERTY_TTRACK_DATA, PROPERTY_TTRACK_FOOTPRINT, PROPERTY_TTRACK_FORMAT, PROPERTY_TTRACK_LOCKED, PROPERTY_TTRACK_MASS, PROPERTY_TTRACK_MODELEND, PROPERTY_TTRACK_MODELSTART, PROPERTY_TTRACK_NAME, PROPERTY_TTRACK_STEP, PROPERTY_TTRACK_STEPS, PROPERTY_TTRACK_TEXTCOLUMN, PROPERTY_TTRACK_VISIBLE, refreshDataLater, skippedStepWarningCheckbox, skippedStepWarningDialog, skippedStepWarningOn, skippedStepWarningTextpane, stepLabel, steps, stepSeparator, stepSizeWhenFirstMarked, stepValueLabel, targetIndex, textColumnEntries, textColumnNames, tField, tframe, tLabel, toolbarPointComponents, toolbarTrackComponents, tp, trailLength, trailVisible, trailVisibleItem, tSeparator, ttype, tValueLabel, TYPE_CALIBRATION, TYPE_CIRCLEFITTER, TYPE_COORDAXES, TYPE_LINEPROFILE, TYPE_OFFSETORIGIN, TYPE_PERSPECTIVE, TYPE_POINTMASS, TYPE_PROTRACTOR, TYPE_RGBREGION, TYPE_TAPEMEASURE, TYPE_UNKNOWN, TYPE_VECTOR, viewable, visible, visibleItem, xField, xLabel, xSeparator, xSpinner, yField, yLabel, ySeparator, ySpinner
Fields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoMarkAt
(int n, double x, double y) Used by autoTracker to mark a step at a match target position.protected void
Creates the GUI.protected void
createStep
(int n, double x, double y) Creates a new position step.protected void
deleteAutoTrackerStep
(int n) deleteStep
(int n) Overrides TTrack deleteStep method.void
dispose()
Disposes of resources when this track is deleted or cleared.void
draw
(DrawingPanel dp, Graphics _g) Overrides TTrack draw method.void
erase()
Overrides TTrack erase method to include v and a.void
Overrides TTrack erase method.findInteractive
(DrawingPanel dp, int xpix, int ypix) Overrides TTrack findInteractive method.protected TTrack.StepArray
Gets the acceleration StepArray for the specified panel.getAcceleration
(int n, Integer panelID) Gets the acceleration for the specified frame number and panel.Gets the current acceleration footprint.Gets the acceleration footprint choices.Step[]
getAccelerations
(Integer panelID) Gets the acceleration step array for the specified panel.getFootprint
(Step step) Gets the current footprint of the specified step.int
Gets the length of the footprints required by this track.getFootprints
(Step step) Gets the footprint choices.String[]
static XML.ObjectLoader
Returns an ObjectLoader to save and load data for this class.double
getMass()
Gets the mass.getMenu
(TrackerPanel panel, JMenu menu0) Returns a menu with items that control this track.getNextVisibleStep
(Step step, TrackerPanel panel) Gets next step after the specified step.Map<String,
NumberField[]> Gets a map of number fields by name.protected NumberField[]
getNumberFieldsForStep
(Step step) Returns an array of NumberFields {x, y, magnitude, angle} for a given step.getPreviousVisibleStep
(Step step, TrackerPanel panel) Gets step before the specified step.protected Object[]
Gets the rotational data.protected Object[]
getRotationData
(int startFrame, int stepCount) Gets the rotational data for a range of frame numbers.getStep
(TPoint point, TrackerPanel panel) Overrides TTrack getStep method.int
Gets the length of the steps created by this track.protected String
getTargetDescription
(int pointIndex) Returns a description of the point at a given index.getToolbarPointComponents
(TrackerPanel panel, TPoint point) Overrides TTrack getToolbarPointComponents method.Overrides TTrack getToolbarTrackComponents method.int
getUnfilledGapCount
(boolean emptyGapsOnly) Returns the number of unfilled gaps in the keyframesprotected TTrack.StepArray
Gets the velocity StepArray for the specified panel.Step[]
getVelocities
(Integer panelID) Gets the velocity step array for the specified panel.getVelocity
(int n, Integer panelID) Gets the velocity for the specified frame number and panel.Gets the current velocity footprint.Gets the velocity footprint choices.getWorldAcceleration
(int n, Integer panelID) Gets the world acceleration for the specified frame number and panel.getWorldPosition
(int n, TrackerPanel panel) Gets the world position for the specified frame number and panel.getWorldVelocity
(int n, TrackerPanel panel) Gets the world velocity for the specified frame number and panel.boolean
hasGaps()
Returns the number of gaps (filled or not) in the keyframesboolean
isAcceleration
(Step step) Determines whether the specified step is an acceleration step for this point mass.boolean
Gets the autofill flag.protected boolean
Determines if any point in this track is autotrackable.boolean
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
Gets whether the positions are visible on the specified panel.boolean
isStepVisible
(Step step, TrackerPanel panel) Reports whether or not the specified step is visible.boolean
Gets trace visibility.boolean
isVelocity
(Step step) Determines whether the specified step is a velocity step for this point mass.boolean
Gets whether the velocities are visible on the specified panel.void
Marks all missing steps by linear interpolation.void
markInterpolatedSteps
(PositionStep step, boolean refreshData) Marks steps by linear interpolation on both sides of a given step.boolean
markInterpolatedSteps
(PositionStep startStep, PositionStep endStep) Marks steps by linear interpolation between two existing steps.void
Responds to property change events.protected void
refreshData
(DatasetManager data, TrackerPanel panel) Refreshes the data.void
remark()
Overrides TTrack remark method.void
Overrides TTrack remark method.void
setAccelerationColor
(Color color) Sets the acceleration color.void
Sets the acceleration footprint.void
setAccelerationFootprints
(Footprint[] choices) Sets the acceleration footprint choices.void
setAlgorithm
(int type) Sets the derivative algorithm type.protected void
setAnglesInRadians
(boolean radians) Sets the display format for angles.void
setAutoFill
(boolean autofill) Sets the autofill flag.void
setAVisible
(TrackerPanel panel, boolean visible) Shows and hides accelerations on the specified panel.void
setAVisibleOnAll
(boolean visible) Sets whether accelerations are visible on all tracker panels.void
Overrides TTrack setColor method.void
setFontLevel
(int level) Sets the font level.void
setFootprint
(String name, Step step) Sets the footprint to the specified choice.void
setLabelsVisible
(TrackerPanel panel, boolean visible) Sets the visibility of labels.protected void
setMarking
(boolean marking) Sets the marking flag.void
setMass
(double mass) Sets the mass.void
setPositionVisible
(TrackerPanel panel, 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
setTrackerPanel
(TrackerPanel panel) Adds events for TrackerPanel.void
setVelocityColor
(Color color) Sets the velocity color.void
setVelocityFootprint
(String name) Sets the velocity footprint.void
setVelocityFootprints
(Footprint[] choices) Sets the velocity footprint choices.void
setVisible
(boolean visible) Shows and hides this track.void
setVVisible
(TrackerPanel panel, 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
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 panel, int frameNumber) Updates velocity and acceleration steps around a give frame number on a TrackerPanel.protected void
updateDerivatives
(TrackerPanel panel, 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
addFixedItem, addFootprint, addListener, addListenerNCF, addPanelEvents, addStepListener, addTextColumn, assembleMenu, clearColumns, convertTextToDataColumn, createAllVariables, createWarningDialog, delete, delete, finalize, fireStepsChanged, getAllVariables, getAttachmentDescription, getAttachmentLength, getAttachments, getBaseTrackName, getBaseTypeInt, getColor, getCustomFormatPatterns, getData, getData, getDataDescription, getDataName, getDefaultFormatPatterns, getDefaultFormatPatterns, getDescription, getFootprint, getFootprintName, getFootprints, getFormatPatterns, getFrameForData, getIcon, getID, getMarkedPoint, getMarkingCursor, getMenuItems, getMessage, getName, getName, getNameDialog, getPlotViews, getPreferredDataOrder, getProperty, getPropertyNames, getSkippedStepWarningDialog, getStep, getSteps, getStepSizeWarningDialog, getTableViews, getTargetIndex, getTextColumnEntry, getTextColumnNames, getTrack, getTrailLength, getValues, getVarFormatPattern, getVariableDimensions, getVariablesFromFormatterDisplayName, getX, getXMax, getXMin, getY, getYMax, getYMin, initialize, invalidateData, isAttached, isAutoAdvance, isAutoTrackable, isDataValid, isDependent, isEmpty, isEnabled, isFullyAttached, isLocked, isMarkByDefault, isMarking, isMeasured, isStepComplete, isTrailVisible, isViewable, isVisible, loadAttachmentsFromNames, refreshAttachments, refreshAttachmentsLater, refreshData, refreshDecimalSeparators, removeActiveTrack, removeDeleteTrackItem, removeListener, removeListenerNCF, removePanelEvents, removeStepListener, removeTextColumn, renameTextColumn, repaint, repaint, repaintAll, repaintStep, restorePatterns, savePatterns, setActive, setAutoAdvance, setColorToDefault, setDefaultNameAndColor, setDescription, setEnabled, setFixedPosition, setFootprint, setFootprints, setFootprints, setFormatPattern, setInitialFormatPatterns, setLocked, setMarkByDefault, setName, setProperty, setTargetIndex, setTargetIndex, setTargetIndex, setTextColumnEntry, setTrailLength, setTrailVisible, setViewable, setX, setXY, setY, showAnglePopup, showFormatPopup, toString, updateListenerVisible
Methods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensourcephysics.display.Interactive
isInteractive
-
Field Details
-
FINITE_DIFF
protected static final int FINITE_DIFF- See Also:
-
BOUNCE_DETECT
protected static final int BOUNCE_DETECT- See Also:
-
FINITE_DIFF_VSPILL2
protected static final int FINITE_DIFF_VSPILL2- See Also:
-
MINIMUM_MASS
protected static final double MINIMUM_MASS- See Also:
-
vDeriv
-
aDeriv
-
bounceDerivs
-
dataVariables
-
fieldVariables
-
formatVariables
-
formatMap
-
formatDescriptionMap
-
footprintNames
-
allVariables
-
isAutoKeyDown
protected static boolean isAutoKeyDown -
mass
protected double mass -
vFootprints
-
vFootprint
-
aFootprints
-
aFootprint
-
xVisibleOnAll
protected boolean xVisibleOnAll -
vVisibleOnAll
protected boolean vVisibleOnAll -
aVisibleOnAll
protected boolean aVisibleOnAll -
labelsVisible
protected boolean labelsVisible -
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
-
skippedSteps
-
isAutofill
protected boolean isAutofill -
showfilledSteps
protected boolean showfilledSteps -
vectorFields
-
massLabel
-
massField
-
mSeparator
-
velocityMenu
-
accelerationMenu
-
vColorItem
-
aColorItem
-
vFootprintMenu
-
aFootprintMenu
-
vTailsToOriginItem
-
vTailsToPositionItem
-
aTailsToOriginItem
-
aTailsToPositionItem
-
autotrackItem
-
vVisibleItem
-
aVisibleItem
-
vAtOrigin
protected boolean vAtOrigin -
aAtOrigin
protected boolean aAtOrigin -
traceVisible
protected boolean traceVisible -
trace
-
traceStroke
-
drawsTrace
protected boolean drawsTrace -
loading
protected boolean loading
-
-
Constructor Details
-
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 Details
-
getFormatVariables
- Specified by:
getFormatVariables
in classTTrack
-
getFormatMap
- Specified by:
getFormatMap
in classTTrack
-
getFormatDescMap
- Specified by:
getFormatDescMap
in classTTrack
-
getBaseType
- Specified by:
getBaseType
in classTTrack
-
getVarDimsImpl
- Specified by:
getVarDimsImpl
in classTTrack
-
setColor
Overrides TTrack setColor method. -
setVelocityColor
Sets the velocity color.- Parameters:
color
- the desired color
-
setAccelerationColor
Sets the acceleration color.- Parameters:
color
- the desired color
-
createStep
Creates a new position step.- Specified by:
createStep
in classTTrack
- Parameters:
n
- the frame numberx
- the x coordinate in image spacey
- the y coordinate in image space- Returns:
- the new step
-
deleteStep
Overrides TTrack deleteStep method.- Overrides:
deleteStep
in classTTrack
- Parameters:
n
- the frame number- Returns:
- the deleted step
-
deleteAutoTrackerStep
protected void deleteAutoTrackerStep(int n) -
getStep
Overrides TTrack getStep method. -
getNextVisibleStep
Gets next step after the specified step. May return null.- Overrides:
getNextVisibleStep
in classTTrack
- Parameters:
step
- the steppanel
- the tracker panel- Returns:
- the next step
-
getPreviousVisibleStep
Gets step before the specified step. May return null.- Overrides:
getPreviousVisibleStep
in classTTrack
- Parameters:
step
- the steppanel
- 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 classTTrack
- Returns:
- the footprint length
-
isAutoTrackable
protected boolean isAutoTrackable()Determines if any point in this track is autotrackable.- Overrides:
isAutoTrackable
in classTTrack
- Returns:
- true if autotrackable
-
autoMarkAt
Description copied from class:TTrack
Used by autoTracker to mark a step at a match target position.- Overrides:
autoMarkAt
in classTTrack
- Parameters:
n
- the frame numberx
- the x target coordinate in image spacey
- the y target coordinate in image space- Returns:
- the TPoint that was automarked
-
getFootprintLength
public int getFootprintLength()Gets the length of the footprints required by this track.- Specified by:
getFootprintLength
in classTTrack
- Returns:
- the footprint length
-
getVelocityFootprints
Gets the velocity footprint choices.- Returns:
- the velocity footprint choices
-
setVelocityFootprints
Sets the velocity footprint choices.- Parameters:
choices
- the velocity footprint choices
-
getVelocityFootprint
Gets the current velocity footprint.- Returns:
- the velocity footprint
-
setVelocityFootprint
Sets the velocity footprint.- Parameters:
name
- the name of the desired footprint
-
getAccelerationFootprints
Gets the acceleration footprint choices.- Returns:
- the acceleration footprint choices
-
setAccelerationFootprints
Sets the acceleration footprint choices.- Parameters:
choices
- the acceleration footprint choices
-
getAccelerationFootprint
Gets the current acceleration footprint.- Returns:
- the acceleration footprint
-
setAccelerationFootprint
Sets the acceleration footprint.- Parameters:
name
- the name of the desired footprint
-
getFootprints
Gets the footprint choices. Overrides TTrack.- Overrides:
getFootprints
in classTTrack
- Parameters:
step
- the step that identifies the step array- Returns:
- the array of Footprints available
-
setFootprint
Sets the footprint to the specified choice. Overrides TTrack.- Overrides:
setFootprint
in classTTrack
- Parameters:
name
- the name of the desired footprintstep
- the step that identifies the step array
-
getFootprint
Gets the current footprint of the specified step. Overrides TTrack.- Overrides:
getFootprint
in classTTrack
- Parameters:
step
- the step that identifies the step array- Returns:
- the footprint
-
setMarking
protected void setMarking(boolean marking) Sets the marking flag. Flag should be true when ready to be marked by user.- Overrides:
setMarking
in classTTrack
- Parameters:
marking
- true when marking
-
getMass
public double getMass()Gets the mass.- Returns:
- the mass
-
setMass
public void setMass(double mass) Sets the mass.- Parameters:
mass
- the mass
-
setFontLevel
public void setFontLevel(int level) Sets the font level.- Overrides:
setFontLevel
in classTTrack
- Parameters:
level
- the desired font level
-
getWorldPosition
Gets the world position for the specified frame number and panel. May return null;- Parameters:
n
- the frame numberpanel
- the tracker panel- Returns:
- a Point2D containing the position components
-
getWorldVelocity
Gets the world velocity for the specified frame number and panel. May return null;- Parameters:
n
- the frame numberpanel
- the tracker panel- Returns:
- a Point2D containing the velocity components
-
getWorldAcceleration
Gets the world acceleration for the specified frame number and panel. May return null.- Parameters:
n
- the frame numberpanel
- 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
-
isAutofill
public boolean isAutofill()Gets the autofill flag.- Returns:
- true if autofill is on
-
setAutoFill
public void setAutoFill(boolean autofill) Sets the autofill flag.- Parameters:
autofill
- true to turn on autofill
-
hasGaps
public boolean hasGaps()Returns the number of gaps (filled or not) in the keyframes- Returns:
- the gap count
-
getUnfilledGapCount
public int getUnfilledGapCount(boolean emptyGapsOnly) Returns the number of unfilled gaps in the keyframes- Returns:
- the unfilled gap count
-
markAllInterpolatedSteps
public void markAllInterpolatedSteps()Marks all missing steps by linear interpolation. -
markInterpolatedSteps
Marks steps by linear interpolation on both sides of a given step.- Parameters:
step
- the steprefreshData
- true to update derivatives
-
markInterpolatedSteps
Marks steps by linear interpolation between two existing steps. Removes steps if isAutofill is false.- Parameters:
startStep
- the start stependStep
- the end step- Returns:
- true if changed (step added or removed)
-
dispose
public void dispose()Description copied from class:TTrack
Disposes of resources when this track is deleted or cleared. -
getTargetDescription
Returns a description of the point at a given index. Used by AutoTracker.- Overrides:
getTargetDescription
in classTTrack
- Parameters:
pointIndex
- the points[] index- Returns:
- the description
-
refreshData
Refreshes the data.- Overrides:
refreshData
in classTTrack
- Parameters:
data
- the DatasetManagerpanel
- the tracker panel
-
draw
Overrides TTrack draw method. -
findInteractive
Overrides TTrack findInteractive method.- Specified by:
findInteractive
in interfaceInteractive
- Overrides:
findInteractive
in classTTrack
- Parameters:
dp
- the drawing panelxpix
- the x pixel position on the panelypix
- the y pixel position on the panel- Returns:
- the first step or motion vector that is hit
-
setVisible
public void setVisible(boolean visible) Shows and hides this track.- Overrides:
setVisible
in classTTrack
- Parameters:
visible
-true
to show this track
-
isStepVisible
Reports whether or not the specified step is visible.- Overrides:
isStepVisible
in classTTrack
- Parameters:
step
- the steppanel
- 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
Shows and hides velocities on the specified panel.- Parameters:
panel
- the tracker panelvisible
-true
to show velocities
-
isVVisible
public boolean isVVisible()Gets whether the velocities are visible on the specified panel.- Parameters:
panel
- 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
Determines whether the specified step is a position step.- Parameters:
step
- the step- Returns:
true
if the step is a position
-
setPositionVisible
Shows and hides positions on the specified panel.- Parameters:
panel
- the tracker panelvisible
-true
to show positions
-
isPositionVisible
public boolean isPositionVisible()Gets whether the positions are visible on the specified panel.- Parameters:
panel
- the tracker panel- Returns:
true
if positions are visible
-
getVelocity
Gets the velocity for the specified frame number and panel.- Parameters:
n
- the frame numberpanel
- the tracker panel- Returns:
- the velocity
-
getVelocities
Gets the velocity step array for the specified panel.- Parameters:
panel
- the tracker panel- Returns:
- the velocity step array
-
isVelocity
Determines whether the specified step is a velocity step for this point mass.- 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
Shows and hides accelerations on the specified panel.- Parameters:
panel
- the tracker panelvisible
-true
to show accelerations
-
isAVisible
public boolean isAVisible()Gets whether the accelerations are visible on the specified panel.- Parameters:
panel
- the tracker panel- Returns:
true
if accelerations are visible
-
getAcceleration
Gets the acceleration for the specified frame number and panel.- Parameters:
n
- the frame numberpanel
- the tracker panel- Returns:
- the acceleration vector
-
getAccelerations
Gets the acceleration step array for the specified panel.- Parameters:
panel
- the tracker panel- Returns:
- the acceleration step array
-
isAcceleration
Determines whether the specified step is an acceleration step for this point mass.- Parameters:
step
- the step- Returns:
true
if the step is an acceleration VectorStep
-
setLabelsVisible
Sets the visibility of labels.- Parameters:
panel
- a tracker panelvisible
-true
to show all labels
-
isLabelsVisible
Gets the labels visibility.- Parameters:
panel
- the tracker panel- Returns:
true
if labels are visible
-
getNumberFieldsForStep
Description copied from class:TTrack
Returns an array of NumberFields {x, y, magnitude, angle} for a given step.- Overrides:
getNumberFieldsForStep
in classTTrack
- Parameters:
step
- the step- Returns:
- the number fields
-
setAnglesInRadians
protected void setAnglesInRadians(boolean radians) Description copied from class:TTrack
Sets the display format for angles.- Overrides:
setAnglesInRadians
in classTTrack
- Parameters:
radians
-true
for radians, false for degrees
-
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 framestepCount
- 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
Updates velocity and acceleration steps around a give frame number on a TrackerPanel.- Parameters:
panel
- the TrackerPanelframeNumber
- the frame number
-
updateDerivatives
Updates velocity and acceleration steps for a specified start frame and step count.- Parameters:
panel
- the TrackerPanelstartFrame
- the start framestepCount
- the step count
-
getRotationData
Gets the rotational data.- Returns:
- Object[] {theta, omega, alpha}
-
getRotationData
Gets the rotational data for a range of frame numbers.- Parameters:
startFrame
- the start framestepCount
- the number of steps- Returns:
- Object[] {theta, omega, alpha}
-
erase
public void erase()Overrides TTrack erase method to include v and a. -
remark
public void remark()Overrides TTrack remark method. -
erase
Overrides TTrack erase method. -
remark
Overrides TTrack remark method. -
setTrackerPanel
Adds events for TrackerPanel.- Overrides:
setTrackerPanel
in classTTrack
- Parameters:
panel
- the new TrackerPanel
-
propertyChange
Responds to property change events.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classTTrack
- Parameters:
e
- the property change event
-
getMenu
Returns a menu with items that control this track. -
getToolbarTrackComponents
Overrides TTrack getToolbarTrackComponents method.- Overrides:
getToolbarTrackComponents
in classTTrack
- Parameters:
panel
- the tracker panel- Returns:
- a list of components
-
getToolbarPointComponents
Overrides TTrack getToolbarPointComponents method.- Overrides:
getToolbarPointComponents
in classTTrack
- Parameters:
panel
- the tracker panelpoint
- the TPoint- Returns:
- a list of components
-
getNumberFields
Description copied from class:TTrack
Gets a map of number fields by name.- Overrides:
getNumberFields
in classTTrack
- Returns:
- a map of name to NumberField.
-
getLoader
Returns an ObjectLoader to save and load data for this class.- Returns:
- the object loader
-
createGUI
protected void createGUI()Creates the GUI. -
createMenuIfNecessary
protected void createMenuIfNecessary() -
getVArray
Gets the velocity StepArray for the specified panel.- Parameters:
panel
- the tracker panel- Returns:
- the velocity StepArray
-
getAArray
Gets the acceleration StepArray for the specified panel.- Parameters:
panel
- the tracker panel- Returns:
- the acceleration StepArray
-