Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9fc1283
added video type ffmpeg
Apr 21, 2014
f4e2d1d
Remove xuggler from source code.
Oct 24, 2014
7fe53f7
Merge remote-tracking branch 'upstream/master'
Nov 15, 2014
3c6d943
Fix merging problems.
Nov 16, 2014
5d6b53e
Adjust start to use classpath in Linux
Dec 2, 2014
67231b5
Merge branch 'master' of github.com:OpenSourcePhysics/tracker
Jul 12, 2015
cceca9a
Fix override warnings because of some java classes became interfaces.
Jul 14, 2015
afe0dab
Fix encoding.
Jul 14, 2015
fe3805f
Fix download location for ffmpeg.
Jul 14, 2015
8ada657
Convert line endings to lf.
Sep 12, 2015
523ca13
Merge upstream/master 12.9.15.
Sep 12, 2015
a0f3250
Fix override errors. Add some files.
Sep 12, 2015
b6942e1
Fix startup process.
Sep 13, 2015
408f130
Merge branch 'master' of github.com:OpenSourcePhysics/tracker
May 4, 2016
65d8272
readd missing files Circle*
May 4, 2016
3532b8c
fix some problems
May 5, 2016
5d3a87f
Merge remote-tracking branch 'upstream/master'
Sep 20, 2016
15efb3a
fix some merging errors
Sep 20, 2016
c44fbe8
Merge remote-tracking branch 'upstream/master'
Oct 3, 2016
a780118
prevent tracker from restarting on linux
Jan 2, 2017
278560b
Merge remote-tracking branch 'upstream/master'
Oct 5, 2017
982d115
change xuggle to ffmpeg
Oct 5, 2017
52008ca
fix missing declaration of 2 buttons
Oct 5, 2017
343f08b
Merge branch 'master' of github.com:OpenSourcePhysics/tracker
Oct 7, 2018
7032677
fix translations Xuggle -> FFMPeg
Oct 7, 2018
2943d55
fix Xuggle -> FFMPeg, xuggle -> ffmpeg
Oct 7, 2018
bbe1b12
fix ffmpeg merging errors
Oct 7, 2018
3cd93d8
Merge remote-tracking branch 'upstream/master'
Nov 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Video analysis and modeling tool built on the Open Source Physics (OSP) framewor

This code requires the OSP Core Library available in the <a href="https://github.com/OpenSourcePhysics/osp" target="_blank">OpenSourcePhysics/osp</a> repository.

Optional Xuggle video engine support is available in the <a href="https://github.com/OpenSourcePhysics/video-engines" target="_blank">OpenSourcePhysics/video-engines</a> repository. Without a video engine Tracker will only open images (JPEG, PNG) and animated GIFs.
Optional video engine support (FFMPeg on Win/OSX/linux, QuickTime on Win/OSX) is available in the <a href="https://github.com/OpenSourcePhysics/video-engines" target="_blank">OpenSourcePhysics/video-engines</a> repository. Without a video engine Tracker will only open images (JPEG, PNG) and animated GIFs.

