]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
Added "/FI", "-include" and/or "/nologo" options to PP (CC) command option to fpd...
[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
28\r
29/**\r
30 The class is used to show a about window with copyright information\r
31 It extends IDialog\r
32\r
33 **/\r
34public class About extends IDialog {\r
35\r
36 ///\r
37 /// Define class Serial Version UID\r
38 ///\r
39 private static final long serialVersionUID = 2958136136667310962L;\r
40\r
41 //\r
42 //Define class members\r
43 //\r
44 private JPanel jContentPane = null;\r
45\r
46 private JLabel jLabel = null;\r
47\r
48 private JLabel jLabel1 = null;\r
49\r
50 private JLabel jLabel2 = null;\r
51\r
52 private JButton jButtonOK = null;\r
53\r
54 /**\r
55 This method initializes jButtonOK \r
56 \r
57 @return javax.swing.JButton jButtonOK\r
58 \r
59 **/\r
60 private JButton getJButtonOK() {\r
61 if (jButtonOK == null) {\r
62 jButtonOK = new JButton();\r
63 jButtonOK.setBounds(new java.awt.Rectangle(105, 120, 90, 20));\r
64 jButtonOK.setText("OK");\r
65 jButtonOK.addActionListener(this);\r
66 }\r
67 return jButtonOK;\r
68 }\r
69\r
70 public static void main(String[] args) {\r
71 About a = new About();\r
72 a.setVisible(true);\r
73 }\r
74\r
75 /**\r
76 This is the default constructor\r
77 \r
78 **/\r
79 public About() {\r
80 super();\r
81 init();\r
82 }\r
83 \r
84 /**\r
85 This is the default constructor\r
86 \r
87 **/\r
88 public About(IFrame parentFrame, boolean modal) {\r
89 super(parentFrame, modal);\r
90 init();\r
91 }\r
92\r
93 /**\r
94 This method initializes this\r
95 \r
96 **/\r
97 private void init() {\r
98 this.setSize(300, 200);\r
99 this.setContentPane(getJContentPane());\r
100 this.setTitle("About");\r
101 this.getRootPane().setDefaultButton(jButtonOK);\r
102 this.centerWindow();\r
103 }\r
104\r
105 /**\r
106 This method initializes jContentPane\r
107 \r
108 @return javax.swing.JPanel jContentPane\r
109 \r
110 **/\r
111 private JPanel getJContentPane() {\r
112 if (jContentPane == null) {\r
113 jLabel2 = new JLabel();\r
114 jLabel2.setBounds(new java.awt.Rectangle(15, 80, 270, 20));\r
115 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
116 jLabel2.setText("All rights reserved");\r
117 jLabel1 = new JLabel();\r
118 jLabel1.setBounds(new java.awt.Rectangle(15, 50, 270, 20));\r
119 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
120 jLabel1.setText("Copyright (c) 2006, Intel Corporation");\r
121 jLabel = new JLabel();\r
122 jLabel.setToolTipText("");\r
123 jLabel.setBounds(new java.awt.Rectangle(15, 20, 270, 20));\r
124 jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r
125 jLabel.setText("Framework Development Package System 1.0");\r
126 jContentPane = new JPanel();\r
127 jContentPane.setLayout(null);\r
128 jContentPane.add(jLabel, null);\r
129 jContentPane.add(jLabel1, null);\r
130 jContentPane.add(jLabel2, null);\r
131 jContentPane.add(getJButtonOK(), null);\r
132 }\r
133 return jContentPane;\r
134 }\r
135\r
136 /* (non-Javadoc)\r
137 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
138 * \r
139 * Override actionPerformed to listen all actions\r
140 */\r
141 public void actionPerformed(ActionEvent arg0) {\r
142 if (arg0.getSource() == jButtonOK) {\r
143 returnType = DataType.RETURN_TYPE_OK;\r
144 this.setVisible(false);\r
145 }\r
146 }\r
147\r
148 /**\r
149 Dispose when windows is closing\r
150 \r
151 @param arg0\r
152 \r
153 **/\r
154 public void windowClosing(WindowEvent arg0) {\r
155 this.dispose();\r
156 }\r
157}\r