KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jimm > datavision > gui > DesignWin


1 package jimm.datavision.gui;
2 import jimm.datavision.*;
3 import jimm.util.I18N;
4 import java.awt.event.*;
5 import java.io.File JavaDoc;
6 import javax.swing.*;
7
8 /**
9  * The main GUI {@link Report} design window.
10  *
11  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
12  */

13 public class DesignWin extends Designer {
14
15 /**
16  * Constructor. Reads the named report file or, if it's <code>null</code>,
17  * creates a new, empty report.
18  *
19  * @param f an XML report file; may be <code>null</code>
20  */

21 public DesignWin(File JavaDoc f) {
22     this(f, null);
23 }
24
25 /**
26  * Constructor. Reads the named report file or, if it's <code>null</code>,
27  * creates a new, empty report.
28  *
29  * @param f an XML report file; may be <code>null</code>
30  * @param databasePassword string to give to report; OK if it's
31  * <code>null</code>
32  */

33 public DesignWin(File JavaDoc f, String JavaDoc databasePassword) {
34     super(f, databasePassword, null,
35       new JFrame(I18N.get("DesignWin.title")));
36
37     frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
38
39     // Make sure we close the window when the user asks to close the window.
40
// Update menu items when this window is activated.
41
frame.addWindowListener(new WindowAdapter() {
42     public void windowClosing(WindowEvent e) { maybeClose(); }
43     public void windowActivated(WindowEvent e) { enableMenuItems(); }
44     });
45
46     frame.pack();
47     frame.show();
48 }
49
50 /**
51  * Builds the window components.
52  */

53 protected void buildWindow() {
54     super.buildWindow();
55 }
56
57 }
58
Popular Tags