]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
Fixed grammar in messages.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / About.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 To show a about window with copyright information\r
4 \r
5 Copyright (c) 2006, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13 \r
14 **/\r
15\r
16package org.tianocore.frameworkwizard;\r
17\r
18import java.awt.event.ActionEvent;\r
19import java.awt.event.WindowEvent;\r
20\r
21import javax.swing.JButton;\r
22import javax.swing.JLabel;\r
23import javax.swing.JPanel;\r
24\r
25import org.tianocore.frameworkwizard.common.DataType;\r
26import org.tianocore.frameworkwizard.common.ui.IDialog;\r
27import org.tianocore.frameworkwizard.common.ui.IFrame;\r
79cb6fdb 28import javax.swing.ImageIcon;\r
a13899c5 29\r
30/**\r
31 The class is used to show a about window with copyright information\r
32 It extends IDialog\r
33\r
34 **/\r
35public class About extends IDialog {\r
36\r
37 ///\r
43dc3851 38 /// Define Class Serial Version UID\r
a13899c5 39 ///\r
40 private static final long serialVersionUID = 2958136136667310962L;\r
41\r
43dc3851 42 ///\r
43 /// Define Class Members\r
44 ///\r
a13899c5 45 private JPanel jContentPane = null;\r
46\r
47 private JLabel jLabel = null;\r
48\r
49 private JLabel jLabel1 = null;\r
50\r
51 private JLabel jLabel2 = null;\r
52\r
53 private JButton jButtonOK = null;\r
54\r
79cb6fdb 55 private JLabel jLabelImage = null;\r
56\r
a13899c5 57 /**\r
58 This method initializes jButtonOK \r
59 \r
60 @return javax.swing.JButton jButtonOK\r
61 \r
62 **/\r
63 private JButton getJButtonOK() {\r
64 if (jButtonOK == null) {\r
65 jButtonOK = new JButton();\r
2003a22e 66 jButtonOK.setBounds(new java.awt.Rectangle(115, 200, 90, 20));\r
a13899c5 67 jButtonOK.setText("OK");\r
68 jButtonOK.addActionListener(this);\r
69 }\r
70 return jButtonOK;\r
71 }\r
72\r
a13899c5 73 /**\r
74 This is the default constructor\r
75 \r
76 **/\r
77 public About() {\r
78 super();\r
79 init();\r
80 }\r
2003a22e 81\r
a13899c5 82 /**\r
2003a22e 83 This is the default constructor\r
84 \r
85 **/\r
86 public About(IFrame parentFrame, boolean modal) {\r
87 super(parentFrame, modal);\r
88 init();\r
89 }\r
a13899c5 90\r
91 /**\r
92 This method initializes this\r
93 \r
94 **/\r
95 private void init() {\r
79cb6fdb 96 this.setSize(320, 265);\r
a13899c5 97 this.setContentPane(getJContentPane());\r
98 this.setTitle("About");\r
99 this.getRootPane().setDefaultButton(jButtonOK);\r
100 this.centerWindow();\r
101 }\r
102\r
103 /**\r
104 This method initializes jContentPane\r
105 \r
106 @return javax.swing.JPanel jContentPane\r
107 \r
108 **/\r
109 private JPanel getJContentPane() {\r
110 if (jContentPane == null) {\r
79cb6fdb 111 jLabelImage = new JLabel();\r
2003a22e 112 jLabelImage.setBounds(new java.awt.Rectangle(63, 20, 193, 58));\r
79cb6fdb 113 jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/logo.gif")));\r
2003a22e 114\r
a13899c5 115 jLabel2 = new JLabel();\r
2003a22e 116 jLabel2.setBounds(new java.awt.Rectangle(25, 160, 270, 20));\r
a13899c5 117 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
118 jLabel2.setText("All rights reserved");\r
119 jLabel1 = new JLabel();\r
2003a22e 120 jLabel1.setBounds(new java.awt.Rectangle(25, 130, 270, 20));\r
a13899c5 121 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
122 jLabel1.setText("Copyright (c) 2006, Intel Corporation");\r
123 jLabel = new JLabel();\r
124 jLabel.setToolTipText("");\r
2003a22e 125 jLabel.setBounds(new java.awt.Rectangle(25, 90, 270, 20));\r
a13899c5 126 jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
8f9acbd7 127 jLabel.setText(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION);\r
a13899c5 128 jContentPane = new JPanel();\r
129 jContentPane.setLayout(null);\r
2003a22e 130 jContentPane.setSize(new java.awt.Dimension(320, 235));\r
a13899c5 131 jContentPane.add(jLabel, null);\r
132 jContentPane.add(jLabel1, null);\r
133 jContentPane.add(jLabel2, null);\r
134 jContentPane.add(getJButtonOK(), null);\r
79cb6fdb 135 jContentPane.add(jLabelImage, null);\r
a13899c5 136 }\r
137 return jContentPane;\r
138 }\r
139\r
140 /* (non-Javadoc)\r
141 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
142 * \r
143 * Override actionPerformed to listen all actions\r
144 */\r
145 public void actionPerformed(ActionEvent arg0) {\r
146 if (arg0.getSource() == jButtonOK) {\r
147 returnType = DataType.RETURN_TYPE_OK;\r
148 this.setVisible(false);\r
149 }\r
150 }\r
151\r
152 /**\r
153 Dispose when windows is closing\r
154 \r
155 @param arg0\r
156 \r
157 **/\r
158 public void windowClosing(WindowEvent arg0) {\r
159 this.dispose();\r
160 }\r
161}\r