01: /*
02: * Jacareto Copyright (c) 2002-2005
03: * Applied Computer Science Research Group, Darmstadt University of
04: * Technology, Institute of Mathematics & Computer Science,
05: * Ludwigsburg University of Education, and Computer Based
06: * Learning Research Group, Aachen University. All rights reserved.
07: *
08: * Jacareto is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public
10: * License as published by the Free Software Foundation; either
11: * version 2 of the License, or (at your option) any later version.
12: *
13: * Jacareto is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public
19: * License along with Jacareto; if not, write to the Free
20: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21: *
22: */
23:
24: package jacareto.cleverphl.gui;
25:
26: import jacareto.cleverphl.CleverPHL;
27: import jacareto.system.Language;
28:
29: import java.awt.BorderLayout;
30: import java.awt.Component;
31: import java.awt.Point;
32: import java.awt.event.ActionEvent;
33: import java.awt.event.ActionListener;
34:
35: import javax.swing.JButton;
36: import javax.swing.JDialog;
37: import javax.swing.JPanel;
38: import javax.swing.border.EmptyBorder;
39:
40: /**
41: * Shows information about cleverphl.
42: *
43: * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
44: * @version 1.00
45: */
46: public class AboutDialog extends JDialog {
47: /**
48: * Creates a new about dialog.
49: *
50: * @param cleverPHL the CleverPHL instance
51: */
52: public AboutDialog(CleverPHL cleverPHL) {
53: super (cleverPHL.getMainFrame(), true);
54: setName(cleverPHL.getCustomization().getString(
55: "Components.JacaretoComponent", "JACARETO_COMPONENT"));
56:
57: Language language = cleverPHL.getLanguage();
58:
59: setTitle(language.getString("CleverPHL.AboutDialog.Title"));
60:
61: SplashScreen splashScreen = cleverPHL.getSplashScreen();
62: Component imageLabel = splashScreen.getImageLabel();
63: Component infoPanel = splashScreen.getInfoPanel();
64:
65: // The panel with the two buttons
66: JPanel buttonPanel = new JPanel();
67: JButton okButton = new JButton(language.getString("General.Ok"));
68: okButton.addActionListener(new ActionListener() {
69: public void actionPerformed(ActionEvent e) {
70: dispose();
71: }
72: });
73: buttonPanel.add(okButton);
74: buttonPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
75:
76: // Add all to the content pane
77: getContentPane().setLayout(new BorderLayout());
78: getContentPane().add(imageLabel, BorderLayout.NORTH);
79: getContentPane().add(infoPanel, BorderLayout.CENTER);
80: getContentPane().add(buttonPanel, BorderLayout.SOUTH);
81:
82: pack();
83: setResizable(false);
84:
85: Point ownerLoc = cleverPHL.getMainFrame().getLocation();
86: setLocation(((int) ownerLoc.getX()) + 30, ((int) ownerLoc
87: .getY()) + 30);
88: setVisible(true);
89: }
90: }
|