public HelpDialog(BibtexBaseFrame bf) {
// Initializes, but does not show the help dialog.
super(bf, GUIGlobals.helpTitle, false);
content = new HelpContent();
content.addHyperlinkListener(this);
setSize(GUIGlobals.helpSize);
Dimension ds = GUIGlobals.helpSize,
df = bf.getSetSize();
Point pf = bf.getSetLocation();
setLocation(new Point(Math.max(0,(pf.x+(df.width-ds.width)/2)),
Math.max(0,(pf.y+(df.height-ds.height)/2))));
/* There is probably no need for a window listener now, so it's commented out.
diag.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
open = null;
}
});*/
JToolBar tlb = new JToolBar();
//tlb.add(new CloseAction());
//tlb.addSeparator();
tlb.add(back);
tlb.add(forward);
tlb.addSeparator();
tlb.add(contents);
tlb.setFloatable(false);
// Make ESC close dialog, and set shortkeys for back and forward.
InputMap im = tlb.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
ActionMap am = tlb.getActionMap();
im.put(GUIGlobals.exitDialog, "close");
am.put("close", new CloseAction());
im.put(GUIGlobals.switchPanelLeft, "left");
am.put("left", back);
im.put(GUIGlobals.switchPanelRight, "right");
am.put("right", forward);
// Set shortkeys for back and forward specifically for the EditorPane.
im = content.getInputMap(JComponent.WHEN_FOCUSED);
am = content.getActionMap();
im.put(GUIGlobals.switchPanelLeft, "left");
am.put("left", back);
im.put(GUIGlobals.switchPanelRight, "right");
am.put("right", forward);
getContentPane().add(tlb, BorderLayout.NORTH);
getContentPane().add(content.getPane());
forward.setEnabled(false);
back.setEnabled(false);
}
|