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

Method main

src/org/opensourcephysics/tools/DataTool.java:285–311  ·  view source on GitHub ↗

Main entry point when used as application. @param args args[0] may be a data or xml file name

(String[] args)

Source from the content-addressed store, hash-verified

283 * @param args args[0] may be a data or xml file name
284 */
285 public static void main(String[] args) {
286 getTool(true);
287 if (OSPRuntime.isJS)
288 tool.standAlone = true;
289 if (tool.standAlone)
290 tool.setLocation(0, 0);
291 OSPRuntime.setAppClass(tool);
292 tool.exitOnClose = true;
293 tool.saveChangesOnClose = true;
294 if ((args != null) && (args.length > 0) && (args[0] != null)) {
295 tool.setVisible(true);
296 tool.open(new File(args[0]));
297 } else {
298 tool.addWindowListener(new WindowAdapter() {
299 @Override
300 public void windowOpened(WindowEvent e) {
301 if (tool.getTabCount() == 0) {
302 DataToolTab tab = tool.createTab(null);
303 tab.setUserEditable(true);
304 tool.addTab(tab);
305 }
306 }
307 });
308 tool.setVisible(true);
309 }
310
311 }
312
313 /**
314 * Constructs a blank DataTool.

Callers

nothing calls this directly

Calls 5

getToolMethod · 0.95
setAppClassMethod · 0.95
setVisibleMethod · 0.65
setLocationMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected