Shows the DataTool help.
()
| 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 |
no test coverage detected