comment out item type checking temporarily when adding module to fpd file.
[mirror_edk2.git] / Tools / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / platform / ui / FpdHeader.java
CommitLineData
a13899c5 1/** @file\r
2 \r
3 The file is used to create, update FpdHeader of Fpd file\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
16package org.tianocore.frameworkwizard.platform.ui;\r
17\r
18import java.awt.Dimension;\r
a13899c5 19import java.awt.event.ActionEvent;\r
20import java.awt.event.ComponentEvent;\r
21import java.awt.event.FocusAdapter;\r
22import java.awt.event.FocusEvent;\r
1faac7b6 23import java.util.Vector;\r
a13899c5 24\r
25import javax.swing.JButton;\r
d6d24759 26import javax.swing.JFrame;\r
a13899c5 27import javax.swing.JLabel;\r
d6d24759 28import javax.swing.JOptionPane;\r
a13899c5 29import javax.swing.JPanel;\r
30import javax.swing.JScrollPane;\r
31import javax.swing.JTextArea;\r
32import javax.swing.JTextField;\r
33\r
34\r
a13899c5 35\r
36import org.tianocore.PlatformSurfaceAreaDocument;\r
a13899c5 37\r
a13899c5 38import org.tianocore.frameworkwizard.common.DataValidation;\r
a13899c5 39import org.tianocore.frameworkwizard.common.Tools;\r
d6d24759 40import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;\r
a13899c5 41import org.tianocore.frameworkwizard.common.ui.IInternalFrame;\r
42import org.tianocore.frameworkwizard.common.ui.StarLabel;\r
43\r
44/**\r
45 The class is used to create, update FpdHeader of Fpd file\r
46 It extends IInternalFrame\r
47 \r
48 @since PackageEditor 1.0\r
49\r
50 **/\r
51public class FpdHeader extends IInternalFrame {\r
52\r
53 ///\r
54 /// Define class Serial Version UID\r
55 ///\r
56 private static final long serialVersionUID = -8152099582923006900L;\r
57\r
d6d24759 58 static JFrame frame;\r
a13899c5 59 //\r
60 //Define class members\r
61 //\r
62 private JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="10,53"\r
63\r
64 private JLabel jLabelBaseName = null;\r
65\r
66 private JTextField jTextFieldBaseName = null;\r
67\r
68 private JLabel jLabelGuid = null;\r
69\r
70 private JTextField jTextFieldGuid = null;\r
71\r
72 private JLabel jLabelVersion = null;\r
73\r
74 private JTextField jTextFieldVersion = null;\r
75\r
76 private JButton jButtonGenerateGuid = null;\r
77\r
78 private JLabel jLabelLicense = null;\r
79\r
80 private JTextArea jTextAreaLicense = null;\r
81\r
82 private JLabel jLabelCopyright = null;\r
83\r
84 private JLabel jLabelDescription = null;\r
85\r
86 private JTextArea jTextAreaDescription = null;\r
87\r
88 private JLabel jLabelSpecification = null;\r
89\r
90 private JTextField jTextFieldSpecification = null;\r
91\r
92 private JButton jButtonOk = null;\r
93\r
94 private JButton jButtonCancel = null;\r
95\r
96 private JScrollPane jScrollPaneLicense = null;\r
97\r
98 private JScrollPane jScrollPaneDescription = null;\r
99\r
100 private JLabel jLabelAbstract = null;\r
101\r
102 private JTextField jTextFieldAbstract = null;\r
103\r
104 private StarLabel jStarLabel1 = null;\r
105\r
106 private StarLabel jStarLabel2 = null;\r
107\r
108 private StarLabel jStarLabel3 = null;\r
109\r
110 private StarLabel jStarLabel4 = null;\r
111\r
112 private StarLabel jStarLabel5 = null;\r
113\r
114 private StarLabel jStarLabel6 = null;\r
115\r
116 private StarLabel jStarLabel7 = null;\r
117\r
118 private StarLabel jStarLabel8 = null;\r
119\r
120 private StarLabel jStarLabel9 = null;\r
121 \r
122 private JTextField jTextFieldCopyright = null;\r
123\r
124 private JLabel jLabel = null;\r
125\r
4da2e625 126 private JTextField jTextFieldUrl = null;\r
a13899c5 127 \r
128 private FpdFileContents ffc = null;\r
d6d24759 129 \r
130 private OpeningPlatformType docConsole = null;\r
a13899c5 131\r
132 /**\r
133 This method initializes jTextFieldBaseName \r
134 \r
135 @return javax.swing.JTextField jTextFieldBaseName\r
136 \r
137 **/\r
138 private JTextField getJTextFieldBaseName() {\r
139 if (jTextFieldBaseName == null) {\r
140 jTextFieldBaseName = new JTextField();\r
141 jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));\r
142 jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320,20));\r
143 jTextFieldBaseName.addFocusListener(new FocusAdapter(){\r
144 public void focusLost(FocusEvent e) {\r
d6d24759 145 if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {\r
146 JOptionPane.showMessageDialog(frame, "Package Name is NOT UiNameType.");\r
147 return;\r
148 }\r
a490bca8 149 if (jTextFieldBaseName.getText().equals(ffc.getFpdHdrPlatformName())) {\r
150 return;\r
151 }\r
d6d24759 152 docConsole.setSaved(false);\r
a13899c5 153 ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText());\r
154 } \r
155 });\r
156 }\r
157 return jTextFieldBaseName;\r
158 }\r
159\r
160 /**\r
161 This method initializes jTextFieldGuid \r
162 \r
163 @return javax.swing.JTextField jTextFieldGuid\r
164 \r
165 **/\r
166 private JTextField getJTextFieldGuid() {\r
167 if (jTextFieldGuid == null) {\r
168 jTextFieldGuid = new JTextField();\r
169 jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 35, 250, 20));\r
170 jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250,20));\r
171 jTextFieldGuid.addFocusListener(new FocusAdapter(){\r
172 public void focusLost(FocusEvent e) {\r
d6d24759 173 if (!DataValidation.isGuid(jTextFieldGuid.getText())) {\r
174 JOptionPane.showMessageDialog(frame, "Guid is NOT GuidType.");\r
175 return;\r
176 }\r
a490bca8 177 if (jTextFieldGuid.getText().equals(ffc.getFpdHdrGuidValue())) {\r
178 return;\r
179 }\r
d6d24759 180 docConsole.setSaved(false);\r
a13899c5 181 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());\r
182 } \r
183 });\r
184 }\r
185 return jTextFieldGuid;\r
186 }\r
187\r
188 /**\r
189 This method initializes jTextFieldVersion \r
190 \r
191 @return javax.swing.JTextField jTextFieldVersion\r
192 \r
193 **/\r
194 private JTextField getJTextFieldVersion() {\r
195 if (jTextFieldVersion == null) {\r
196 jTextFieldVersion = new JTextField();\r
197 jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 60, 320, 20));\r
198 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320,20));\r
199 jTextFieldVersion.addFocusListener(new FocusAdapter(){\r
200 public void focusLost(FocusEvent e) {\r
d6d24759 201 if (!DataValidation.isVersion(jTextFieldVersion.getText())) {\r
202 JOptionPane.showMessageDialog(frame, "Version is NOT version type.");\r
203 return;\r
204 }\r
a490bca8 205 if (jTextFieldVersion.getText().equals(ffc.getFpdHdrVer())) {\r
206 return;\r
207 }\r
d6d24759 208 docConsole.setSaved(false);\r
a13899c5 209 ffc.setFpdHdrVer(jTextFieldVersion.getText());\r
210 } \r
211 });\r
212 }\r
213 return jTextFieldVersion;\r
214 }\r
215\r
216 /**\r
217 This method initializes jButtonGenerateGuid \r
218 \r
219 @return javax.swing.JButton jButtonGenerateGuid\r
220 \r
221 **/\r
222 private JButton getJButtonGenerateGuid() {\r
223 if (jButtonGenerateGuid == null) {\r
224 jButtonGenerateGuid = new JButton();\r
225 jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 35, 65, 20));\r
226 jButtonGenerateGuid.setText("GEN");\r
227 jButtonGenerateGuid.addActionListener(this);\r
228 }\r
229 return jButtonGenerateGuid;\r
230 }\r
231\r
232 /**\r
233 This method initializes jTextAreaLicense \r
234 \r
235 @return javax.swing.JTextArea jTextAreaLicense\r
236 \r
237 **/\r
238 private JTextArea getJTextAreaLicense() {\r
239 if (jTextAreaLicense == null) {\r
240 jTextAreaLicense = new JTextArea();\r
241 jTextAreaLicense.setText("");\r
a13899c5 242 jTextAreaLicense.setLineWrap(true);\r
243 jTextAreaLicense.addFocusListener(new FocusAdapter(){\r
244 public void focusLost(FocusEvent e) {\r
d6d24759 245 if (jTextAreaLicense.getText().length() == 0) {\r
246 JOptionPane.showMessageDialog(frame, "License contents could NOT be empty.");\r
247 return;\r
248 }\r
a490bca8 249 if (jTextAreaLicense.getText().equals(ffc.getFpdHdrLicense())) {\r
250 return;\r
251 }\r
d6d24759 252 docConsole.setSaved(false);\r
a13899c5 253 ffc.setFpdHdrLicense(jTextAreaLicense.getText());\r
254 } \r
255 });\r
256 }\r
257 return jTextAreaLicense;\r
258 }\r
259\r
260 /**\r
261 This method initializes jTextAreaDescription \r
262 \r
263 @return javax.swing.JTextArea jTextAreaDescription\r
264 \r
265 **/\r
266 private JTextArea getJTextAreaDescription() {\r
267 if (jTextAreaDescription == null) {\r
268 jTextAreaDescription = new JTextArea();\r
269 jTextAreaDescription.setLineWrap(true);\r
a13899c5 270 jTextAreaDescription.addFocusListener(new FocusAdapter(){\r
271 public void focusLost(FocusEvent e) {\r
d6d24759 272 if (jTextAreaDescription.getText().length() == 0) {\r
273 JOptionPane.showMessageDialog(frame, "Description contents could NOT be empty.");\r
274 return;\r
275 }\r
a490bca8 276 if (jTextAreaDescription.getText().equals(ffc.getFpdHdrDescription())) {\r
277 return;\r
278 }\r
d6d24759 279 docConsole.setSaved(false);\r
a13899c5 280 ffc.setFpdHdrDescription(jTextAreaDescription.getText());\r
281 } \r
282 });\r
283 }\r
284 return jTextAreaDescription;\r
285 }\r
286\r
287 /**\r
288 This method initializes jTextFieldSpecification \r
289 \r
290 @return javax.swing.JTextField jTextFieldSpecification\r
291 \r
292 **/\r
293 private JTextField getJTextFieldSpecification() {\r
294 if (jTextFieldSpecification == null) {\r
295 jTextFieldSpecification = new JTextField();\r
410e0e9f 296 jTextFieldSpecification.setBounds(new java.awt.Rectangle(160,328,320,20));\r
a13899c5 297 jTextFieldSpecification.setEditable(false);\r
298 jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320,20));\r
299 jTextFieldSpecification.addFocusListener(new FocusAdapter(){\r
300 public void focusLost(FocusEvent e) {\r
301 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());\r
302 } \r
303 });\r
304 }\r
305 return jTextFieldSpecification;\r
306 }\r
307\r
308 /**\r
309 This method initializes jButtonOk \r
310 \r
311 @return javax.swing.JButton jButtonOk\r
312 \r
313 **/\r
314 private JButton getJButtonOk() {\r
315 if (jButtonOk == null) {\r
316 jButtonOk = new JButton();\r
317 jButtonOk.setText("OK");\r
318 jButtonOk.setBounds(new java.awt.Rectangle(290,351,90,20));\r
319 jButtonOk.setVisible(false);\r
320 jButtonOk.addActionListener(this);\r
321 }\r
322 return jButtonOk;\r
323 }\r
324\r
325 /**\r
326 This method initializes jButtonCancel \r
327 \r
328 @return javax.swing.JButton jButtonCancel\r
329 \r
330 **/\r
331 private JButton getJButtonCancel() {\r
332 if (jButtonCancel == null) {\r
333 jButtonCancel = new JButton();\r
334 jButtonCancel.setText("Cancel");\r
335 jButtonCancel.setBounds(new java.awt.Rectangle(390,351,90,20));\r
336 jButtonCancel.setVisible(false);\r
337 jButtonCancel.addActionListener(this);\r
338 }\r
339 return jButtonCancel;\r
340 }\r
341\r
342 /**\r
343 This method initializes jScrollPaneLicense \r
344 \r
345 @return javax.swing.JScrollPane jScrollPaneLicense\r
346 \r
347 **/\r
348 private JScrollPane getJScrollPaneLicense() {\r
349 if (jScrollPaneLicense == null) {\r
350 jScrollPaneLicense = new JScrollPane();\r
410e0e9f 351 jScrollPaneLicense.setBounds(new java.awt.Rectangle(160,107,320,80));\r
a13899c5 352 jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
353 jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(320,80));\r
354 jScrollPaneLicense.setViewportView(getJTextAreaLicense());\r
355 }\r
356 return jScrollPaneLicense;\r
357 }\r
358\r
359 /**\r
360 This method initializes jScrollPaneDescription \r
361 \r
362 @return javax.swing.JScrollPane jScrollPaneDescription\r
363 \r
364 **/\r
365 private JScrollPane getJScrollPaneDescription() {\r
366 if (jScrollPaneDescription == null) {\r
367 jScrollPaneDescription = new JScrollPane();\r
410e0e9f 368 jScrollPaneDescription.setBounds(new java.awt.Rectangle(160,243,320,80));\r
a13899c5 369 jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);\r
370 jScrollPaneDescription.setViewportView(getJTextAreaDescription());\r
371 }\r
372 return jScrollPaneDescription;\r
373 }\r
374\r
375 /**\r
376 This method initializes jTextFieldAbstract \r
377 \r
378 @return javax.swing.JTextField jTextFieldAbstract\r
379 \r
380 **/\r
381 private JTextField getJTextFieldAbstract() {\r
382 if (jTextFieldAbstract == null) {\r
383 jTextFieldAbstract = new JTextField();\r
410e0e9f 384 jTextFieldAbstract.setBounds(new java.awt.Rectangle(160,218,320,20));\r
a13899c5 385 jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));\r
386 jTextFieldAbstract.addFocusListener(new FocusAdapter(){\r
387 public void focusLost(FocusEvent e) {\r
d6d24759 388 if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {\r
389 JOptionPane.showMessageDialog(frame, "Abstract could NOT be empty.");\r
390 return;\r
391 }\r
a490bca8 392 if (jTextFieldAbstract.getText().equals(ffc.getFpdHdrAbs())) {\r
393 return;\r
394 }\r
d6d24759 395 docConsole.setSaved(false);\r
a13899c5 396 ffc.setFpdHdrAbs(jTextFieldAbstract.getText());\r
397 } \r
398 });\r
399 }\r
400 return jTextFieldAbstract;\r
401 }\r
402\r
403 /**\r
404 This method initializes jTextFieldCopyright \r
405 \r
406 @return javax.swing.JTextField jTextFieldCopyright\r
407 \r
408 **/\r
409 private JTextField getJTextFieldCopyright() {\r
410 if (jTextFieldCopyright == null) {\r
411 jTextFieldCopyright = new JTextField();\r
410e0e9f 412 jTextFieldCopyright.setBounds(new java.awt.Rectangle(160,85,320,20));\r
a13899c5 413 jTextFieldCopyright.setPreferredSize(new java.awt.Dimension(320,20));\r
414 jTextFieldCopyright.addFocusListener(new FocusAdapter(){\r
415 public void focusLost(FocusEvent e) {\r
d6d24759 416 if (!DataValidation.isCopyright(jTextFieldCopyright.getText())) {\r
417 JOptionPane.showMessageDialog(frame, "Copyright contents could not be empty.");\r
418 return;\r
419 }\r
a490bca8 420 if (jTextFieldCopyright.getText().equals(ffc.getFpdHdrCopyright())) {\r
421 return;\r
422 }\r
d6d24759 423 docConsole.setSaved(false);\r
a13899c5 424 ffc.setFpdHdrCopyright(jTextFieldCopyright.getText());\r
425 } \r
426 });\r
427 }\r
428 return jTextFieldCopyright;\r
429 }\r
430\r
431 /**\r
432 * This method initializes jTextField \r
433 * \r
434 * @return javax.swing.JTextField \r
435 */\r
4da2e625 436 private JTextField getJTextFieldUrl() {\r
437 if (jTextFieldUrl == null) {\r
438 jTextFieldUrl = new JTextField();\r
439 jTextFieldUrl.setBounds(new java.awt.Rectangle(160,193,320,20));\r
440 jTextFieldUrl.setPreferredSize(new Dimension(320, 20));\r
441 jTextFieldUrl.addFocusListener(new FocusAdapter(){\r
a13899c5 442 public void focusLost(FocusEvent e){\r
4da2e625 443 if (jTextFieldUrl.getText().length() == 0 && ffc.getFpdHdrUrl() == null) {\r
a490bca8 444 return;\r
445 }\r
4da2e625 446 if (jTextFieldUrl.getText().equals(ffc.getFpdHdrUrl())) {\r
a490bca8 447 return;\r
448 }\r
a13899c5 449 ffc.setFpdHdrLicense(jTextAreaLicense.getText());\r
4da2e625 450 ffc.setFpdHdrUrl(jTextFieldUrl.getText());\r
d6d24759 451 docConsole.setSaved(false);\r
a13899c5 452 } \r
453 });\r
454 }\r
4da2e625 455 return jTextFieldUrl;\r
a13899c5 456 }\r
457\r
458 public static void main(String[] args) {\r
459 new FpdHeader().setVisible(true);\r
460 }\r
461\r
462 /**\r
463 This is the default constructor\r
464 \r
465 **/\r
466 public FpdHeader() {\r
467 super();\r
468 init();\r
469 this.setVisible(true);\r
470 }\r
471\r
472 /**\r
473 This is the override edit constructor\r
474 \r
475 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader\r
476 \r
477 **/\r
478 public FpdHeader(PlatformSurfaceAreaDocument.PlatformSurfaceArea inFpd) {\r
479 this();\r
480 ffc = new FpdFileContents(inFpd);\r
481 init(ffc);\r
482 \r
483 }\r
d6d24759 484 \r
485 public FpdHeader(OpeningPlatformType opt) {\r
486 this(opt.getXmlFpd());\r
487 docConsole = opt;\r
488 }\r
a13899c5 489\r
490 /**\r
491 This method initializes this\r
492 \r
493 **/\r
494 private void init() {\r
495 //this.setSize(500, 515);\r
496 this.setContentPane(getJContentPane());\r
497 this.setTitle("Package Surface Area Header");\r
498 initFrame();\r
499 \r
500 }\r
501\r
502 /**\r
503 This method initializes this\r
504 Fill values to all fields if these values are not empty\r
505 \r
506 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader\r
507 \r
508 **/\r
509 private void init(FpdFileContents ffc) {\r
510\r
511 if (ffc.getFpdHdrPlatformName() != null) {\r
512 jTextFieldBaseName.setText(ffc.getFpdHdrPlatformName());\r
513 }\r
514 if (ffc.getFpdHdrGuidValue() != null) {\r
515 jTextFieldGuid.setText(ffc.getFpdHdrGuidValue());\r
516 }\r
517 if (ffc.getFpdHdrVer() != null) {\r
518 jTextFieldVersion.setText(ffc.getFpdHdrVer());\r
519 }\r
520 if (ffc.getFpdHdrLicense() != null) {\r
521 jTextAreaLicense.setText(ffc.getFpdHdrLicense());\r
522 }\r
44053733 523 if (ffc.getFpdHdrAbs() != null) {\r
524 jTextFieldAbstract.setText(ffc.getFpdHdrAbs());\r
525 }\r
a13899c5 526 if (ffc.getFpdHdrUrl() != null) {\r
4da2e625 527 jTextFieldUrl.setText(ffc.getFpdHdrUrl());\r
a13899c5 528 }\r
529 if (ffc.getFpdHdrCopyright() != null) {\r
530 jTextFieldCopyright.setText(ffc.getFpdHdrCopyright());\r
531 }\r
532 if (ffc.getFpdHdrDescription() != null) {\r
533 jTextAreaDescription.setText(ffc.getFpdHdrDescription());\r
534 }\r
535 if (ffc.getFpdHdrSpec() != null) {\r
536 jTextFieldSpecification.setText(ffc.getFpdHdrSpec());\r
537 }\r
1faac7b6 538 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());\r
539 \r
540 ffc.genPlatformDefsSkuInfo("0", "DEFAULT");\r
541 Vector<Object> v = new Vector<Object>();\r
542 ffc.getPlatformDefsSupportedArchs(v);\r
543 if (v.size() == 0) {\r
544 v.add("IA32");\r
545 ffc.setPlatformDefsSupportedArchs(v);\r
546 }\r
547 v.removeAllElements();\r
548 ffc.getPlatformDefsBuildTargets(v);\r
549 if (v.size() == 0) {\r
550 v.add("DEBUG");\r
551 ffc.setPlatformDefsBuildTargets(v);\r
552 }\r
553 if (ffc.getPlatformDefsInterDir() == null) {\r
554 ffc.setPlatformDefsInterDir("UNIFIED");\r
555 }\r
a13899c5 556 }\r
557\r
558 /**\r
559 This method initializes jContentPane\r
560 \r
561 @return javax.swing.JPanel jContentPane\r
562 \r
563 **/\r
564 private JPanel getJContentPane() {\r
565 if (jContentPane == null) {\r
566 jLabel = new JLabel();\r
410e0e9f 567 jLabel.setBounds(new java.awt.Rectangle(15,193,140,20));\r
a13899c5 568 jLabel.setText("URL");\r
569 jContentPane = new JPanel();\r
570 jContentPane.setLayout(null);\r
571 jContentPane.setLocation(new java.awt.Point(0, 0));\r
572 jContentPane.setSize(new java.awt.Dimension(500,423));\r
573 jLabelAbstract = new JLabel();\r
410e0e9f 574 jLabelAbstract.setBounds(new java.awt.Rectangle(15,218,140,20));\r
a13899c5 575 jLabelAbstract.setText("Abstract");\r
576 jLabelSpecification = new JLabel();\r
577 jLabelSpecification.setText("Specification");\r
410e0e9f 578 jLabelSpecification.setBounds(new java.awt.Rectangle(15,328,140,20));\r
a13899c5 579 jLabelDescription = new JLabel();\r
580 jLabelDescription.setText("Description");\r
410e0e9f 581 jLabelDescription.setBounds(new java.awt.Rectangle(15,243,140,20));\r
a13899c5 582 jLabelCopyright = new JLabel();\r
583 jLabelCopyright.setText("Copyright");\r
410e0e9f 584 jLabelCopyright.setBounds(new java.awt.Rectangle(15,85,140,20));\r
a13899c5 585 jLabelLicense = new JLabel();\r
586 jLabelLicense.setText("License");\r
410e0e9f 587 jLabelLicense.setBounds(new java.awt.Rectangle(15,108,140,20));\r
a13899c5 588 jLabelVersion = new JLabel();\r
589 jLabelVersion.setText("Version");\r
590 jLabelVersion.setBounds(new java.awt.Rectangle(15, 60, 140, 20));\r
591 jLabelGuid = new JLabel();\r
592 jLabelGuid.setPreferredSize(new java.awt.Dimension(25, 15));\r
593 jLabelGuid.setBounds(new java.awt.Rectangle(15, 35, 140, 20));\r
594 jLabelGuid.setText("Guid");\r
595 jLabelBaseName = new JLabel();\r
596 jLabelBaseName.setText("Platform Name");\r
597 jLabelBaseName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));\r
598 jContentPane.add(jLabelBaseName, null);\r
599 jContentPane.add(getJTextFieldBaseName(), null);\r
600 jContentPane.add(jLabelGuid, null);\r
601 jContentPane.add(getJTextFieldGuid(), null);\r
602 jContentPane.add(jLabelVersion, null);\r
603 jContentPane.add(getJTextFieldVersion(), null);\r
604 jContentPane.add(getJButtonGenerateGuid(), null);\r
605 jContentPane.add(jLabelLicense, null);\r
606 jContentPane.add(jLabelCopyright, null);\r
607 jContentPane.add(jLabelDescription, null);\r
608 jContentPane.add(jLabelSpecification, null);\r
609 jContentPane.add(getJTextFieldSpecification(), null);\r
610 jContentPane.add(getJButtonOk(), null);\r
611 jContentPane.add(getJButtonCancel(), null);\r
612 jContentPane.add(getJScrollPaneLicense(), null);\r
613 jContentPane.add(getJScrollPaneDescription(), null);\r
614 jContentPane.add(jLabelAbstract, null);\r
615 jContentPane.add(getJTextFieldAbstract(), null);\r
616 jStarLabel1 = new StarLabel();\r
617 jStarLabel1.setLocation(new java.awt.Point(0, 10));\r
618 jStarLabel2 = new StarLabel();\r
619 jStarLabel2.setLocation(new java.awt.Point(0, 35));\r
620 jStarLabel3 = new StarLabel();\r
621 jStarLabel3.setLocation(new java.awt.Point(0, 60));\r
622 jStarLabel4 = new StarLabel();\r
410e0e9f 623 jStarLabel4.setLocation(new java.awt.Point(0,108));\r
a13899c5 624 jStarLabel5 = new StarLabel();\r
410e0e9f 625 jStarLabel5.setLocation(new java.awt.Point(0,85));\r
a13899c5 626 jStarLabel6 = new StarLabel();\r
410e0e9f 627 jStarLabel6.setLocation(new java.awt.Point(0,218));\r
a13899c5 628 jStarLabel7 = new StarLabel();\r
410e0e9f 629 jStarLabel7.setLocation(new java.awt.Point(0,328));\r
a13899c5 630 jStarLabel7.setEnabled(false);\r
631 jStarLabel8 = new StarLabel();\r
410e0e9f 632 jStarLabel8.setLocation(new java.awt.Point(0,243));\r
a13899c5 633 jStarLabel9 = new StarLabel();\r
410e0e9f 634 jStarLabel9.setLocation(new java.awt.Point(0,303));\r
a13899c5 635 jStarLabel9.setVisible(false);\r
636 jContentPane.add(jStarLabel1, null);\r
637 jContentPane.add(jStarLabel2, null);\r
638 jContentPane.add(jStarLabel3, null);\r
639 jContentPane.add(jStarLabel4, null);\r
640 jContentPane.add(jStarLabel5, null);\r
641 jContentPane.add(jStarLabel6, null);\r
642 jContentPane.add(jStarLabel7, null);\r
643 jContentPane.add(jStarLabel8, null);\r
644 jContentPane.add(jStarLabel9, null);\r
645 jContentPane.add(getJTextFieldCopyright(), null);\r
646\r
647 jContentPane.add(jLabel, null);\r
4da2e625 648 jContentPane.add(getJTextFieldUrl(), null);\r
a13899c5 649 }\r
650 return jContentPane;\r
651 }\r
652\r
653 /* (non-Javadoc)\r
654 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
655 *\r
656 * Override actionPerformed to listen all actions\r
657 *\r
658 */\r
659 public void actionPerformed(ActionEvent arg0) {\r
a490bca8 660 \r
a13899c5 661 if (arg0.getSource() == jButtonGenerateGuid) {\r
d6d24759 662 docConsole.setSaved(false);\r
a13899c5 663 jTextFieldGuid.setText(Tools.generateUuidString());\r
664 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());\r
665 }\r
666 }\r
667\r
a490bca8 668 \r
a13899c5 669 /**\r
670 This method initializes Package type and Compontent type\r
671 \r
672 **/\r
673 private void initFrame() {\r
674 \r
675 \r
676 }\r
677\r
678 /* (non-Javadoc)\r
679 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)\r
680 * \r
681 * Override componentResized to resize all components when frame's size is changed\r
682 */\r
683 public void componentResized(ComponentEvent arg0) {\r
684 int intPreferredWidth = 500;\r
685 \r
686 resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);\r
687 resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);\r
688 resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);\r
4da2e625 689 resizeComponentWidth(this.jTextFieldUrl, this.getWidth(), intPreferredWidth);\r
a13899c5 690 resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth);\r
691 resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);\r
692 resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth);\r
693 resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth);\r
694 resizeComponentWidth(this.jTextFieldAbstract, this.getWidth(), intPreferredWidth);\r
695 \r
696 relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25);\r
697 }\r
698}\r