Package org.opensourcephysics.media.core
Interface DataTrack
- All Known Implementing Classes:
ParticleDataTrack
An interface for a Trackable object that gets its position (and optional time)
data from an external source. Since it is drawn on a TrackerPanel, DataTrack
includes methods related to the associated Video (start frame) and VideoPanel
as well as the Data (DataClip, source, time, etc).
- Author:
- Douglas Brown
-
Field Summary
FieldsFields inherited from interface org.opensourcephysics.media.core.Trackable
PROPERTY_ADJUSTING
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Adds a PropertyChangeListener.getData()
Gets the Data.Gets the DataClip, which defines the start index, stepcount and stride.double
Gets the data-based video frame duration in seconds if availableGets the source.int
Gets the video start frame at which the first data point is displayed.int
Gets the step in the videoclip at which the first data point is displayed.Gets the VideoPanel on which this DataTrack is drawn.double
Gets the data-based video start time in seconds if availableboolean
Determines if autopaste is enabled for this DataTrack.boolean
Determines if time is defined by the Data.void
Sets the Data for the track.void
setStartFrame
(int start) Sets the video start frame at which the first data point is displayed.void
setStartStep
(int start) Sets the step in the videoclip at which the first data point is displayed.Methods inherited from interface org.opensourcephysics.display.Drawable
draw, isInteractive
-
Field Details
-
PROPERTY_DATATRACK_STARTFRAME
- See Also:
-
-
Method Details
-
setStartFrame
void setStartFrame(int start) Sets the video start frame at which the first data point is displayed.- Parameters:
start
- the start frame number
-
getStartFrame
int getStartFrame()Gets the video start frame at which the first data point is displayed.- Returns:
- the start frame number
-
setStartStep
void setStartStep(int start) Sets the step in the videoclip at which the first data point is displayed.- Parameters:
start
- the start step number
-
getStartStep
int getStartStep()Gets the step in the videoclip at which the first data point is displayed.- Returns:
- the start step number
-
setData
Sets the Data for the track. Data must define "x" and "y" positions, and may define "t". Optional source may be a JPanel control panel.- Parameters:
data
- the Datasource
- a source object (may be null)- Throws:
Exception
-
getData
Data getData()Gets the Data.- Returns:
- the Data
-
getSource
Object getSource()Gets the source.- Returns:
- the source (may be null)
-
getDataClip
DataClip getDataClip()Gets the DataClip, which defines the start index, stepcount and stride.- Returns:
- the DataClip
-
getVideoPanel
VideoPanel getVideoPanel()Gets the VideoPanel on which this DataTrack is drawn.- Returns:
- the VideoPanel
-
addPropertyChangeListener
Adds a PropertyChangeListener.- Parameters:
listener
- the PropertyChangeListener
-
isTimeDataAvailable
boolean isTimeDataAvailable()Determines if time is defined by the Data.- Returns:
- true if time data is available
-
getVideoStartTime
double getVideoStartTime()Gets the data-based video start time in seconds if available- Returns:
- the start time, or Double.NaN if undefined
-
getFrameDuration
double getFrameDuration()Gets the data-based video frame duration in seconds if available- Returns:
- the frame duration, or Double.NaN if undefined
-
isAutoPasteEnabled
boolean isAutoPasteEnabled()Determines if autopaste is enabled for this DataTrack.- Returns:
- true if autopaste is enabled
-