Categories

I talked to Stonedahl about this yesterday, and he said it was interesting and that I should post it here. Our idea is that in manual tracking, every time you place a dot or circle marking the position of a chick, the video will automatically move forward by one time increment (1 second for us currently). However, we added in a time delay of half a second before the displayed frame updates so that the user can see where they placed the dot. Then, if they think it was placed badly, there's a redo button available that will reverse the time increment and show that previous frame with the dot placed.

The trick to making it work was not to use Thread.sleep() like we learned in CSC212 because JavaFX runs its update in a weird way chronologically where even if the placing the dot appears to be called first, the entire thread gets put to sleep before the dot is drawn and it never gets displayed before the displayed frame is updated. Instead, every time that mouse click occurs, a scheduled timer is created. Inside of that, we create a TimerTask object. Inside of that, we create and simultaneously call a run method that calls increment() where increment() is our method to update the displayed frame. I don't think I can post the full code here, so sorry if that's not clear, but I can probably show it to you in person if you're interested.