]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/ModuleEditor/src/org/tianocore/packaging/module/ui/ModuleAbout.java
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@671 6f19259b...
[mirror_edk2.git] / Tools / Source / ModuleEditor / src / org / tianocore / packaging / module / ui / ModuleAbout.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.packaging.module.ui;
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.packaging.common.ui.IDialog;
26
27 /**
28 The class is used to show a about window with copyright information
29 It extends IDialog
30
31 @since ModuleEditor 1.0
32
33 **/
34 public class ModuleAbout 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 }
72
73 /**
74 This is the default constructor
75
76 **/
77 public ModuleAbout() {
78 super();
79 init();
80 }
81
82 /**
83 This method initializes this
84
85 **/
86 private void init() {
87 this.setSize(300, 200);
88 this.setContentPane(getJContentPane());
89 this.setTitle("About...");
90 this.getRootPane().setDefaultButton(jButtonOK);
91 this.centerWindow();
92 this.setVisible(true);
93 }
94
95 /**
96 This method initializes jContentPane
97
98 @return javax.swing.JPanel jContentPane
99
100 **/
101 private JPanel getJContentPane() {
102 if (jContentPane == null) {
103 jLabel2 = new JLabel();
104 jLabel2.setBounds(new java.awt.Rectangle(15, 80, 270, 20));
105 jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
106 jLabel2.setText("All rights reserved");
107 jLabel1 = new JLabel();
108 jLabel1.setBounds(new java.awt.Rectangle(15, 50, 270, 20));
109 jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
110 jLabel1.setText("Copyright (c) 2006, Intel Corporation");
111 jLabel = new JLabel();
112 jLabel.setToolTipText("");
113 jLabel.setBounds(new java.awt.Rectangle(15, 20, 270, 20));
114 jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
115 jLabel.setText("Framework Development Package System 1.0");
116 jContentPane = new JPanel();
117 jContentPane.setLayout(null);
118 jContentPane.add(jLabel, null);
119 jContentPane.add(jLabel1, null);
120 jContentPane.add(jLabel2, null);
121 jContentPane.add(getJButtonOK(), null);
122 }
123 return jContentPane;
124 }
125
126 /* (non-Javadoc)
127 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
128 *
129 * Override actionPerformed to listen all actions
130 */
131 public void actionPerformed(ActionEvent arg0) {
132 if (arg0.getSource() == jButtonOK) {
133 this.dispose();
134 }
135 }
136
137 /**
138 Dispose when windows is closing
139
140 @param arg0
141
142 **/
143 public void windowClosing(WindowEvent arg0) {
144 this.dispose();
145 }
146 }