use of com.cburch.logisim.gui.generic.LFrame in project logisim-evolution by reds-heig.
the class MenuHelp method loadBroker.
private void loadBroker() {
String helpUrl = Strings.get("helpsetUrl");
if (helpUrl == null) {
helpUrl = "doc/doc_en.hs";
}
if (helpSet == null || helpFrame == null || !helpUrl.equals(helpSetUrl)) {
ClassLoader loader = MenuHelp.class.getClassLoader();
try {
URL hsURL = HelpSet.findHelpSet(loader, helpUrl);
if (hsURL == null) {
disableHelp();
JOptionPane.showMessageDialog(menubar.getParentWindow(), Strings.get("helpNotFoundError"));
return;
}
helpSetUrl = helpUrl;
helpSet = new HelpSet(null, hsURL);
helpComponent = new JHelp(helpSet);
if (helpFrame == null) {
helpFrame = new LFrame();
helpFrame.setTitle(Strings.get("helpWindowTitle"));
helpFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
helpFrame.getContentPane().add(helpComponent);
helpFrame.setPreferredSize(new Dimension((int) Toolkit.getDefaultToolkit().getScreenSize().getWidth() >> 1, (int) Toolkit.getDefaultToolkit().getScreenSize().getHeight() >> 1));
helpFrame.pack();
} else {
helpFrame.getContentPane().removeAll();
helpFrame.getContentPane().add(helpComponent);
helpComponent.revalidate();
}
} catch (Exception e) {
disableHelp();
e.printStackTrace();
JOptionPane.showMessageDialog(menubar.getParentWindow(), Strings.get("helpUnavailableError"));
return;
}
}
}