From: David ‘Bombe’ Roden Date: Mon, 7 Apr 2008 07:00:51 +0000 (+0000) Subject: still empty about dialog X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dea4879970585ced4d190fe847b9e43b40c1e846;p=jSite2.git still empty about dialog git-svn-id: http://trooper/svn/projects/jSite/trunk@623 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/jsite/gui/AboutDialog.java b/src/net/pterodactylus/jsite/gui/AboutDialog.java new file mode 100644 index 0000000..2d69b46 --- /dev/null +++ b/src/net/pterodactylus/jsite/gui/AboutDialog.java @@ -0,0 +1,162 @@ +/* + * jSite2 - AboutDialog.java - + * Copyright © 2008 David Roden + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +package net.pterodactylus.jsite.gui; + +import java.awt.BorderLayout; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.SwingConstants; + +import net.pterodactylus.jsite.i18n.I18n; + +/** + * An “about” dialog. + * + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> + * @version $Id$ + */ +public class AboutDialog extends JDialog { + + /** A list of all contributors. */ + private static final List CONTRIBUTORS = new ArrayList(); + + static { + CONTRIBUTORS.add(new Contributor("David ‘Bombe’ Roden", "bombe@freenetproject.org", "Main code")); + } + + /** + * Creates a new “about” dialog. + * + * @param swingInterface + * The Swing interface + */ + public AboutDialog(SwingInterface swingInterface) { + super(swingInterface.getMainWindow()); + initComponents(); + } + + // + // PRIVATE METHODS + // + + /** + * Initiliazes all components of the dialog. + */ + private void initComponents() { + JPanel contentPane = new JPanel(new BorderLayout(12, 12)); + getContentPane().add(contentPane, BorderLayout.CENTER); + contentPane.setBorder(BorderFactory.createEmptyBorder(12, 12, 12, 12)); + + JTabbedPane tabbedPane = new JTabbedPane(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT); + contentPane.add(tabbedPane, BorderLayout.CENTER); + + tabbedPane.addTab(I18n.get("aboutDialog.page.about.title"), createAboutPage()); + tabbedPane.setToolTipTextAt(0, I18n.get("aboutDialog.page.about.shortDescription")); + tabbedPane.addTab(I18n.get("aboutDialog.page.license.title"), createLicensePage()); + tabbedPane.setToolTipTextAt(1, I18n.get("aboutDialog.page.license.shortDescription")); + } + + /** + * Creates the “about” page. + * + * @return The “about” page + */ + private JComponent createAboutPage() { + return new JPanel(); + } + + /** + * Creates the “license” page. + * + * @return The “license” page + */ + private JComponent createLicensePage() { + return new JPanel(); + } + + /** + * Container for a contributor. + * + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> + * @version $Id$ + */ + private static class Contributor { + + /** The name of the contributor. */ + private final String name; + + /** The email address of the contributor. */ + private final String email; + + /** The parts where the contributor helped. */ + private final String part; + + /** + * Creates a new contributor. + * + * @param name + * The name of the contributor + * @param email + * The email address of the contributor + * @param part + * The parts where the contributor helped + */ + public Contributor(String name, String email, String part) { + this.name = name; + this.email = email; + this.part = part; + } + + /** + * Returns the name of the contributor. + * + * @return The name of the contributor + */ + String getName() { + return name; + } + + /** + * Returns the email address of the contributor. + * + * @return The email address of the contributor + */ + String getEmail() { + return email; + } + + /** + * Returns the parts where the contributor helped. + * + * @return The parts where the contributor helped + */ + String getPart() { + return part; + } + + } + +}