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