]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | \r | |
3 | To show a about window with copyright information\r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation\r | |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | package org.tianocore.packaging.module.ui;\r | |
17 | \r | |
18 | import java.awt.event.ActionEvent;\r | |
19 | import java.awt.event.WindowEvent;\r | |
20 | \r | |
21 | import javax.swing.JButton;\r | |
22 | import javax.swing.JLabel;\r | |
23 | import javax.swing.JPanel;\r | |
24 | \r | |
25 | import org.tianocore.packaging.common.ui.IDialog;\r | |
26 | \r | |
27 | /**\r | |
28 | The class is used to show a about window with copyright information\r | |
29 | It extends IDialog\r | |
30 | \r | |
31 | @since ModuleEditor 1.0\r | |
32 | \r | |
33 | **/\r | |
34 | public class ModuleAbout extends IDialog {\r | |
35 | \r | |
36 | ///\r | |
37 | /// Define class Serial Version UID\r | |
38 | ///\r | |
39 | private static final long serialVersionUID = 2958136136667310962L;\r | |
40 | \r | |
41 | //\r | |
42 | //Define class members\r | |
43 | //\r | |
44 | private JPanel jContentPane = null;\r | |
45 | \r | |
46 | private JLabel jLabel = null;\r | |
47 | \r | |
48 | private JLabel jLabel1 = null;\r | |
49 | \r | |
50 | private JLabel jLabel2 = null;\r | |
51 | \r | |
52 | private JButton jButtonOK = null;\r | |
53 | \r | |
54 | /**\r | |
55 | This method initializes jButtonOK \r | |
56 | \r | |
57 | @return javax.swing.JButton jButtonOK\r | |
58 | \r | |
59 | **/\r | |
60 | private JButton getJButtonOK() {\r | |
61 | if (jButtonOK == null) {\r | |
62 | jButtonOK = new JButton();\r | |
63 | jButtonOK.setBounds(new java.awt.Rectangle(105, 120, 90, 20));\r | |
64 | jButtonOK.setText("OK");\r | |
65 | jButtonOK.addActionListener(this);\r | |
66 | }\r | |
67 | return jButtonOK;\r | |
68 | }\r | |
69 | \r | |
70 | public static void main(String[] args) {\r | |
71 | }\r | |
72 | \r | |
73 | /**\r | |
74 | This is the default constructor\r | |
75 | \r | |
76 | **/\r | |
77 | public ModuleAbout() {\r | |
78 | super();\r | |
79 | init();\r | |
80 | }\r | |
81 | \r | |
82 | /**\r | |
83 | This method initializes this\r | |
84 | \r | |
85 | **/\r | |
86 | private void init() {\r | |
87 | this.setSize(300, 200);\r | |
88 | this.setContentPane(getJContentPane());\r | |
89 | this.setTitle("About...");\r | |
90 | this.getRootPane().setDefaultButton(jButtonOK);\r | |
91 | this.centerWindow();\r | |
92 | this.setVisible(true);\r | |
93 | }\r | |
94 | \r | |
95 | /**\r | |
96 | This method initializes jContentPane\r | |
97 | \r | |
98 | @return javax.swing.JPanel jContentPane\r | |
99 | \r | |
100 | **/\r | |
101 | private JPanel getJContentPane() {\r | |
102 | if (jContentPane == null) {\r | |
103 | jLabel2 = new JLabel();\r | |
104 | jLabel2.setBounds(new java.awt.Rectangle(15, 80, 270, 20));\r | |
105 | jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r | |
106 | jLabel2.setText("All rights reserved");\r | |
107 | jLabel1 = new JLabel();\r | |
108 | jLabel1.setBounds(new java.awt.Rectangle(15, 50, 270, 20));\r | |
109 | jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r | |
110 | jLabel1.setText("Copyright (c) 2006, Intel Corporation");\r | |
111 | jLabel = new JLabel();\r | |
112 | jLabel.setToolTipText("");\r | |
113 | jLabel.setBounds(new java.awt.Rectangle(15, 20, 270, 20));\r | |
114 | jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\r | |
115 | jLabel.setText("Framework Development Package System 1.0");\r | |
116 | jContentPane = new JPanel();\r | |
117 | jContentPane.setLayout(null);\r | |
118 | jContentPane.add(jLabel, null);\r | |
119 | jContentPane.add(jLabel1, null);\r | |
120 | jContentPane.add(jLabel2, null);\r | |
121 | jContentPane.add(getJButtonOK(), null);\r | |
122 | }\r | |
123 | return jContentPane;\r | |
124 | }\r | |
125 | \r | |
126 | /* (non-Javadoc)\r | |
127 | * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r | |
128 | * \r | |
129 | * Override actionPerformed to listen all actions\r | |
130 | */\r | |
131 | public void actionPerformed(ActionEvent arg0) {\r | |
132 | if (arg0.getSource() == jButtonOK) {\r | |
133 | this.dispose();\r | |
134 | }\r | |
135 | }\r | |
136 | \r | |
137 | /**\r | |
138 | Dispose when windows is closing\r | |
139 | \r | |
140 | @param arg0\r | |
141 | \r | |
142 | **/\r | |
143 | public void windowClosing(WindowEvent arg0) {\r | |
144 | this.dispose();\r | |
145 | }\r | |
146 | }\r |