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

Method showHelp

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

Shows the DataTool help.

()

Source from the content-addressed store, hash-verified

2578 * Shows the DataTool help.
2579 */
2580 protected static void showHelp() {
2581 String fileName = helpName;
2582 String helpPath = XML.getResolvedPath(fileName, helpBase);
2583 if (ResourceLoader.getResource(helpPath) != null) {
2584 // show help in desktop browser
2585 OSPDesktop.displayURL(helpPath);
2586 } else {
2587 fileName = "data_tool_help.html"; //$NON-NLS-1$
2588 String classBase = "/org/opensourcephysics/resources/tools/html/"; //$NON-NLS-1$
2589 helpPath = XML.getResolvedPath(fileName, classBase);
2590 if ((helpFrame == null) || !helpPath.equals(helpFrame.getTitle())) {
2591 helpFrame = new TextFrame(helpPath);
2592 helpFrame.enableHyperlinks();
2593 helpFrame.setSize(800, 600);
2594 // center on the screen
2595 Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
2596 int x = (dim.width - helpFrame.getBounds().width) / 2;
2597 int y = (dim.height - helpFrame.getBounds().height) / 2;
2598 helpFrame.setLocation(x, y);
2599 }
2600 helpFrame.setVisible(true);
2601 }
2602 }
2603
2604 /**
2605 * Overrides OSPFrame method. This converts EXIT_ON_CLOSE to DO_NOTHING_ON_CLOSE

Callers 2

actionPerformedMethod · 0.95
actionPerformedMethod · 0.95

Calls 10

getResolvedPathMethod · 0.95
getResourceMethod · 0.95
displayURLMethod · 0.95
enableHyperlinksMethod · 0.80
equalsMethod · 0.65
getTitleMethod · 0.65
setSizeMethod · 0.65
setVisibleMethod · 0.65
getBoundsMethod · 0.45
setLocationMethod · 0.45

Tested by

no test coverage detected