]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
3 To show a about window with copyright information
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
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.
16 package org
.tianocore
.frameworkwizard
;
18 import java
.awt
.event
.ActionEvent
;
19 import java
.awt
.event
.WindowEvent
;
21 import javax
.swing
.JButton
;
22 import javax
.swing
.JLabel
;
23 import javax
.swing
.JPanel
;
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
;
31 The class is used to show a about window with copyright information
35 public class About
extends IDialog
{
38 /// Define Class Serial Version UID
40 private static final long serialVersionUID
= 2958136136667310962L;
43 /// Define Class Members
45 private JPanel jContentPane
= null;
47 private JLabel jLabel
= null;
49 private JLabel jLabel1
= null;
51 private JLabel jLabel2
= null;
53 private JButton jButtonOK
= null;
55 private JLabel jLabelImage
= null;
58 This method initializes jButtonOK
60 @return javax.swing.JButton jButtonOK
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);
74 This is the default constructor
83 This is the default constructor
86 public About(IFrame parentFrame
, boolean modal
) {
87 super(parentFrame
, modal
);
92 This method initializes this
96 this.setSize(320, 265);
97 this.setContentPane(getJContentPane());
98 this.setTitle("About");
99 this.getRootPane().setDefaultButton(jButtonOK
);
104 This method initializes jContentPane
106 @return javax.swing.JPanel jContentPane
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")));
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);
141 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
143 * Override actionPerformed to listen all actions
145 public void actionPerformed(ActionEvent arg0
) {
146 if (arg0
.getSource() == jButtonOK
) {
147 returnType
= DataType
.RETURN_TYPE_OK
;
148 this.setVisible(false);
153 Dispose when windows is closing
158 public void windowClosing(WindowEvent arg0
) {