]> git.proxmox.com Git - mirror_edk2.git/blob - 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
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 /**
74 This is the default constructor
75
76 **/
77 public About() {
78 super();
79 init();
80 }
81
82 /**
83 This is the default constructor
84
85 **/
86 public About(IFrame parentFrame, boolean modal) {
87 super(parentFrame, modal);
88 init();
89 }
90
91 /**
92 This method initializes this
93
94 **/
95 private void init() {
96 this.setSize(320, 265);
97 this.setContentPane(getJContentPane());
98 this.setTitle("About");
99 this.getRootPane().setDefaultButton(jButtonOK);
100 this.centerWindow();
101 }
102
103 /**
104 This method initializes jContentPane
105
106 @return javax.swing.JPanel jContentPane
107
108 **/
109 private JPanel getJContentPane() {
110 if (jContentPane == null) {
111 jLabelImage = new JLabel();
112 jLabelImage.setBounds(new java.awt.Rectangle(63, 20, 193, 58));
113 jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/logo.gif")));
114
115 jLabel2 = new JLabel();
116 jLabel2.setBounds(new java.awt.Rectangle(25, 160, 270, 20));
117 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
118 jLabel2.setText("All rights reserved");
119 jLabel1 = new JLabel();
120 jLabel1.setBounds(new java.awt.Rectangle(25, 130, 270, 20));
121 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
122 jLabel1.setText("Copyright (c) 2006, Intel Corporation");
123 jLabel = new JLabel();
124 jLabel.setToolTipText("");
125 jLabel.setBounds(new java.awt.Rectangle(25, 90, 270, 20));
126 jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
127 jLabel.setText(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION);
128 jContentPane = new JPanel();
129 jContentPane.setLayout(null);
130 jContentPane.setSize(new java.awt.Dimension(320, 235));
131 jContentPane.add(jLabel, null);
132 jContentPane.add(jLabel1, null);
133 jContentPane.add(jLabel2, null);
134 jContentPane.add(getJButtonOK(), null);
135 jContentPane.add(jLabelImage, null);
136 }
137 return jContentPane;
138 }
139
140 /* (non-Javadoc)
141 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
142 *
143 * Override actionPerformed to listen all actions
144 */
145 public void actionPerformed(ActionEvent arg0) {
146 if (arg0.getSource() == jButtonOK) {
147 returnType = DataType.RETURN_TYPE_OK;
148 this.setVisible(false);
149 }
150 }
151
152 /**
153 Dispose when windows is closing
154
155 @param arg0
156
157 **/
158 public void windowClosing(WindowEvent arg0) {
159 this.dispose();
160 }
161 }