01: package jimm.datavision.gui;
02:
03: import jimm.datavision.*;
04: import jimm.util.I18N;
05: import java.awt.event.*;
06: import java.io.File;
07: import javax.swing.*;
08:
09: /**
10: * The main GUI {@link Report} design window.
11: *
12: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
13: */
14: public class DesignWin extends Designer {
15:
16: /**
17: * Constructor. Reads the named report file or, if it's <code>null</code>,
18: * creates a new, empty report.
19: *
20: * @param f an XML report file; may be <code>null</code>
21: */
22: public DesignWin(File f) {
23: this (f, null);
24: }
25:
26: /**
27: * Constructor. Reads the named report file or, if it's <code>null</code>,
28: * creates a new, empty report.
29: *
30: * @param f an XML report file; may be <code>null</code>
31: * @param databasePassword string to give to report; OK if it's
32: * <code>null</code>
33: */
34: public DesignWin(File f, String databasePassword) {
35: super (f, databasePassword, null, new JFrame(I18N
36: .get("DesignWin.title")));
37:
38: frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
39:
40: // Make sure we close the window when the user asks to close the window.
41: // Update menu items when this window is activated.
42: frame.addWindowListener(new WindowAdapter() {
43: public void windowClosing(WindowEvent e) {
44: maybeClose();
45: }
46:
47: public void windowActivated(WindowEvent e) {
48: enableMenuItems();
49: }
50: });
51:
52: frame.pack();
53: frame.show();
54: }
55:
56: /**
57: * Builds the window components.
58: */
59: protected void buildWindow() {
60: super.buildWindow();
61: }
62:
63: }
|