001: /*
002: ** $Id: AboutDialog.java,v 1.10 2000/11/02 09:01:26 mrw Exp $
003: **
004: ** Mike Wilson, October 2000, mrw@whisperingwind.co.uk
005: **
006: ** (C) Copyright 2000, Mike Wilson, Reading, Berkshire, UK
007: **
008: ** This program is free software; you can redistribute it and/or modify
009: ** it under the terms of the GNU General Public License as published by
010: ** the Free Software Foundation; either version 2 of the License, or
011: ** (at your option) any later version.
012: **
013: ** This program is distributed in the hope that it will be useful,
014: ** but WITHOUT ANY WARRANTY; without even the implied warranty of
015: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: ** GNU General Public License for more details.
017: **
018: ** You should have received a copy of the GNU Library General
019: ** Public License along with this library; if not, write to the
020: ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
021: ** Boston, MA 02111-1307 USA.
022: */
023:
024: package uk.co.whisperingwind.vienna;
025:
026: import java.awt.BorderLayout;
027: import java.awt.event.ActionEvent;
028: import java.awt.event.ActionListener;
029: import java.awt.event.WindowAdapter;
030: import java.awt.event.WindowEvent;
031: import javax.swing.JButton;
032: import javax.swing.JFrame;
033: import javax.swing.JScrollPane;
034: import javax.swing.JTextArea;
035: import uk.co.whisperingwind.framework.ActionFactory;
036: import uk.co.whisperingwind.framework.ModelEvent;
037: import uk.co.whisperingwind.framework.PanelDialogView;
038:
039: /**
040: ** About dialog.
041: */
042:
043: class AboutDialog extends PanelDialogView {
044: private String aboutMessage = "ViennaSQL 1.2\n\n"
045: + "(C) Copyright 2000, Mike Wilson\n\n"
046: + "Incorporating MinML (C) Copyright 1999 John Wilson\n"
047: + "Incorporating Java Look and Feel Graphics Repository (C) "
048: + "Copyright Sun Microsystems\n"
049: + "\n"
050: + "The GPL only applies to ViennaSQL, not MinML or the JLFGR:\n"
051: + "\n"
052: + "This program is free software; you can redistribute it and/or modify\n"
053: + "it under the terms of the GNU General Public License as published by\n"
054: + "the Free Software Foundation; either version 2 of the License, or\n"
055: + "(at your option) any later version.\n"
056: + "\n"
057: + "This program is distributed in the hope that it will be useful,\n"
058: + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
059: + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
060: + "GNU General Public License for more details.\n"
061: + "\n"
062: + "You should have received a copy of the GNU Library General\n"
063: + "Public License along with this library; if not, write to the\n"
064: + "Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n"
065: + "Boston, MA 02111-1307 USA.";
066:
067: private ActionFactory.DefaultAction dismissAction = null;
068:
069: public AboutDialog(JFrame parent) {
070: super (parent, true);
071: content.setTitle("About ViennaSQL");
072:
073: createActions();
074: createWindow();
075:
076: content.pack();
077: content.setResizable(false);
078: content.setVisible(true);
079: }
080:
081: private void createActions() {
082: ActionFactory factory = new ActionFactory(
083: "/uk/co/whisperingwind/images");
084:
085: dismissAction = factory.createAction("dismiss");
086: JButton dismissButton = dismissAction
087: .toolButtonFactory(buttonPanel);
088: content.getRootPane().setDefaultButton(dismissButton);
089: dismissAction.addActionListener(new ActionListener() {
090: public void actionPerformed(ActionEvent event) {
091: closeDialog();
092: }
093: });
094:
095: content.addWindowListener(new WindowAdapter() {
096: public void windowClosing(WindowEvent event) {
097: closeDialog();
098: }
099: });
100: }
101:
102: private void createWindow() {
103: JTextArea aboutText = new JTextArea(aboutMessage);
104: aboutText.setEditable(false);
105: JScrollPane textScroller = new JScrollPane(aboutText);
106: panel.add(textScroller, BorderLayout.CENTER);
107: }
108:
109: public void modelEvent(ModelEvent event) {
110: }
111:
112: public void cleanUp() {
113: }
114: }
|