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