]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/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);
73 public static void main(String
[] args
) {
74 About a
= new About();
79 This is the default constructor
88 This is the default constructor
91 public About(IFrame parentFrame
, boolean modal
) {
92 super(parentFrame
, modal
);
97 This method initializes this
100 private void init() {
101 this.setSize(320, 265);
102 this.setContentPane(getJContentPane());
103 this.setTitle("About");
104 this.getRootPane().setDefaultButton(jButtonOK
);
109 This method initializes jContentPane
111 @return javax.swing.JPanel jContentPane
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")));
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);
146 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
148 * Override actionPerformed to listen all actions
150 public void actionPerformed(ActionEvent arg0
) {
151 if (arg0
.getSource() == jButtonOK
) {
152 returnType
= DataType
.RETURN_TYPE_OK
;
153 this.setVisible(false);
158 Dispose when windows is closing
163 public void windowClosing(WindowEvent arg0
) {