MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / initialize

Method initialize

src/davidson/gr/ClassicalApp.java:125–152  ·  view source on GitHub ↗

Initializes the animation;

()

Source from the content-addressed store, hash-verified

123 * Initializes the animation;
124 */
125 @Override
126 public void initialize() {
127 plottingPanel.setMessage(null, MessageDrawable.TOP_LEFT);
128 // clears all trajectories
129 plottingPanel.removeDrawables(AbstractTrajectory.class); // XXX WC JS Bug
130 trajectories.clear();
131 markers.clear();
132 maxTime = control.getDouble("maximum time");
133 enableInspector = control.getBoolean("enable inspector");
134 if ((inspector != null) && !enableInspector) {
135 inspector.plot.setVisible(false);
136 }
137 dt = control.getDouble("dt");
138 time = 0;
139 plottingPanel.setMessage("t=" + ControlUtils.f2(time));
140 if (control.getBoolean("autoscale")) {
141 double[] array = scale.getArray(control.getString("scale min max"));
142 ((PolarAxes) plottingPanel.getAxes()).autospaceRings(true);
143 plottingPanel.setAutoscaleX(true);
144 plottingPanel.setAutoscaleY(true);
145 plottingPanel.limitAutoscaleX(array[0], array[1]);
146 plottingPanel.limitAutoscaleY(array[2], array[3]);
147 } else {
148 double[] array = scale.getArray(control.getString("scale min max"));
149 ((PolarAxes) plottingPanel.getAxes()).setDeltaR(1.0);
150 plottingPanel.setPreferredMinMax(array[0], array[1], array[2], array[3]);
151 }
152 }
153
154 /**
155 * Handles the mouse action.

Callers 2

resetMethod · 0.95
loadObjectMethod · 0.95

Calls 15

f2Method · 0.95
removeDrawablesMethod · 0.80
clearMethod · 0.65
getDoubleMethod · 0.65
getBooleanMethod · 0.65
setVisibleMethod · 0.65
getStringMethod · 0.65
autospaceRingsMethod · 0.65
setDeltaRMethod · 0.65
setPreferredMinMaxMethod · 0.65
setMessageMethod · 0.45
getArrayMethod · 0.45

Tested by

no test coverage detected