still empty about dialog
[jSite2.git] / src / net / pterodactylus / jsite / gui / AboutDialog.java
1 /*
2  * jSite2 - AboutDialog.java -
3  * Copyright © 2008 David Roden
4  *
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.
9  *
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.
14  *
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.
18  */
19
20 package net.pterodactylus.jsite.gui;
21
22 import java.awt.BorderLayout;
23 import java.util.ArrayList;
24 import java.util.List;
25
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;
32
33 import net.pterodactylus.jsite.i18n.I18n;
34
35 /**
36  * An “about” dialog.
37  * 
38  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
39  * @version $Id$
40  */
41 public class AboutDialog extends JDialog {
42
43         /** A list of all contributors. */
44         private static final List<Contributor> CONTRIBUTORS = new ArrayList<Contributor>();
45
46         static {
47                 CONTRIBUTORS.add(new Contributor("David ‘Bombe’ Roden", "bombe@freenetproject.org", "Main code"));
48         }
49
50         /**
51          * Creates a new “about” dialog.
52          * 
53          * @param swingInterface
54          *            The Swing interface
55          */
56         public AboutDialog(SwingInterface swingInterface) {
57                 super(swingInterface.getMainWindow());
58                 initComponents();
59         }
60
61         //
62         // PRIVATE METHODS
63         //
64
65         /**
66          * Initiliazes all components of the dialog.
67          */
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));
72
73                 JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
74                 contentPane.add(tabbedPane, BorderLayout.CENTER);
75
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"));
80         }
81
82         /**
83          * Creates the “about” page.
84          * 
85          * @return The “about” page
86          */
87         private JComponent createAboutPage() {
88                 return new JPanel();
89         }
90
91         /**
92          * Creates the “license” page.
93          * 
94          * @return The “license” page
95          */
96         private JComponent createLicensePage() {
97                 return new JPanel();
98         }
99
100         /**
101          * Container for a contributor.
102          * 
103          * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
104          * @version $Id$
105          */
106         private static class Contributor {
107
108                 /** The name of the contributor. */
109                 private final String name;
110
111                 /** The email address of the contributor. */
112                 private final String email;
113
114                 /** The parts where the contributor helped. */
115                 private final String part;
116
117                 /**
118                  * Creates a new contributor.
119                  * 
120                  * @param name
121                  *            The name of the contributor
122                  * @param email
123                  *            The email address of the contributor
124                  * @param part
125                  *            The parts where the contributor helped
126                  */
127                 public Contributor(String name, String email, String part) {
128                         this.name = name;
129                         this.email = email;
130                         this.part = part;
131                 }
132
133                 /**
134                  * Returns the name of the contributor.
135                  * 
136                  * @return The name of the contributor
137                  */
138                 String getName() {
139                         return name;
140                 }
141
142                 /**
143                  * Returns the email address of the contributor.
144                  * 
145                  * @return The email address of the contributor
146                  */
147                 String getEmail() {
148                         return email;
149                 }
150
151                 /**
152                  * Returns the parts where the contributor helped.
153                  * 
154                  * @return The parts where the contributor helped
155                  */
156                 String getPart() {
157                         return part;
158                 }
159
160         }
161
162 }