1 /***
2 *
3 * The owl-s matcher software is subject to the GNU Lesser General
4 * Public License Version 2.1 (the "License"). You may not copy or use this
5 * file, in either source code or executable form, except in compliance
6 * with the License. You may obtain a copy of the License at
7 * http://www.fsf.org/licenses/lgpl.txt or http://www.opensource.org/.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied without
11 * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the License for the specific language governing rights and
13 * limitations under the License.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this distribution; if not, write to the
17 *
18 * Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307 USA
21 *
22 * Copyright (C) 2003-2004
23 * TU Berlin, FG IVS
24 * Stefan Tang,
25 * Christoph Liebetruth,
26 * Michael C. Jaeger,
27 *
28 * More information available at http://ivs.tu-berlin.de/
29 *
30 * $Id$
31 *
32 */
33 package de.tuberlin.ivs.owl.gui;
34
35 import java.awt.*;
36 import java.awt.event.*;
37 import javax.swing.*;
38
39 /***
40 * The 'About Box' window.
41 *
42 * @author Stefan Tang (steftang@stanford.edu), Christoph Liebetruth (christophl@voelcker.com)
43 * @version 1.1
44 */
45 public class MainFrame_AboutBox extends JDialog implements ActionListener {
46
47
48
49
50 JPanel panel1 = new JPanel();
51 JPanel panel2 = new JPanel();
52 JPanel insetsPanel1 = new JPanel();
53 JPanel insetsPanel2 = new JPanel();
54 JPanel insetsPanel3 = new JPanel();
55 JButton button1 = new JButton();
56 JLabel imageLabel = new JLabel();
57 JLabel label1 = new JLabel();
58 JLabel label2 = new JLabel();
59 JLabel label3 = new JLabel();
60 JLabel label4 = new JLabel();
61 ImageIcon image1 = new ImageIcon();
62 BorderLayout borderLayout1 = new BorderLayout();
63 BorderLayout borderLayout2 = new BorderLayout();
64 FlowLayout flowLayout1 = new FlowLayout();
65 GridLayout gridLayout1 = new GridLayout();
66 String product = "";
67 String version = "1.0";
68 String copyright = "Copyright (c) 2004 TU Berlin, FG IVS, S. Tang, C. Liebetruth and M. C. Jaeger";
69 String comments = "";
70
71 /***
72 * Constructor. Initializes the window.
73 * @param parent The parent of this dialog.
74 */
75 public MainFrame_AboutBox(Frame parent) {
76 super(parent);
77 enableEvents(AWTEvent.WINDOW_EVENT_MASK);
78 try {
79 jbInit();
80 }
81 catch(Exception e) {
82 e.printStackTrace();
83 }
84 }
85
86 private void jbInit() throws Exception {
87 image1 = new ImageIcon(de.tuberlin.ivs.owl.gui.MainFrame.class.getResource("owlsm_logo.png"));
88 imageLabel.setIcon(image1);
89 this.setTitle("About");
90 panel1.setLayout(borderLayout1);
91 panel2.setLayout(borderLayout2);
92 insetsPanel1.setLayout(flowLayout1);
93 insetsPanel2.setLayout(flowLayout1);
94 insetsPanel2.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
95 gridLayout1.setRows(4);
96 gridLayout1.setColumns(1);
97 label1.setText("Interface for testing the OWL-S Matching Algorithm");
98 label2.setText("Programmed by Stefan Tang and Christoph Liebetruth");
99 label3.setText(copyright);
100 label4.setText(comments);
101 insetsPanel3.setLayout(gridLayout1);
102 insetsPanel3.setBorder(BorderFactory.createEmptyBorder(10, 60, 10, 10));
103 button1.setText("Ok");
104 button1.addActionListener(this);
105 insetsPanel2.add(imageLabel, null);
106 panel2.add(insetsPanel2, BorderLayout.NORTH);
107 this.getContentPane().add(panel1, null);
108 insetsPanel3.add(label1, null);
109 insetsPanel3.add(label2, null);
110 insetsPanel3.add(label3, null);
111 insetsPanel3.add(label4, null);
112 panel2.add(insetsPanel3, BorderLayout.CENTER);
113 insetsPanel1.add(button1, null);
114 panel1.add(insetsPanel1, BorderLayout.SOUTH);
115 panel1.add(panel2, BorderLayout.NORTH);
116 setResizable(true);
117 }
118
119 protected void processWindowEvent(WindowEvent e) {
120 if (e.getID() == WindowEvent.WINDOW_CLOSING) {
121 cancel();
122 }
123 super.processWindowEvent(e);
124 }
125
126 void cancel() {
127 dispose();
128 }
129
130 public void actionPerformed(ActionEvent e) {
131 if (e.getSource() == button1) {
132 cancel();
133 }
134 }
135 }