]> git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
6265f27fefc1b9fd2a8f2d70351bf748f4242965
[mirror_edk2.git] / Tools / 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 /**
172 This method initializes jTextFieldBaseName
173
174 @return javax.swing.JTextField jTextFieldBaseName
175
176 **/
177 private JTextField getJTextFieldBaseName() {
178 if (jTextFieldBaseName == null) {
179 jTextFieldBaseName = new JTextField();
180 jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueColumn, rowOne, valueWidth, oneRowHeight));
181 jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(valueWidth,oneRowHeight));
182 jTextFieldBaseName.addFocusListener(new FocusAdapter(){
183 public void focusLost(FocusEvent e) {
184 if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {
185 JOptionPane.showMessageDialog(frame, "Package Name does not match the UiNameType datatype.");
186 return;
187 }
188 if (jTextFieldBaseName.getText().equals(ffc.getFpdHdrPlatformName())) {
189 return;
190 }
191 docConsole.setSaved(false);
192 ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText());
193 }
194 });
195 }
196 return jTextFieldBaseName;
197 }
198
199 /**
200 This method initializes jTextFieldGuid
201
202 @return javax.swing.JTextField jTextFieldGuid
203
204 **/
205 private JTextField getJTextFieldGuid() {
206 if (jTextFieldGuid == null) {
207 jTextFieldGuid = new JTextField();
208 jTextFieldGuid.setBounds(new java.awt.Rectangle(valueColumn, rowTwo, shortValueWidth, oneRowHeight));
209 jTextFieldGuid.setPreferredSize(new java.awt.Dimension(shortValueWidth,oneRowHeight));
210 jTextFieldGuid.addFocusListener(new FocusAdapter(){
211 public void focusLost(FocusEvent e) {
212 if (!DataValidation.isGuid(jTextFieldGuid.getText())) {
213 JOptionPane.showMessageDialog(frame, "Guid must be in registry (8-4-4-4-12) format.");
214 return;
215 }
216 if (jTextFieldGuid.getText().equals(ffc.getFpdHdrGuidValue())) {
217 return;
218 }
219 docConsole.setSaved(false);
220 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
221 }
222 });
223 }
224 return jTextFieldGuid;
225 }
226
227 /**
228 This method initializes jTextFieldVersion
229
230 @return javax.swing.JTextField jTextFieldVersion
231
232 **/
233 private JTextField getJTextFieldVersion() {
234 if (jTextFieldVersion == null) {
235 jTextFieldVersion = new JTextField();
236 jTextFieldVersion.setBounds(new java.awt.Rectangle(valueColumn, rowThree, valueWidth, oneRowHeight));
237 jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth,oneRowHeight));
238 jTextFieldVersion.addFocusListener(new FocusAdapter(){
239 public void focusLost(FocusEvent e) {
240 if (!DataValidation.isVersion(jTextFieldVersion.getText())) {
241 JOptionPane.showMessageDialog(frame, "Version does not match the Version datatype.");
242 return;
243 }
244 if (jTextFieldVersion.getText().equals(ffc.getFpdHdrVer())) {
245 return;
246 }
247 docConsole.setSaved(false);
248 ffc.setFpdHdrVer(jTextFieldVersion.getText());
249 }
250 });
251 }
252 return jTextFieldVersion;
253 }
254
255 /**
256 This method initializes jButtonGenerateGuid
257
258 @return javax.swing.JButton jButtonGenerateGuid
259
260 **/
261 private JButton getJButtonGenerateGuid() {
262 if (jButtonGenerateGuid == null) {
263 jButtonGenerateGuid = new JButton();
264 jButtonGenerateGuid.setBounds(new java.awt.Rectangle(valueColumn + shortValueWidth + 5, rowTwo, buttonWidth, oneRowHeight));
265 jButtonGenerateGuid.setText("GEN");
266 jButtonGenerateGuid.addActionListener(this);
267 }
268 return jButtonGenerateGuid;
269 }
270
271 /**
272 This method initializes jTextAreaLicense
273
274 @return javax.swing.JTextArea jTextAreaLicense
275
276 **/
277 private JTextArea getJTextAreaLicense() {
278 if (jTextAreaLicense == null) {
279 jTextAreaLicense = new JTextArea();
280 jTextAreaLicense.setText("");
281 jTextAreaLicense.setLineWrap(true);
282 jTextAreaLicense.addFocusListener(new FocusAdapter(){
283 public void focusLost(FocusEvent e) {
284 if (jTextAreaLicense.getText().length() == 0) {
285 JOptionPane.showMessageDialog(frame, "License must be entered!");
286 return;
287 }
288 if (jTextAreaLicense.getText().equals(ffc.getFpdHdrLicense())) {
289 return;
290 }
291 docConsole.setSaved(false);
292 ffc.setFpdHdrLicense(jTextAreaLicense.getText());
293 }
294 });
295 }
296 return jTextAreaLicense;
297 }
298
299 /**
300 This method initializes jTextAreaDescription
301
302 @return javax.swing.JTextArea jTextAreaDescription
303
304 **/
305 private JTextArea getJTextAreaDescription() {
306 if (jTextAreaDescription == null) {
307 jTextAreaDescription = new JTextArea();
308 jTextAreaDescription.setLineWrap(true);
309 jTextAreaDescription.addFocusListener(new FocusAdapter(){
310 public void focusLost(FocusEvent e) {
311 if (jTextAreaDescription.getText().length() == 0) {
312 JOptionPane.showMessageDialog(frame, "Description must be entered.");
313 return;
314 }
315 if (jTextAreaDescription.getText().equals(ffc.getFpdHdrDescription())) {
316 return;
317 }
318 docConsole.setSaved(false);
319 ffc.setFpdHdrDescription(jTextAreaDescription.getText());
320 }
321 });
322 }
323 return jTextAreaDescription;
324 }
325
326 /**
327 This method initializes jTextFieldSpecification
328
329 @return javax.swing.JTextField jTextFieldSpecification
330
331 **/
332 private JTextField getJTextFieldSpecification() {
333 if (jTextFieldSpecification == null) {
334 jTextFieldSpecification = new JTextField();
335 jTextFieldSpecification.setBounds(new java.awt.Rectangle(labelColumn,rowNine,specWidth,oneRowHeight));
336 jTextFieldSpecification.setEditable(false);
337 jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth,oneRowHeight));
338 jTextFieldSpecification.setBorder(null);
339 jTextFieldSpecification.addFocusListener(new FocusAdapter(){
340 public void focusLost(FocusEvent e) {
341 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
342 }
343 });
344 }
345 return jTextFieldSpecification;
346 }
347
348 /**
349 This method initializes jButtonOk
350
351 @return javax.swing.JButton jButtonOk
352
353 **/
354 private JButton getJButtonOk() {
355 if (jButtonOk == null) {
356 jButtonOk = new JButton();
357 jButtonOk.setText("OK");
358 jButtonOk.setBounds(new java.awt.Rectangle(290,351,90,20));
359 jButtonOk.setVisible(false);
360 jButtonOk.addActionListener(this);
361 }
362 return jButtonOk;
363 }
364
365 /**
366 This method initializes jButtonCancel
367
368 @return javax.swing.JButton jButtonCancel
369
370 **/
371 private JButton getJButtonCancel() {
372 if (jButtonCancel == null) {
373 jButtonCancel = new JButton();
374 jButtonCancel.setText("Cancel");
375 jButtonCancel.setBounds(new java.awt.Rectangle(390,351,90,20));
376 jButtonCancel.setVisible(false);
377 jButtonCancel.addActionListener(this);
378 }
379 return jButtonCancel;
380 }
381
382 /**
383 This method initializes jScrollPaneLicense
384
385 @return javax.swing.JScrollPane jScrollPaneLicense
386
387 **/
388 private JScrollPane getJScrollPaneLicense() {
389 if (jScrollPaneLicense == null) {
390 jScrollPaneLicense = new JScrollPane();
391 jScrollPaneLicense.setBounds(new java.awt.Rectangle(valueColumn,rowFive,valueWidth,fourRowHeight));
392 jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
393 jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth,fourRowHeight));
394 jScrollPaneLicense.setViewportView(getJTextAreaLicense());
395 }
396 return jScrollPaneLicense;
397 }
398
399 /**
400 This method initializes jScrollPaneDescription
401
402 @return javax.swing.JScrollPane jScrollPaneDescription
403
404 **/
405 private JScrollPane getJScrollPaneDescription() {
406 if (jScrollPaneDescription == null) {
407 jScrollPaneDescription = new JScrollPane();
408 jScrollPaneDescription.setBounds(new java.awt.Rectangle(valueColumn,rowEight,valueWidth,fourRowHeight));
409 jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
410 jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, fourRowHeight));
411 jScrollPaneDescription.setViewportView(getJTextAreaDescription());
412 }
413 return jScrollPaneDescription;
414 }
415
416 /**
417 This method initializes jTextFieldAbstract
418
419 @return javax.swing.JTextField jTextFieldAbstract
420
421 **/
422 private JTextField getJTextFieldAbstract() {
423 if (jTextFieldAbstract == null) {
424 jTextFieldAbstract = new JTextField();
425 jTextFieldAbstract.setBounds(new java.awt.Rectangle(valueColumn,rowSeven,valueWidth,oneRowHeight));
426 jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
427 jTextFieldAbstract.addFocusListener(new FocusAdapter(){
428 public void focusLost(FocusEvent e) {
429 if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {
430 JOptionPane.showMessageDialog(frame, "Abstract must be entered.");
431 return;
432 }
433 if (jTextFieldAbstract.getText().equals(ffc.getFpdHdrAbs())) {
434 return;
435 }
436 docConsole.setSaved(false);
437 ffc.setFpdHdrAbs(jTextFieldAbstract.getText());
438 }
439 });
440 }
441 return jTextFieldAbstract;
442 }
443
444 private JScrollPane getCopyrightScrollPane() {
445 if (jCopyrightScrollPane == null) {
446 jCopyrightScrollPane = new JScrollPane();
447 jCopyrightScrollPane.setBounds(new java.awt.Rectangle(valueColumn, rowFour, valueWidth, threeRowHeight));
448 jCopyrightScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
449 jCopyrightScrollPane.setPreferredSize(new java.awt.Dimension(valueWidth, threeRowHeight));
450 jCopyrightScrollPane.setViewportView(getJCopyrightTextArea());
451 }
452 return jCopyrightScrollPane;
453 }
454 /**
455 This method initializes jTextFieldCopyright
456
457 @return javax.swing.JTextField jTextFieldCopyright
458
459 **/
460 private JTextArea getJCopyrightTextArea() {
461 if (jCopyrightTextArea == null) {
462 jCopyrightTextArea = new JTextArea();
463 jCopyrightTextArea.setWrapStyleWord(true);
464 jCopyrightTextArea.addFocusListener(new FocusAdapter(){
465 public void focusLost(FocusEvent e) {
466 if (!DataValidation.isCopyright(jCopyrightTextArea.getText())) {
467 JOptionPane.showMessageDialog(frame, "Copyright must be entered.");
468 return;
469 }
470 if (jCopyrightTextArea.getText().equals(ffc.getFpdHdrCopyright())) {
471 return;
472 }
473 docConsole.setSaved(false);
474 ffc.setFpdHdrCopyright(jCopyrightTextArea.getText());
475 }
476 });
477 }
478 return jCopyrightTextArea;
479 }
480
481 /**
482 * This method initializes jTextField
483 *
484 * @return javax.swing.JTextField
485 */
486 private JTextField getJTextFieldUrl() {
487 if (jTextFieldUrl == null) {
488 jTextFieldUrl = new JTextField();
489 jTextFieldUrl.setBounds(new java.awt.Rectangle(valueColumn,rowSix,valueWidth,oneRowHeight));
490 jTextFieldUrl.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
491 jTextFieldUrl.addFocusListener(new FocusAdapter(){
492 public void focusLost(FocusEvent e){
493 if (jTextFieldUrl.getText().length() == 0 && ffc.getFpdHdrUrl() == null) {
494 return;
495 }
496 if (jTextFieldUrl.getText().equals(ffc.getFpdHdrUrl())) {
497 return;
498 }
499 ffc.setFpdHdrLicense(jTextAreaLicense.getText());
500 ffc.setFpdHdrUrl(jTextFieldUrl.getText());
501 docConsole.setSaved(false);
502 }
503 });
504 }
505 return jTextFieldUrl;
506 }
507
508 public static void main(String[] args) {
509 new FpdHeader().setVisible(true);
510 }
511
512 /**
513 This is the default constructor
514
515 **/
516 public FpdHeader() {
517 super();
518 init();
519 this.setVisible(true);
520 }
521
522 /**
523 This is the override edit constructor
524
525 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
526
527 **/
528 public FpdHeader(PlatformSurfaceAreaDocument.PlatformSurfaceArea inFpd) {
529 this();
530 ffc = new FpdFileContents(inFpd);
531 init(ffc);
532
533 }
534
535 public FpdHeader(OpeningPlatformType opt) {
536 this(opt.getXmlFpd());
537 docConsole = opt;
538 }
539
540 /**
541 This method initializes this
542
543 **/
544 private void init() {
545 //this.setSize(500, 515);
546 this.setContentPane(getJContentPane());
547 this.setTitle("Platform Surface Area Header");
548 initFrame();
549
550 }
551
552 /**
553 This method initializes this
554 Fill values to all fields if these values are not empty
555
556 @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
557
558 **/
559 private void init(FpdFileContents ffc) {
560
561 if (ffc.getFpdHdrPlatformName() != null) {
562 jTextFieldBaseName.setText(ffc.getFpdHdrPlatformName());
563 }
564 if (ffc.getFpdHdrGuidValue() != null) {
565 jTextFieldGuid.setText(ffc.getFpdHdrGuidValue());
566 }
567 if (ffc.getFpdHdrVer() != null) {
568 jTextFieldVersion.setText(ffc.getFpdHdrVer());
569 }
570 if (ffc.getFpdHdrLicense() != null) {
571 jTextAreaLicense.setText(ffc.getFpdHdrLicense());
572 }
573 if (ffc.getFpdHdrAbs() != null) {
574 jTextFieldAbstract.setText(ffc.getFpdHdrAbs());
575 }
576 if (ffc.getFpdHdrUrl() != null) {
577 jTextFieldUrl.setText(ffc.getFpdHdrUrl());
578 }
579 if (ffc.getFpdHdrCopyright() != null) {
580 jCopyrightTextArea.setText(ffc.getFpdHdrCopyright());
581 }
582 if (ffc.getFpdHdrDescription() != null) {
583 jTextAreaDescription.setText(ffc.getFpdHdrDescription());
584 }
585 if (ffc.getFpdHdrSpec() != null) {
586 jTextFieldSpecification.setText(ffc.getFpdHdrSpec());
587 }
588 ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
589
590 ffc.genPlatformDefsSkuInfo("0", "DEFAULT");
591 Vector<Object> v = new Vector<Object>();
592 ffc.getPlatformDefsSupportedArchs(v);
593 if (v.size() == 0) {
594 v.add("IA32");
595 ffc.setPlatformDefsSupportedArchs(v);
596 }
597 v.removeAllElements();
598 ffc.getPlatformDefsBuildTargets(v);
599 if (v.size() == 0) {
600 v.add("DEBUG");
601 ffc.setPlatformDefsBuildTargets(v);
602 }
603 if (ffc.getPlatformDefsInterDir() == null) {
604 ffc.setPlatformDefsInterDir("UNIFIED");
605 }
606 }
607
608 /**
609 This method initializes jContentPane
610
611 @return javax.swing.JPanel jContentPane
612
613 **/
614 private JPanel getJContentPane() {
615 if (jContentPane == null) {
616 jContentPane = new JPanel();
617 jContentPane.setLayout(null);
618 jContentPane.setLocation(new java.awt.Point(0, 0));
619 jContentPane.setSize(new java.awt.Dimension(dialogWidth - 20 ,dialogHeight - 20));
620
621 jLabel = new JLabel();
622 jLabel.setBounds(new java.awt.Rectangle(labelColumn,rowSix,labelWidth,oneRowHeight));
623 jLabel.setText("URL");
624 jLabelAbstract = new JLabel();
625 jLabelAbstract.setBounds(new java.awt.Rectangle(labelColumn,rowSeven,labelWidth,oneRowHeight));
626 jLabelAbstract.setText("Abstract");
627 jLabelDescription = new JLabel();
628 jLabelDescription.setText("Description");
629 jLabelDescription.setBounds(new java.awt.Rectangle(labelColumn,rowEight,labelWidth,oneRowHeight));
630 jLabelCopyright = new JLabel();
631 jLabelCopyright.setText("Copyright");
632 jLabelCopyright.setBounds(new java.awt.Rectangle(labelColumn,rowFour,labelWidth,oneRowHeight));
633 jLabelLicense = new JLabel();
634 jLabelLicense.setText("License");
635 jLabelLicense.setBounds(new java.awt.Rectangle(labelColumn,rowFive,labelWidth,oneRowHeight));
636 jLabelVersion = new JLabel();
637 jLabelVersion.setText("Version");
638 jLabelVersion.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
639 jLabelGuid = new JLabel();
640 jLabelGuid.setPreferredSize(new java.awt.Dimension(labelWidth, oneRowHeight));
641 jLabelGuid.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
642 jLabelGuid.setText("Guid");
643 jLabelBaseName = new JLabel();
644 jLabelBaseName.setText("Platform Name");
645 jLabelBaseName.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
646 jStarLabel1 = new StarLabel();
647 jStarLabel1.setLocation(new java.awt.Point(0, rowOne));
648 jStarLabel2 = new StarLabel();
649 jStarLabel2.setLocation(new java.awt.Point(0, rowTwo));
650 jStarLabel3 = new StarLabel();
651 jStarLabel3.setLocation(new java.awt.Point(0, rowThree));
652 jStarLabel4 = new StarLabel();
653 jStarLabel4.setLocation(new java.awt.Point(0,rowFour));
654 jStarLabel5 = new StarLabel();
655 jStarLabel5.setLocation(new java.awt.Point(0,rowFive));
656 jStarLabel7 = new StarLabel();
657 jStarLabel7.setLocation(new java.awt.Point(0,rowSeven));
658 jStarLabel8 = new StarLabel();
659 jStarLabel8.setLocation(new java.awt.Point(0,rowEight));
660
661 jContentPane.add(jLabelBaseName, null);
662 jContentPane.add(getJTextFieldBaseName(), null);
663 jContentPane.add(jLabelGuid, null);
664 jContentPane.add(getJTextFieldGuid(), null);
665 jContentPane.add(jLabelVersion, null);
666 jContentPane.add(getJTextFieldVersion(), null);
667 jContentPane.add(getJButtonGenerateGuid(), null);
668 jContentPane.add(jLabelLicense, null);
669 jContentPane.add(jLabelCopyright, null);
670 jContentPane.add(jLabelDescription, null);
671 jContentPane.add(getJTextFieldSpecification(), null);
672 jContentPane.add(getJButtonOk(), null);
673 jContentPane.add(getJButtonCancel(), null);
674 jContentPane.add(getJScrollPaneLicense(), null);
675 jContentPane.add(getJScrollPaneDescription(), null);
676 jContentPane.add(jLabelAbstract, null);
677 jContentPane.add(getJTextFieldAbstract(), null);
678
679 jContentPane.add(jStarLabel1, null);
680 jContentPane.add(jStarLabel2, null);
681 jContentPane.add(jStarLabel3, null);
682 jContentPane.add(jStarLabel4, null);
683 jContentPane.add(jStarLabel5, null);
684 jContentPane.add(jStarLabel7, null);
685 jContentPane.add(jStarLabel8, null);
686 jContentPane.add(getCopyrightScrollPane(), null);
687
688 jContentPane.add(jLabel, null);
689 jContentPane.add(getJTextFieldUrl(), null);
690 }
691 return jContentPane;
692 }
693
694 /* (non-Javadoc)
695 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
696 *
697 * Override actionPerformed to listen all actions
698 *
699 */
700 public void actionPerformed(ActionEvent arg0) {
701
702 if (arg0.getSource() == jButtonGenerateGuid) {
703 docConsole.setSaved(false);
704 jTextFieldGuid.setText(Tools.generateUuidString());
705 ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
706 }
707 }
708
709
710 /**
711 This method initializes Package type and Compontent type
712
713 **/
714 private void initFrame() {
715
716
717 }
718
719 /* (non-Javadoc)
720 * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
721 *
722 * Override componentResized to resize all components when frame's size is changed
723 */
724 public void componentResized(ComponentEvent arg0) {
725 int intPreferredWidth = dialogWidth;
726 int intCurrentWidth = this.getJContentPane().getWidth();
727
728 // Tools.resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);
729 // Tools.resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);
730 // Tools.relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25);
731 // Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
732 // Tools.resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);
733 Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth);
734 Tools.resizeComponentWidth(this.jTextFieldUrl, intCurrentWidth, intPreferredWidth);
735 Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
736 Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
737 // Tools.resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth);
738
739
740
741 }
742 }