source: trunk/gli/src/org/greenstone/gatherer/gui/AboutDialog.java@ 5343

Last change on this file since 5343 was 5343, checked in by mdewsnip, 21 years ago

Added in missing acknowledgement.

  • Property svn:keywords set to Author Date Id Revision
File size: 5.2 KB
Line 
1package org.greenstone.gatherer.gui;
2/**
3 *#########################################################################
4 *
5 * A component of the Gatherer application, part of the Greenstone digital
6 * library suite from the New Zealand Digital Library Project at the
7 * University of Waikato, New Zealand.
8 *
9 * <BR><BR>
10 *
11 * Author: John Thompson, Greenstone Digital Library, University of Waikato
12 *
13 * <BR><BR>
14 *
15 * Copyright (C) 1999 New Zealand Digital Library Project
16 *
17 * <BR><BR>
18 *
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
23 *
24 * <BR><BR>
25 *
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
30 *
31 * <BR><BR>
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
36 *########################################################################
37 */
38import java.awt.*;
39import java.awt.event.*;
40import javax.swing.*;
41import org.greenstone.gatherer.Dictionary;
42import org.greenstone.gatherer.Gatherer;
43import org.greenstone.gatherer.util.Utility;
44/**
45 * @author John Thompson, Greenstone Digital Library, University of Waikato
46 * @version 2.3c
47 */
48
49// RICOH SOURCE CODE PUBLIC LICENSE - http://www.risource.org/RPL/RPL-1.0A.shtml
50
51public class AboutDialog
52 extends JDialog {
53 private AboutDialog self;
54 private JButton close_button;
55
56 static final private Dimension SIZE = new Dimension(600, 325);
57 static final private int ICON_SIZE = 65;
58
59 public AboutDialog(JFrame parent) {
60 super(parent, get("AboutDialog.Title"), true);
61 this.self = this;
62 setSize(SIZE);
63
64 JPanel content_pane = (JPanel) getContentPane();
65 JPanel upper_pane = new JPanel();
66 ImageIcon icon = Utility.getImage("medgath.gif");
67 ImageIcon scaled_icon = new ImageIcon(icon.getImage().getScaledInstance(ICON_SIZE, ICON_SIZE, Image.SCALE_DEFAULT));
68 JLabel icon_label = new JLabel(scaled_icon);
69 JPanel title_pane = new JPanel();
70 JLabel title_one_label = new JLabel(get("AboutDialog.Title_One"));
71 JLabel title_two_label = new JLabel(Utility.PROGRAM_NAME + " " + Utility.PROGRAM_VERSION + " " + get("AboutDialog.Date"));
72 JLabel title_three_label = new JLabel(get("AboutDialog.Title_Two"));
73 JLabel copyright_label = new JLabel(get("AboutDialog.Copyright"));
74 JTextArea text = new JTextArea();
75 text.setLineWrap(true);
76 text.setWrapStyleWord(true);
77 JPanel button_pane = new JPanel();
78 close_button = new JButton(get("General.Close"));
79
80 // Connection
81 close_button.addActionListener(new CloseButtonListener());
82
83 // Layout
84 icon_label.setBorder(BorderFactory.createEmptyBorder(0,0,0,10));
85
86 title_pane.setLayout(new GridLayout(4,1,0,2));
87 title_pane.add(title_one_label);
88 title_pane.add(title_two_label);
89 title_pane.add(title_three_label);
90 title_pane.add(copyright_label);
91
92 upper_pane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
93 upper_pane.setLayout(new BorderLayout());
94 upper_pane.add(icon_label, BorderLayout.WEST);
95 upper_pane.add(title_pane, BorderLayout.CENTER);
96
97 button_pane.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
98 button_pane.setLayout(new BorderLayout());
99 button_pane.add(close_button, BorderLayout.EAST);
100
101 content_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
102 content_pane.setLayout(new BorderLayout());
103 content_pane.add(upper_pane, BorderLayout.NORTH);
104 content_pane.add(new JScrollPane(text), BorderLayout.CENTER);
105 content_pane.add(button_pane, BorderLayout.SOUTH);
106 // Build text content
107 text.append(get("AboutDialog.Java_Req"));
108 text.append("\n");
109 text.append(get("AboutDialog.Java_Req_One"));
110 text.append("\n");
111 text.append(get("AboutDialog.Java_Req_Two"));
112 text.append("\n\n");
113 text.append("*****" + get("AboutDialog.Acknowledgement") + "*****");
114 text.append("\n\n");
115 text.append(get("AboutDialog.Item0"));
116 text.append("\n\n");
117 text.append(get("AboutDialog.Item1"));
118 text.append("\n\n");
119 text.append(get("AboutDialog.Item2"));
120 text.append("\n\n");
121 text.append(get("AboutDialog.Item3"));
122 text.append("\n\n");
123 text.append("*****" + get("Thanks") + "*****");
124 text.append("\n\n");
125 text.append(get("AboutDialog.Item4"));
126 text.append("\n\n");
127 text.append(get("AboutDialog.Item5"));
128 text.append("\n\n");
129 text.append(get("AboutDialog.Item6"));
130 text.append("\n\n");
131 text.append(get("AboutDialog.Item7"));
132 text.append("\n\n");
133 text.append(get("AboutDialog.Item8"));
134
135 text.setCaretPosition(0);
136
137 // Show
138 Rectangle frame_bounds = parent.getBounds();
139 setLocation(frame_bounds.x + (frame_bounds.width - SIZE.width) / 2, frame_bounds.y + (frame_bounds.height - SIZE.height) / 2);
140 show();
141 }
142
143 private class CloseButtonListener
144 implements ActionListener {
145 public void actionPerformed(ActionEvent event) {
146 self.hide();
147 self.dispose();
148 }
149 }
150
151 static private String get(String key) {
152 if(key.indexOf(".") == -1) {
153 key = "AboutDialog." + key;
154 }
155 return Gatherer.dictionary.get(key);
156 }
157}
Note: See TracBrowser for help on using the repository browser.