initial import
[iDMC.git] / src / java / org / tsho / dmc2 / ui / DmcAboutPanel.java
blobb285cb9ba21e1b17e482830e3067e6a890aec250
1 /* ========================================================================
2 * JCommon : a free general purpose class library for the Java(tm) platform
3 * ========================================================================
5 * (C) Copyright 2000-2004, by Object Refinery Limited and Contributors.
6 *
7 * Project Info: http://www.jfree.org/jcommon/index.html
9 * This library is free software; you can redistribute it and/or modify it under the terms
10 * of the GNU Lesser General Public License as published by the Free Software Foundation;
11 * either version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
14 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 * See the GNU Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public License along with this
18 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
21 * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
22 * in the United States and other countries.]
24 * ---------------
25 * AboutPanel.java
26 * ---------------
27 * (C) Copyright 2001-2004, by Object Refinery Limited.
29 * Original Author: David Gilbert (for Object Refinery Limited);
30 * Contributor(s): -;
32 * $Id: AboutPanel.java,v 1.4 2004/01/01 23:59:29 mungady Exp $
34 * Changes (from 26-Oct-2001)
35 * --------------------------
36 * 26-Nov-2001 : Version 1 (DG);
37 * 27-Jun-2002 : Added logo (DG);
38 * 08-Oct-2002 : Fixed errors reported by Checkstyle (DG);
42 package org.tsho.dmc2.ui;
44 import java.awt.BorderLayout;
45 import java.awt.Color;
46 import java.awt.Font;
47 import java.awt.Image;
49 import javax.swing.BorderFactory;
50 import javax.swing.BoxLayout;
51 import javax.swing.JLabel;
52 import javax.swing.JPanel;
53 import javax.swing.JTextArea;
54 import javax.swing.SwingConstants;
56 import org.jfree.ui.RefineryUtilities;
58 /**
59 * A standard panel for displaying information about an application.
61 * @author David Gilbert
63 public class DmcAboutPanel extends JPanel {
65 /**
66 * Constructs a panel.
68 * @param application the application name.
69 * @param version the version.
70 * @param copyright the copyright statement.
71 * @param info other info.
73 public DmcAboutPanel(String application, String version, String copyright, String info) {
75 this(application, version, copyright, info, null);
79 /**
80 * Constructs a panel.
82 * @param application the application name.
83 * @param version the version.
84 * @param copyright the copyright statement.
85 * @param info other info.
86 * @param logo an optional logo.
88 public DmcAboutPanel(String application, String version, String copyright, String info,
89 Image logo) {
91 setLayout(new BorderLayout());
93 // JPanel textPanel = new JPanel(new GridLayout(4, 1, 0, 4));
94 JPanel textPanel = new JPanel();
95 textPanel.setLayout(new BoxLayout(textPanel, BoxLayout.Y_AXIS));
97 JPanel appPanel = new JPanel();
98 Font f1 = new Font("Dialog", Font.BOLD, 14);
99 JLabel appLabel = RefineryUtilities.createJLabel(application, f1, Color.black);
100 appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
101 appPanel.add(appLabel);
103 JPanel verPanel = new JPanel();
104 Font f2 = new Font("Dialog", Font.PLAIN, 12);
105 JLabel verLabel = RefineryUtilities.createJLabel(version, f2, Color.black);
106 verLabel.setHorizontalTextPosition(SwingConstants.CENTER);
107 verPanel.add(verLabel);
109 JPanel copyrightPanel = new JPanel();
110 JLabel copyrightLabel = RefineryUtilities.createJLabel(copyright, f2, Color.black);
111 copyrightLabel.setHorizontalTextPosition(SwingConstants.CENTER);
112 copyrightPanel.add(copyrightLabel);
114 JPanel infoPanel = new JPanel();
115 // JLabel infoLabel = RefineryUtilities.createJLabel(info, f2, Color.black);
116 JTextArea infoArea = new JTextArea(info, 5, 40);
117 infoArea.setFont(f2);
118 // infoArea.setForeground(Color.black);
119 // infoArea.sel
120 infoArea.setEditable(false);
121 infoArea.setLineWrap(true);
122 infoArea.setWrapStyleWord(true);
123 //result.setHorizontalTextPosition(SwingConstants.CENTER);
124 infoPanel.add(infoArea);
126 textPanel.add(appPanel);
127 textPanel.add(verPanel);
128 textPanel.add(copyrightPanel);
129 textPanel.add(infoPanel);
131 add(textPanel);
133 if (logo != null) {
134 JPanel imagePanel = new JPanel(new BorderLayout());
135 imagePanel.add(new javax.swing.JLabel(new javax.swing.ImageIcon(logo)));
136 imagePanel.setBorder(BorderFactory.createLineBorder(Color.black));
137 JPanel imageContainer = new JPanel(new BorderLayout());
138 imageContainer.add(imagePanel, BorderLayout.NORTH);
139 add(imageContainer, BorderLayout.WEST);