예제 #1
0
 /**
  * Sets the start frame for this model. Also sets the initial time to the video clip time at the
  * start frame.
  *
  * @param n the desired start frame
  */
 public void setStartFrame(int n) {
   VideoClip clip = trackerPanel.getPlayer().getVideoClip();
   n = Math.max(n, clip.getFirstFrameNumber()); // not less than first frame
   int end = clip.getLastFrameNumber();
   n = Math.min(n, end); // not greater than last frame
   n = Math.min(n, getEndFrame()); // not greater than endFrame
   if (n == startFrame) return;
   startFrame = n;
   refreshInitialTime();
   lastValidFrame = -1;
   refreshSteps();
   trackerPanel.repaint();
   firePropertyChange("model_start", null, getStartFrame()); // $NON-NLS-1$
 }
예제 #2
0
 /**
  * Sets the end frame for this model.
  *
  * @param n the desired end frame
  */
 public void setEndFrame(int n) {
   VideoClip clip = trackerPanel.getPlayer().getVideoClip();
   int end = clip.getLastFrameNumber();
   n = Math.max(n, 0); // not less than zero
   n = Math.max(n, getStartFrame()); // not less than startFrame
   if (n == getEndFrame()) return;
   endFrame = n < end ? n : Integer.MAX_VALUE;
   if (n < lastValidFrame) {
     trimSteps();
   } else {
     refreshSteps();
   }
   trackerPanel.repaint();
   firePropertyChange("model_end", null, getEndFrame()); // $NON-NLS-1$
 }