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

Method createMarker

src/davidson/gr/ClassicalApp.java:196–219  ·  view source on GitHub ↗

Adds a marker to the plot.

()

Source from the content-addressed store, hash-verified

194 * Adds a marker to the plot.
195 */
196 public void createMarker() {
197 final ShellParticle marker = new ShellParticle();
198 marker.setStepSize(dt);
199 OSPTableInspector editor = marker.edit();
200 editor.setLocationRelativeTo(plottingPanel);
201
202 final Control control = editor.getControl();
203 editor.addWindowListener(new java.awt.event.WindowAdapter() {
204
205 @Override
206 public void windowClosed(WindowEvent e) {
207 marker.setEnabled(control.getBoolean("draggable state"));
208 marker.label = control.getString("label");
209 double r = control.getDouble("r");
210 double phi = control.getDouble(Trajectory.PHI);
211 marker.setXY(r * Math.cos(phi), r * Math.sin(phi));
212 markers.add(marker);
213 plottingPanel.addDrawable(marker);
214 plottingPanel.repaint();
215 }
216 });
217 editor.setVisible(true);
218 /* */
219 }
220
221 void createDefaultParticle() {
222 defaultTrajectory = new ClassicalTrajectory();

Callers

nothing calls this directly

Calls 4

editMethod · 0.95
getControlMethod · 0.95
setStepSizeMethod · 0.65
setVisibleMethod · 0.65

Tested by

no test coverage detected