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