]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
516b063d664f44e4ed47fb015d3018aae9f581ae
[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.JLabel;
27 import javax.swing.JOptionPane;
28 import javax.swing.JPanel;
29 import javax.swing.JScrollPane;
30 import javax.swing.JTextArea;
31 import javax.swing.JTextField;
32 import javax.swing.event.DocumentEvent;
33 import javax.swing.event.DocumentListener;
34
35
36
37 import org.tianocore.PlatformSurfaceAreaDocument;
38
39 import org.tianocore.frameworkwizard.common.DataValidation;
40 import org.tianocore.frameworkwizard.common.Tools;
41 import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
42 import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
43 import org.tianocore.frameworkwizard.common.ui.StarLabel;
44
45 /**
46 The class is used to create, update FpdHeader of Fpd file
47 It extends IInternalFrame
48
49 @since PackageEditor 1.0
50
51 **/
52 public class FpdHeader extends IInternalFrame implements DocumentListener{
53
54 private int dialogWidth = 560;
55
56 private int labelColumn = 12;
57
58 private int labelWidth = 155;
59
60 private int buttonWidth = 60;
61
62 private final int valueColumn = 168;
63
64 private final int valueWidth = 320;
65
66 private final int specWidth = 420;
67
68 private int shortValueWidth = valueWidth - (buttonWidth + 5);
69
70 private final int oneRowHeight = 20;
71
72 private final int threeRowHeight = 60;
73
74 private final int fourRowHeight = 80;
75
76 private final int rowSep = 5;
77
78 private final int rowOne = 12;
79
80 private final int rowTwo = rowOne + oneRowHeight + rowSep;
81
82 private final int rowThree = rowTwo + oneRowHeight + rowSep;
83
84 private final int rowFour = rowThree + oneRowHeight + rowSep;
85
86 private final int rowFive = rowFour + threeRowHeight + rowSep;
87
88 private final int rowSix = rowFive + fourRowHeight + rowSep;
89
90 private final int rowSeven = rowSix + oneRowHeight + rowSep;
91
92 private final int rowEight = rowSeven + oneRowHeight + rowSep;
93
94 private final int rowNine = rowEight + fourRowHeight + threeRowHeight +rowSep;
95
96 private int dialogHeight = rowNine + threeRowHeight;
97 ///
98 /// Define class Serial Version UID
99 ///
100 private static final long serialVersionUID = -8152099582923006900L;
101
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.getDocument().addDocumentListener(this);
185 jTextFieldBaseName.addFocusListener(new FocusAdapter(){
186 public void focusLost(FocusEvent e) {
187 if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {
188 JOptionPane.showMessageDialog(FpdHeader.this, "Package Name does not match the UiNameType datatype.");
189 return;
190 }
191 if (jTextFieldBaseName.getText().equals(ffc.getFpdHdrPlatformName())) {
192 return;
193 }
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.getDocument().addDocumentListener(this);
213 jTextFieldGuid.addFocusListener(new FocusAdapter(){
214 public void focusLost(FocusEvent e) {
215 if (!DataValidation.isGuid(jTextFieldGuid.getText())) {
216 JOptionPane.showMessageDialog(FpdHeader.this, "Guid must be in registry (8-4-4-4-12) format.");
217 return;
218 }
219 if (jTextFieldGuid.getText().equals(ffc.getFpdHdrGuidValue())) {
220 return;
221 }
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.getDocument().addDocumentListener(this);
241 jTextFieldVersion.addFocusListener(new FocusAdapter(){
242 public void focusLost(FocusEvent e) {
243 if (!DataValidation.isVersion(jTextFieldVersion.getText())) {
244 JOptionPane.showMessageDialog(FpdHeader.this, "Version does not match the Version datatype.");
245 return;
246 }
247 if (jTextFieldVersion.getText().equals(ffc.getFpdHdrVer())) {
248 return;
249 }
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.getDocument().addDocumentListener(this);
285 jTextAreaLicense.addFocusListener(new FocusAdapter(){
286 public void focusLost(FocusEvent e) {
287 if (jTextAreaLicense.getText().length() == 0) {
288 JOptionPane.showMessageDialog(FpdHeader.this, "License must be entered!");
289 return;
290 }
291 if (jTextAreaLicense.getText().equals(ffc.getFpdHdrLicense())) {
292 return;
293 }
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.getDocument().addDocumentListener(this);
312 jTextAreaDescription.addFocusListener(new FocusAdapter(){
313 public void focusLost(FocusEvent e) {
314 if (jTextAreaDescription.getText().length() == 0) {
315 JOptionPane.showMessageDialog(FpdHeader.this, "Description must be entered.");
316 return;
317 }
318 if (jTextAreaDescription.getText().equals(ffc.getFpdHdrDescription())) {
319 return;
320 }
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.getDocument().addDocumentListener(this);
430 jTextFieldAbstract.addFocusListener(new FocusAdapter(){
431 public void focusLost(FocusEvent e) {
432 if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {
433 JOptionPane.showMessageDialog(FpdHeader.this, "Abstract must be entered.");
434 return;
435 }
436 if (jTextFieldAbstract.getText().equals(ffc.getFpdHdrAbs())) {
437 return;
438 }
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.setLineWrap(true);
467 jCopyrightTextArea.getDocument().addDocumentListener(this);
468 jCopyrightTextArea.addFocusListener(new FocusAdapter(){
469 public void focusLost(FocusEvent e) {
470 if (!DataValidation.isCopyright(jCopyrightTextArea.getText())) {
471 JOptionPane.showMessageDialog(FpdHeader.this, "Copyright must be entered.");
472 return;
473 }
474 if (jCopyrightTextArea.getText().equals(ffc.getFpdHdrCopyright())) {
475 return;
476 }
477 ffc.setFpdHdrCopyright(jCopyrightTextArea.getText());
478 }
479 });
480 }
481 return jCopyrightTextArea;
482 }
483
484 /**
485 * This method initializes jTextField
486 *
487 * @return javax.swing.JTextField
488 */
489 private JTextField getJTextFieldUrl() {
490 if (jTextFieldUrl == null) {
491 jTextFieldUrl = new JTextField();
492 jTextFieldUrl.setBounds(new java.awt.Rectangle(valueColumn,rowSix,valueWidth,oneRowHeight));
493 jTextFieldUrl.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
494 jTextFieldUrl.getDocument().addDocumentListener(this);
495 jTextFieldUrl.addFocusListener(new FocusAdapter(){
496 public void focusLost(FocusEvent e){
497 if (jTextFieldUrl.getText().length() == 0 && ffc.getFpdHdrUrl() == null) {
498 return;
499 }
500 if (jTextFieldUrl.getText().equals(ffc.getFpdHdrUrl())) {
501 return;
502 }
503 ffc.setFpdHdrLicense(jTextAreaLicense.getText());
504 ffc.setFpdHdrUrl(jTextFieldUrl.getText());
505 }
506 });
507 }
508 return jTextFieldUrl;
509 }
510
511 public static void main(String[] args) {
512 new FpdHeader().setVisible(true);
513 }
514
515 /**
516 This is the default constructor
517
518 **/
519 public FpdHeader() {
520 super();
521 init();
522 this.setVisible(true);
523 }
524
525 /**
526 This is the override edit constructor
527
528 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
529
530 **/
531 public FpdHeader(PlatformSurfaceAreaDocument.PlatformSurfaceArea inFpd) {
532 this();
533 ffc = new FpdFileContents(inFpd);
534 init(ffc);
535
536 }
537
538 public FpdHeader(OpeningPlatformType opt) {
539 this(opt.getXmlFpd());
540 docConsole = opt;
541 if (amended) {
542 docConsole.setSaved(false);
543 amended = false;
544 }
545 }
546
547 /**
548 This method initializes this
549
550 **/
551 private void init() {
552 //this.setSize(500, 515);
553 this.setContentPane(getJContentPane());
554 this.setTitle("Platform Surface Area Header");
555 initFrame();
556
557 }
558
559 /**
560 This method initializes this
561 Fill values to all fields if these values are not empty
562
563 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
564
565 **/
566 private void init(FpdFileContents ffc) {
567
568 if (ffc.getFpdHdrPlatformName() != null) {
569 jTextFieldBaseName.setText(ffc.getFpdHdrPlatformName());
570 }
571 if (ffc.getFpdHdrGuidValue() != null) {
572 jTextFieldGuid.setText(ffc.getFpdHdrGuidValue());
573 }
574 if (ffc.getFpdHdrVer() != null) {
575 jTextFieldVersion.setText(ffc.getFpdHdrVer());
576 }
577 if (ffc.getFpdHdrLicense() != null) {
578 jTextAreaLicense.setText(ffc.getFpdHdrLicense());
579 }
580 if (ffc.getFpdHdrAbs() != null) {
581 jTextFieldAbstract.setText(ffc.getFpdHdrAbs());
582 }
583 if (ffc.getFpdHdrUrl() != null) {
584 jTextFieldUrl.setText(ffc.getFpdHdrUrl());
585 }
586 if (ffc.getFpdHdrCopyright() != null) {
587 jCopyrightTextArea.setText(ffc.getFpdHdrCopyright());
588 }
589 if (ffc.getFpdHdrDescription() != null) {
590 jTextAreaDescription.setText(ffc.getFpdHdrDescription());
591 }
592 if (ffc.getFpdHdrSpec() != null) {
593 jTextFieldSpecification.setText(ffc.getFpdHdrSpec());
594 }
595 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
596
597 if (ffc.getPlatformDefsSkuInfoCount() == 0) {
598 ffc.genPlatformDefsSkuInfo("0", "DEFAULT");
599 amended = true;
600 JOptionPane.showMessageDialog(this, "Default SKU set for this platform.");
601 }
602 Vector<Object> v = new Vector<Object>();
603 ffc.getPlatformDefsSupportedArchs(v);
604 if (v.size() == 0) {
605 v.add("IA32");
606 ffc.setPlatformDefsSupportedArchs(v);
607 amended = true;
608 JOptionPane.showMessageDialog(this, "Supported Arch. IA32 added for this platform.");
609 }
610 v.removeAllElements();
611 ffc.getPlatformDefsBuildTargets(v);
612 if (v.size() == 0) {
613 v.add("DEBUG");
614 ffc.setPlatformDefsBuildTargets(v);
615 amended = true;
616 JOptionPane.showMessageDialog(this, "Build target IA32 added for this platform.");
617 }
618 if (ffc.getPlatformDefsInterDir() == null) {
619 ffc.setPlatformDefsInterDir("UNIFIED");
620 amended = true;
621 JOptionPane.showMessageDialog(this, "UNIFIED Intermediate Directory set for this platform.");
622 }
623 }
624
625 /**
626 This method initializes jContentPane
627
628 @return javax.swing.JPanel jContentPane
629
630 **/
631 private JPanel getJContentPane() {
632 if (jContentPane == null) {
633 jContentPane = new JPanel();
634 jContentPane.setLayout(null);
635 jContentPane.setLocation(new java.awt.Point(0, 0));
636 jContentPane.setSize(new java.awt.Dimension(dialogWidth - 20 ,dialogHeight - 20));
637
638 jLabel = new JLabel();
639 jLabel.setBounds(new java.awt.Rectangle(labelColumn,rowSix,labelWidth,oneRowHeight));
640 jLabel.setText("URL");
641 jLabelAbstract = new JLabel();
642 jLabelAbstract.setBounds(new java.awt.Rectangle(labelColumn,rowSeven,labelWidth,oneRowHeight));
643 jLabelAbstract.setText("Abstract");
644 jLabelDescription = new JLabel();
645 jLabelDescription.setText("Description");
646 jLabelDescription.setBounds(new java.awt.Rectangle(labelColumn,rowEight,labelWidth,oneRowHeight));
647 jLabelCopyright = new JLabel();
648 jLabelCopyright.setText("Copyright");
649 jLabelCopyright.setBounds(new java.awt.Rectangle(labelColumn,rowFour,labelWidth,oneRowHeight));
650 jLabelLicense = new JLabel();
651 jLabelLicense.setText("License");
652 jLabelLicense.setBounds(new java.awt.Rectangle(labelColumn,rowFive,labelWidth,oneRowHeight));
653 jLabelVersion = new JLabel();
654 jLabelVersion.setText("Version");
655 jLabelVersion.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
656 jLabelGuid = new JLabel();
657 jLabelGuid.setPreferredSize(new java.awt.Dimension(labelWidth, oneRowHeight));
658 jLabelGuid.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
659 jLabelGuid.setText("Guid");
660 jLabelBaseName = new JLabel();
661 jLabelBaseName.setText("Platform Name");
662 jLabelBaseName.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
663 jStarLabel1 = new StarLabel();
664 jStarLabel1.setLocation(new java.awt.Point(0, rowOne));
665 jStarLabel2 = new StarLabel();
666 jStarLabel2.setLocation(new java.awt.Point(0, rowTwo));
667 jStarLabel3 = new StarLabel();
668 jStarLabel3.setLocation(new java.awt.Point(0, rowThree));
669 jStarLabel4 = new StarLabel();
670 jStarLabel4.setLocation(new java.awt.Point(0,rowFour));
671 jStarLabel5 = new StarLabel();
672 jStarLabel5.setLocation(new java.awt.Point(0,rowFive));
673 jStarLabel7 = new StarLabel();
674 jStarLabel7.setLocation(new java.awt.Point(0,rowSeven));
675 jStarLabel8 = new StarLabel();
676 jStarLabel8.setLocation(new java.awt.Point(0,rowEight));
677
678 jContentPane.add(jLabelBaseName, null);
679 jContentPane.add(getJTextFieldBaseName(), null);
680 jContentPane.add(jLabelGuid, null);
681 jContentPane.add(getJTextFieldGuid(), null);
682 jContentPane.add(jLabelVersion, null);
683 jContentPane.add(getJTextFieldVersion(), null);
684 jContentPane.add(getJButtonGenerateGuid(), null);
685 jContentPane.add(jLabelLicense, null);
686 jContentPane.add(jLabelCopyright, null);
687 jContentPane.add(jLabelDescription, null);
688 jContentPane.add(getJTextFieldSpecification(), null);
689 jContentPane.add(getJButtonOk(), null);
690 jContentPane.add(getJButtonCancel(), null);
691 jContentPane.add(getJScrollPaneLicense(), null);
692 jContentPane.add(getJScrollPaneDescription(), null);
693 jContentPane.add(jLabelAbstract, null);
694 jContentPane.add(getJTextFieldAbstract(), null);
695
696 jContentPane.add(jStarLabel1, null);
697 jContentPane.add(jStarLabel2, null);
698 jContentPane.add(jStarLabel3, null);
699 jContentPane.add(jStarLabel4, null);
700 jContentPane.add(jStarLabel5, null);
701 jContentPane.add(jStarLabel7, null);
702 jContentPane.add(jStarLabel8, null);
703 jContentPane.add(getCopyrightScrollPane(), null);
704
705 jContentPane.add(jLabel, null);
706 jContentPane.add(getJTextFieldUrl(), null);
707 }
708 return jContentPane;
709 }
710
711 /* (non-Javadoc)
712 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
713 *
714 * Override actionPerformed to listen all actions
715 *
716 */
717 public void actionPerformed(ActionEvent arg0) {
718
719 if (arg0.getSource() == jButtonGenerateGuid) {
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
759 /* (non-Javadoc)
760 * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
761 */
762 public void changedUpdate(DocumentEvent arg0) {
763 // TODO Auto-generated method stub
764
765 }
766
767 /* (non-Javadoc)
768 * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
769 */
770 public void insertUpdate(DocumentEvent arg0) {
771 // TODO Auto-generated method stub
772 if (docConsole != null) {
773 docConsole.setSaved(false);
774 }
775 }
776
777 /* (non-Javadoc)
778 * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
779 */
780 public void removeUpdate(DocumentEvent arg0) {
781 // TODO Auto-generated method stub
782 if (docConsole != null) {
783 docConsole.setSaved(false);
784 }
785 }
786 }