コード例 #1
0
ファイル: ClipControl.java プロジェクト: bozhink/Code-Chunks
 /**
  * Loads a VideoClip with data from an XMLControl.
  *
  * @param element the element
  * @param obj the object
  * @return the loaded object
  */
 public Object loadObject(XMLControl control, Object obj) {
   StepperClipControl clipControl = (StepperClipControl) obj;
   // set rate
   double rate = control.getDouble("rate"); // $NON-NLS-1$
   if (rate != Double.NaN) {
     clipControl.setRate(rate);
   }
   // set dt
   double dt = control.getDouble("delta_t"); // $NON-NLS-1$
   if (dt != Double.NaN) {
     clipControl.setFrameDuration(dt);
   }
   // set looping and playing
   clipControl.setLooping(control.getBoolean("looping")); // $NON-NLS-1$
   return obj;
 }
コード例 #2
0
ファイル: ClipControl.java プロジェクト: bozhink/Code-Chunks
 /**
  * Saves object data in an XMLControl.
  *
  * @param control the control to save to
  * @param obj the object to save
  */
 public void saveObject(XMLControl control, Object obj) {
   ClipControl clipControl = (StepperClipControl) obj;
   control.setValue("rate", clipControl.getRate()); // $NON-NLS-1$
   control.setValue("delta_t", clipControl.getMeanFrameDuration()); // $NON-NLS-1$
   if (clipControl.isLooping()) control.setValue("looping", true); // $NON-NLS-1$
 }