Note: Tracker includes classes to handle apple events that to compile require the Apple Java Extensions library (AppleJavaExtensions.jar) which can be downloaded <a href="http://physlets.org/tracker/code_libraries/AppleJavaExtensions.jar" target="_blank">here</a>.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected void reset() {
dt = trackerPanel.getPlayer().getMeanStepDuration() / (1000*tracePtsPerStep);
VideoClip clip = trackerPanel.getPlayer().getVideoClip();
// find last frame included in both model and clip
int end = Math.min(getEndFrame(), clip.getLastFrameNumber());
int end = Math.min(getEndFrame(), clip.getFrameCount()-1);
while (end>getStartFrame() && !clip.includesFrame(end)) {
end--;
}
Expand All @@ -119,7 +119,7 @@ protected void reset() {
// mark a step at firstFrameInClip
steps.setLength(firstFrameInClip+1);
PositionStep step = (PositionStep)getStep(firstFrameInClip);
for (int i = 0; i<steps.array.length; i++) {
for (int i = 0; i<steps.length; i++) {
if (i<firstFrameInClip)
steps.setStep(i, null);
else if (step==null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ public Dimension getPreferredSize() {
stepsButton = new JRadioButton();
tracksButton = new JRadioButton();
Action tracksOrStepsAction = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
if (refreshing) return;
CircleFitter fitter = (CircleFitter)TTrack.getTrack(trackID);
Expand All @@ -306,7 +305,6 @@ public void actionPerformed(ActionEvent e) {
relativeCheckbox = new JCheckBox();
relativeCheckbox.setSelected(false);
relativeCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (refreshing) return;
CircleFitter fitter = (CircleFitter)TTrack.getTrack(trackID);
Expand All @@ -319,7 +317,6 @@ public void actionPerformed(ActionEvent e) {

// range action, listener and fields
final Action frameRangeAction = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
CircleFitter fitter = (CircleFitter)TTrack.getTrack(trackID);
fitter.setAttachmentStartFrame(startField.getIntValue());
Expand Down
2 changes: 0 additions & 2 deletions src/org/opensourcephysics/cabrillo/tracker/CircleFitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public void focusLost(FocusEvent e) {
// originToCenter item
originToCenterItem = new JMenuItem();
originToCenterItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setCoordsOriginToCenter();
}
Expand All @@ -255,7 +254,6 @@ public void actionPerformed(ActionEvent e) {
// clearPoints item
clearPointsItem = new JMenuItem();
clearPointsItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
XMLControl control = new XMLControlElement(CircleFitter.this);
boolean changed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public Rectangle getBounds(boolean highlighted) {
*
* @return the hit shapes
*/
@Override
public Shape[] getHitShapes() {
return hitShapes.toArray(new Shape[hitShapes.size()]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ public Dimension getMaximumSize() {
return dim;
}

@Override
public void propertyChange(PropertyChangeEvent e) {
refreshSpinners();
// if (e.getPropertyName().equals("dataclip")) { //$NON-NLS-1$
Expand Down Expand Up @@ -323,7 +322,6 @@ class MappingGraphic implements Interactive {

GeneralPath path = new GeneralPath();

@Override
public void draw(DrawingPanel panel, Graphics g) {
VideoPanel vidPanel = dataTrack.getVideoPanel();
if (vidPanel==null) return;
Expand Down Expand Up @@ -519,72 +517,57 @@ public Shape[] getHitShapes() {
public Mark getMark(Point[] points) {
return new Mark() {

@Override
public void draw(Graphics2D g, boolean highlighted) {
}

@Override
public Rectangle getBounds(boolean highlighted) {
return null;
}

};
}

@Override
public double getXMin() {
return 0;
}

@Override
public double getXMax() {
return 100;
}

@Override
public double getYMin() {
return 0;
}

@Override
public double getYMax() {
return 100;
}

@Override
public boolean isMeasured() {
return true;
}

@Override
public Interactive findInteractive(DrawingPanel panel, int _xpix, int _ypix) {
return null;
}

@Override
public void setEnabled(boolean enabled) {}

@Override
public boolean isEnabled() {
return true;
}

@Override
public void setXY(double x, double y) {}

@Override
public void setX(double x) {
}

@Override
public void setY(double y) {}

@Override
public double getX() {
return 0;
}

@Override
public double getY() {
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public Dimension getMaximumSize() {
return dim;
}

@Override
public void propertyChange(PropertyChangeEvent e) {
refreshGUI();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void reset() {
models[i].lastValidFrame = firstFrameInClip;
models[i].steps.setLength(firstFrameInClip+1);
PositionStep step = (PositionStep)models[i].getStep(firstFrameInClip);
for (int j = 0; j < models[i].steps.array.length;j++) {
for (int j = 0; j < models[i].steps.length;j++) {
if (j<firstFrameInClip)
models[i].steps.setStep(j, null);
else if (step==null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ public static ExportVideoDialog getDialog(TrackerPanel panel) {
public static void refreshFormats() {
formats.clear();
formatDescriptions.clear();
// eliminate xuggle types if VideoIO engine is NONE
// eliminate ffmpeg types if VideoIO engine is NONE
ArrayList<VideoType> unwanted = new ArrayList<VideoType>();
boolean skipXuggle = VideoIO.getEngine().equals(VideoIO.ENGINE_NONE);
boolean skipFFMPeg = VideoIO.getEngine().equals(VideoIO.ENGINE_NONE);
for (String ext: VideoIO.VIDEO_EXTENSIONS) {
if (skipXuggle)
unwanted.add(VideoIO.getVideoType(VideoIO.ENGINE_XUGGLE, ext));
if (skipFFMPeg)
unwanted.add(VideoIO.getVideoType(VideoIO.ENGINE_FFMPEG, ext));
}
for (VideoType next: VideoIO.getVideoTypes()) {
if (next.canRecord() && !unwanted.contains(next)) {
Expand Down Expand Up @@ -589,7 +589,7 @@ public void setTrackerPanel(TrackerPanel panel) {
/**
* Gets the smallest acceptable dimension >= a specified width and height.
* This is a work-around to avoid image artifacts introduced by the converter
* in xuggle.
* in ffmpeg.
*
* @param w the desired width
* @param h the desired height
Expand All @@ -605,7 +605,7 @@ private Dimension getAcceptedDimension(int w, int h) {
}

/**
* Determines if a width and height are acceptable (for xuggle).
* Determines if a width and height are acceptable (for ffmpeg).
*
* @param w the width
* @param h the height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ public void dragExit(DropTargetEvent dte) {
dropList = null;
}

@Override
public void drop(DropTargetDropEvent e) {
public void drop(DropTargetDropEvent e) {
dropList = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ protected void initializeFunctionPanel() {
@Override
protected void reset() {
// clear existing steps
for (int i=0; i<steps.array.length; i++) {
for (int i=0; i<steps.length; i++) {
Step step = steps.getStep(i);
if (step!=null) {
step.erase();
Expand Down Expand Up @@ -1270,7 +1270,7 @@ protected void reset() {

// mark a step at firstFrameInVideoClip unless dataclip length is zero
steps.setLength(firstFrameInVideoClip+1);
for (int i = 0; i<steps.array.length; i++) {
for (int i = 0; i<steps.length; i++) {
if (i<firstFrameInVideoClip || index==-1)
steps.setStep(i, null);
else {
Expand All @@ -1292,13 +1292,11 @@ protected void reset() {
stepCounter = 0;
}

@Override
public void setData(Data data, Object source) throws Exception {
setData(data);
setSource(source);
}

@Override
public VideoPanel getVideoPanel() {
return trackerPanel;
}
Expand Down Expand Up @@ -1780,7 +1778,6 @@ class ComboIcon implements Icon {
shapeIcons = icons;
}

@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
if (shapeIcons.size()==1) {
shapeIcons.get(0).paintIcon(c, g, x, y);
Expand All @@ -1804,12 +1801,10 @@ public void paintIcon(Component c, Graphics g, int x, int y) {
}
}

@Override
public int getIconWidth() {
return shapeIcons.get(0).getIconWidth();
}

@Override
public int getIconHeight() {
return shapeIcons.get(0).getIconHeight();
}
Expand Down
28 changes: 14 additions & 14 deletions src/org/opensourcephysics/cabrillo/tracker/PointMass.java
Original file line number Diff line number Diff line change
Expand Up @@ -1893,10 +1893,10 @@ protected void updateDerivatives(TrackerPanel trackerPanel,
return;
VideoClip clip = trackerPanel.getPlayer().getVideoClip();
// initialize data arrays
if (xData.length < steps.array.length) {
derivData[1] = xData = new double[steps.array.length + 5];
derivData[2] = yData = new double[steps.array.length + 5];
derivData[3] = validData = new boolean[steps.array.length + 5];
if (xData.length < steps.length) {
derivData[1] = xData = new double[steps.length + 5];
derivData[2] = yData = new double[steps.length + 5];
derivData[3] = validData = new boolean[steps.length + 5];
}
// set up derivative parameters
params[1] = startFrame;
Expand Down Expand Up @@ -2042,12 +2042,12 @@ else if ( (int) (100 * a.getXComponent()) != (int) (100 * x) ||
*/
protected Object[] getRotationData() {
// initialize data arrays once, for all panels
if (xData.length < steps.array.length) {
derivData[1] = xData = new double[steps.array.length + 5];
derivData[2] = yData = new double[steps.array.length + 5];
derivData[3] = validData = new boolean[steps.array.length + 5];
if (xData.length < steps.length) {
derivData[1] = xData = new double[steps.length + 5];
derivData[2] = yData = new double[steps.length + 5];
derivData[3] = validData = new boolean[steps.length + 5];
}
for (int i = 0; i < steps.array.length; i++)
for (int i = 0; i < steps.length; i++)
validData[i] = false;
// set up derivative parameters
VideoClip clip = trackerPanel.getPlayer().getVideoClip();
Expand Down Expand Up @@ -2103,12 +2103,12 @@ protected Object[] getRotationData() {
*/
protected Object[] getRotationData(int startFrame, int stepCount) {
// initialize data arrays once, for all panels
if (xData.length < steps.array.length) {
derivData[1] = xData = new double[steps.array.length + 5];
derivData[2] = yData = new double[steps.array.length + 5];
derivData[3] = validData = new boolean[steps.array.length + 5];
if (xData.length < steps.length) {
derivData[1] = xData = new double[steps.length + 5];
derivData[2] = yData = new double[steps.length + 5];
derivData[3] = validData = new boolean[steps.length + 5];
}
for (int i = 0; i < steps.array.length; i++)
for (int i = 0; i < steps.length; i++)
validData[i] = false;
// set up derivative parameters
VideoClip clip = trackerPanel.getPlayer().getVideoClip();
Expand Down
Loading