]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
0e4cfd2a989f3b23cb2b74f94f9b3c09c308da10
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
;
30 The class is used to show a about window with copyright information
34 public class About
extends IDialog
{
37 /// Define class Serial Version UID
39 private static final long serialVersionUID
= 2958136136667310962L;
42 //Define class members
44 private JPanel jContentPane
= null;
46 private JLabel jLabel
= null;
48 private JLabel jLabel1
= null;
50 private JLabel jLabel2
= null;
52 private JButton jButtonOK
= null;
55 This method initializes jButtonOK
57 @return javax.swing.JButton jButtonOK
60 private JButton
getJButtonOK() {
61 if (jButtonOK
== null) {
62 jButtonOK
= new JButton();
63 jButtonOK
.setBounds(new java
.awt
.Rectangle(105, 120, 90, 20));
64 jButtonOK
.setText("OK");
65 jButtonOK
.addActionListener(this);
70 public static void main(String
[] args
) {
71 About a
= new About();
76 This is the default constructor
85 This is the default constructor
88 public About(IFrame parentFrame
, boolean modal
) {
89 super(parentFrame
, modal
);
94 This method initializes this
98 this.setSize(300, 200);
99 this.setContentPane(getJContentPane());
100 this.setTitle("About");
101 this.getRootPane().setDefaultButton(jButtonOK
);
106 This method initializes jContentPane
108 @return javax.swing.JPanel jContentPane
111 private JPanel
getJContentPane() {
112 if (jContentPane
== null) {
113 jLabel2
= new JLabel();
114 jLabel2
.setBounds(new java
.awt
.Rectangle(15, 80, 270, 20));
115 jLabel2
.setHorizontalAlignment(javax
.swing
.SwingConstants
.CENTER
);
116 jLabel2
.setText("All rights reserved");
117 jLabel1
= new JLabel();
118 jLabel1
.setBounds(new java
.awt
.Rectangle(15, 50, 270, 20));
119 jLabel1
.setHorizontalAlignment(javax
.swing
.SwingConstants
.CENTER
);
120 jLabel1
.setText("Copyright (c) 2006, Intel Corporation");
121 jLabel
= new JLabel();
122 jLabel
.setToolTipText("");
123 jLabel
.setBounds(new java
.awt
.Rectangle(15, 20, 270, 20));
124 jLabel
.setHorizontalAlignment(javax
.swing
.SwingConstants
.CENTER
);
125 jLabel
.setText("Framework Development Package System 1.0");
126 jContentPane
= new JPanel();
127 jContentPane
.setLayout(null);
128 jContentPane
.add(jLabel
, null);
129 jContentPane
.add(jLabel1
, null);
130 jContentPane
.add(jLabel2
, null);
131 jContentPane
.add(getJButtonOK(), null);
137 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
139 * Override actionPerformed to listen all actions
141 public void actionPerformed(ActionEvent arg0
) {
142 if (arg0
.getSource() == jButtonOK
) {
143 returnType
= DataType
.RETURN_TYPE_OK
;
144 this.setVisible(false);
149 Dispose when windows is closing
154 public void windowClosing(WindowEvent arg0
) {