2 * jSite2 - AboutDialog.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.jsite.gui;
22 import java.awt.BorderLayout;
23 import java.util.ArrayList;
24 import java.util.List;
26 import javax.swing.BorderFactory;
27 import javax.swing.JComponent;
28 import javax.swing.JDialog;
29 import javax.swing.JPanel;
30 import javax.swing.JTabbedPane;
31 import javax.swing.SwingConstants;
33 import net.pterodactylus.jsite.i18n.I18n;
38 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
41 public class AboutDialog extends JDialog {
43 /** A list of all contributors. */
44 private static final List<Contributor> CONTRIBUTORS = new ArrayList<Contributor>();
47 CONTRIBUTORS.add(new Contributor("David ‘Bombe’ Roden", "bombe@freenetproject.org", "Main code"));
51 * Creates a new “about” dialog.
53 * @param swingInterface
56 public AboutDialog(SwingInterface swingInterface) {
57 super(swingInterface.getMainWindow());
66 * Initiliazes all components of the dialog.
68 private void initComponents() {
69 JPanel contentPane = new JPanel(new BorderLayout(12, 12));
70 getContentPane().add(contentPane, BorderLayout.CENTER);
71 contentPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12));
73 JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
74 contentPane.add(tabbedPane, BorderLayout.CENTER);
76 tabbedPane.addTab(I18n.get("aboutDialog.page.about.title"), createAboutPage());
77 tabbedPane.setToolTipTextAt(0, I18n.get("aboutDialog.page.about.shortDescription"));
78 tabbedPane.addTab(I18n.get("aboutDialog.page.license.title"), createLicensePage());
79 tabbedPane.setToolTipTextAt(1, I18n.get("aboutDialog.page.license.shortDescription"));
83 * Creates the “about” page.
85 * @return The “about” page
87 private JComponent createAboutPage() {
92 * Creates the “license” page.
94 * @return The “license” page
96 private JComponent createLicensePage() {
101 * Container for a contributor.
103 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
106 private static class Contributor {
108 /** The name of the contributor. */
109 private final String name;
111 /** The email address of the contributor. */
112 private final String email;
114 /** The parts where the contributor helped. */
115 private final String part;
118 * Creates a new contributor.
121 * The name of the contributor
123 * The email address of the contributor
125 * The parts where the contributor helped
127 public Contributor(String name, String email, String part) {
134 * Returns the name of the contributor.
136 * @return The name of the contributor
143 * Returns the email address of the contributor.
145 * @return The email address of the contributor
152 * Returns the parts where the contributor helped.
154 * @return The parts where the contributor helped