Exemple #1
0
 /**
  * Sets the mass. Overrides PointMass method.
  *
  * @param mass the mass
  */
 public void setMass(double mass) {
   super.setMass(mass);
   mass = super.getMass();
   massField.setValue(mass);
   // refresh mass parameter in paramPanel if changed
   Parameter massParam = (Parameter) getParamEditor().getObject("m"); // $NON-NLS-1$
   if (massParam != null && massParam.getValue() != mass) {
     functionPanel.getParamEditor().setExpression("m", String.valueOf(mass), false); // $NON-NLS-1$
     refreshSteps();
   }
 }
Exemple #2
0
 /** Refreshes initial time parameter for this model. */
 protected void refreshInitialTime() {
   if (trackerPanel == null) return;
   double t0 = trackerPanel.getPlayer().getFrameTime(getStartFrame()) / 1000;
   String t = timeFormat.format(t0);
   Parameter param = (Parameter) getInitEditor().getObject("t"); // $NON-NLS-1$
   if (param.getValue() != t0) {
     boolean prev = refreshing;
     refreshing = true;
     getInitEditor().setExpression("t", t, false); // $NON-NLS-1$
     refreshing = prev;
   }
 }
Exemple #3
0
 /**
  * Gets the mass. Overrides PointMass method.
  *
  * @return the mass
  */
 public double getMass() {
   Parameter massParam = (Parameter) getParamEditor().getObject("m"); // $NON-NLS-1$
   if (massParam != null) return massParam.getValue();
   return super.getMass();
 }