]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
0e4cfd2a989f3b23cb2b74f94f9b3c09c308da10
[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
29 /**
30 The class is used to show a about window with copyright information
31 It extends IDialog
32
33 **/
34 public class About extends IDialog {
35
36 ///
37 /// Define class Serial Version UID
38 ///
39 private static final long serialVersionUID = 2958136136667310962L;
40
41 //
42 //Define class members
43 //
44 private JPanel jContentPane = null;
45
46 private JLabel jLabel = null;
47
48 private JLabel jLabel1 = null;
49
50 private JLabel jLabel2 = null;
51
52 private JButton jButtonOK = null;
53
54 /**
55 This method initializes jButtonOK
56
57 @return javax.swing.JButton jButtonOK
58
59 **/
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);
66 }
67 return jButtonOK;
68 }
69
70 public static void main(String[] args) {
71 About a = new About();
72 a.setVisible(true);
73 }
74
75 /**
76 This is the default constructor
77
78 **/
79 public About() {
80 super();
81 init();
82 }
83
84 /**
85 This is the default constructor
86
87 **/
88 public About(IFrame parentFrame, boolean modal) {
89 super(parentFrame, modal);
90 init();
91 }
92
93 /**
94 This method initializes this
95
96 **/
97 private void init() {
98 this.setSize(300, 200);
99 this.setContentPane(getJContentPane());
100 this.setTitle("About");
101 this.getRootPane().setDefaultButton(jButtonOK);
102 this.centerWindow();
103 }
104
105 /**
106 This method initializes jContentPane
107
108 @return javax.swing.JPanel jContentPane
109
110 **/
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);
132 }
133 return jContentPane;
134 }
135
136 /* (non-Javadoc)
137 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
138 *
139 * Override actionPerformed to listen all actions
140 */
141 public void actionPerformed(ActionEvent arg0) {
142 if (arg0.getSource() == jButtonOK) {
143 returnType = DataType.RETURN_TYPE_OK;
144 this.setVisible(false);
145 }
146 }
147
148 /**
149 Dispose when windows is closing
150
151 @param arg0
152
153 **/
154 public void windowClosing(WindowEvent arg0) {
155 this.dispose();
156 }
157 }