3 The file is used to let user choose to create module in an existing package
4 or to create a new package first.
6 Copyright (c) 2006, Intel Corporation
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.frameworkwizard
;
18 import java
.awt
.Component
;
19 import java
.awt
.event
.ActionEvent
;
21 import java
.util
.Vector
;
23 import javax
.swing
.ButtonGroup
;
24 import javax
.swing
.JButton
;
25 import javax
.swing
.JComboBox
;
26 import javax
.swing
.JFileChooser
;
27 import javax
.swing
.JLabel
;
28 import javax
.swing
.JPanel
;
29 import javax
.swing
.JTextField
;
31 import org
.tianocore
.ModuleTypeDef
;
32 import org
.tianocore
.MsaHeaderDocument
;
33 import org
.tianocore
.SpdHeaderDocument
;
34 import org
.tianocore
.ModuleSurfaceAreaDocument
.ModuleSurfaceArea
;
35 import org
.tianocore
.PackageSurfaceAreaDocument
.PackageSurfaceArea
;
36 import org
.tianocore
.PlatformHeaderDocument
.PlatformHeader
;
37 import org
.tianocore
.PlatformSurfaceAreaDocument
.PlatformSurfaceArea
;
38 import org
.tianocore
.frameworkwizard
.common
.DataType
;
39 import org
.tianocore
.frameworkwizard
.common
.DataValidation
;
40 import org
.tianocore
.frameworkwizard
.common
.GlobalData
;
41 import org
.tianocore
.frameworkwizard
.common
.IFileFilter
;
42 import org
.tianocore
.frameworkwizard
.common
.Log
;
43 import org
.tianocore
.frameworkwizard
.common
.SaveFile
;
44 import org
.tianocore
.frameworkwizard
.common
.Tools
;
45 import org
.tianocore
.frameworkwizard
.common
.ui
.IDialog
;
46 import org
.tianocore
.frameworkwizard
.common
.ui
.IFrame
;
47 import org
.tianocore
.frameworkwizard
.common
.ui
.StarLabel
;
48 import org
.tianocore
.frameworkwizard
.module
.Identifications
.ModuleIdentification
;
49 import org
.tianocore
.frameworkwizard
.packaging
.PackageIdentification
;
50 import org
.tianocore
.frameworkwizard
.platform
.PlatformIdentification
;
51 import org
.tianocore
.frameworkwizard
.workspace
.Workspace
;
52 import org
.tianocore
.frameworkwizard
.workspace
.WorkspaceTools
;
53 import javax
.swing
.JRadioButton
;
55 public class SelectModuleBelong
extends IDialog
{
61 private static final long serialVersionUID
= 4171355136991448972L;
63 private JPanel jContentPane
= null;
65 private JComboBox jComboBoxExistingPackage
= null;
67 private JButton jButtonOk
= null;
69 private JButton jButtonCancel
= null;
71 private Vector
<PackageIdentification
> packages
= null;
73 private JLabel jLabelPackage
= null;
75 private JLabel jLabelFilePath
= null;
77 private JTextField jTextFieldFilePath
= null;
79 private JButton jButtonBrowse
= null;
81 private JLabel jLabelName
= null;
83 private JTextField jTextFieldName
= null;
85 private JLabel jLabelGuid
= null;
87 private JTextField jTextFieldGuid
= null;
89 private JButton jButtonGen
= null;
91 private JLabel jLabelVersion
= null;
93 private JTextField jTextFieldVersion
= null;
95 private StarLabel jStarLabel1
= null;
97 private StarLabel jStarLabel2
= null;
99 private StarLabel jStarLabel3
= null;
101 private StarLabel jStarLabel4
= null;
103 private StarLabel jStarLabel5
= null;
105 private ButtonGroup bg
= new ButtonGroup();
107 private WorkspaceTools wt
= new WorkspaceTools();
109 private ModuleIdentification mid
= null;
111 private PackageIdentification pid
= null;
113 private PlatformIdentification fid
= null;
115 private ModuleSurfaceArea msa
= null;
117 private PackageSurfaceArea spd
= null;
119 private PlatformSurfaceArea fpd
= null;
121 private int mode
= -1;
123 private JLabel jLabelIsLibrary
= null;
125 private JRadioButton jRadioButtonYes
= null;
127 private JRadioButton jRadioButtonNo
= null;
130 * This method initializes jComboBoxExistingPackage
132 * @return javax.swing.JComboBox
134 private JComboBox
getJComboBoxExistingPackage() {
135 if (jComboBoxExistingPackage
== null) {
136 jComboBoxExistingPackage
= new JComboBox();
137 jComboBoxExistingPackage
.setBounds(new java
.awt
.Rectangle(140, 10, 340, 20));
139 return jComboBoxExistingPackage
;
143 * This method initializes jButtonNext
145 * @return javax.swing.JButton
147 private JButton
getJButtonOk() {
148 if (jButtonOk
== null) {
149 jButtonOk
= new JButton();
150 jButtonOk
.setBounds(new java
.awt
.Rectangle(310, 165, 80, 20));
151 jButtonOk
.setText("Ok");
152 jButtonOk
.addActionListener(this);
158 * This method initializes jButtonCancel
160 * @return javax.swing.JButton
162 private JButton
getJButtonCancel() {
163 if (jButtonCancel
== null) {
164 jButtonCancel
= new JButton();
165 jButtonCancel
.setBounds(new java
.awt
.Rectangle(395, 165, 80, 20));
166 jButtonCancel
.setText("Cancel");
167 jButtonCancel
.addActionListener(this);
169 return jButtonCancel
;
173 * This method initializes jTextFieldFilePath
175 * @return javax.swing.JTextField
177 private JTextField
getJTextFieldFilePath() {
178 if (jTextFieldFilePath
== null) {
179 jTextFieldFilePath
= new JTextField();
180 jTextFieldFilePath
.setBounds(new java
.awt
.Rectangle(140, 60, 250, 20));
182 return jTextFieldFilePath
;
186 * This method initializes jButtonBrowse
188 * @return javax.swing.JButton
190 private JButton
getJButtonBrowse() {
191 if (jButtonBrowse
== null) {
192 jButtonBrowse
= new JButton();
193 jButtonBrowse
.setBounds(new java
.awt
.Rectangle(395, 60, 85, 20));
194 jButtonBrowse
.setText("Browse");
195 jButtonBrowse
.addActionListener(this);
197 return jButtonBrowse
;
201 * This method initializes jTextFieldModuleName
203 * @return javax.swing.JTextField
205 private JTextField
getJTextFieldName() {
206 if (jTextFieldName
== null) {
207 jTextFieldName
= new JTextField();
208 jTextFieldName
.setBounds(new java
.awt
.Rectangle(140, 85, 340, 20));
210 return jTextFieldName
;
214 * This method initializes jTextFieldGuid
216 * @return javax.swing.JTextField
218 private JTextField
getJTextFieldGuid() {
219 if (jTextFieldGuid
== null) {
220 jTextFieldGuid
= new JTextField();
221 jTextFieldGuid
.setBounds(new java
.awt
.Rectangle(140, 110, 250, 20));
223 return jTextFieldGuid
;
227 * This method initializes jButtonGen
229 * @return javax.swing.JButton
231 private JButton
getJButtonGen() {
232 if (jButtonGen
== null) {
233 jButtonGen
= new JButton();
234 jButtonGen
.setBounds(new java
.awt
.Rectangle(395, 110, 85, 20));
235 jButtonGen
.setText("GEN");
236 jButtonGen
.addActionListener(this);
242 * This method initializes jTextFieldVersion
244 * @return javax.swing.JTextField
246 private JTextField
getJTextFieldVersion() {
247 if (jTextFieldVersion
== null) {
248 jTextFieldVersion
= new JTextField();
249 jTextFieldVersion
.setBounds(new java
.awt
.Rectangle(140, 135, 340, 20));
251 return jTextFieldVersion
;
255 * This method initializes jRadioButtonYes
257 * @return javax.swing.JRadioButton
259 private JRadioButton
getJRadioButtonYes() {
260 if (jRadioButtonYes
== null) {
261 jRadioButtonYes
= new JRadioButton();
262 jRadioButtonYes
.setBounds(new java
.awt
.Rectangle(140, 35, 100, 20));
263 jRadioButtonYes
.setSelected(false);
264 jRadioButtonYes
.setText("Yes");
266 return jRadioButtonYes
;
270 * This method initializes jRadioButtonNo
272 * @return javax.swing.JRadioButton
274 private JRadioButton
getJRadioButtonNo() {
275 if (jRadioButtonNo
== null) {
276 jRadioButtonNo
= new JRadioButton();
277 jRadioButtonNo
.setBounds(new java
.awt
.Rectangle(300, 35, 110, 20));
278 jRadioButtonNo
.setSelected(true);
279 jRadioButtonNo
.setText("No");
281 return jRadioButtonNo
;
287 public static void main(String
[] args
) {
288 SelectModuleBelong smb
= new SelectModuleBelong();
289 smb
.setVisible(true);
293 * This is the default constructor
295 public SelectModuleBelong() {
301 * This is the default constructor
303 public SelectModuleBelong(IFrame parentFrame
, boolean modal
, int fileType
) {
304 super(parentFrame
, modal
);
305 this.mode
= fileType
;
307 initExistingPackage();
308 if (mode
!= DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
309 this.jStarLabel1
.setVisible(false);
310 this.jLabelPackage
.setVisible(false);
311 this.jComboBoxExistingPackage
.setVisible(false);
312 this.jLabelIsLibrary
.setVisible(false);
313 this.jRadioButtonYes
.setVisible(false);
314 this.jRadioButtonNo
.setVisible(false);
315 upLocation(this.jStarLabel2
, 50);
316 upLocation(this.jStarLabel3
, 50);
317 upLocation(this.jStarLabel4
, 50);
318 upLocation(this.jStarLabel5
, 50);
319 upLocation(this.jLabelFilePath
, 50);
320 upLocation(this.jLabelName
, 50);
321 upLocation(this.jLabelGuid
, 50);
322 upLocation(this.jLabelVersion
, 50);
323 upLocation(this.jTextFieldFilePath
, 50);
324 upLocation(this.jTextFieldName
, 50);
325 upLocation(this.jTextFieldGuid
, 50);
326 upLocation(this.jTextFieldVersion
, 50);
327 upLocation(this.jButtonBrowse
, 50);
328 upLocation(this.jButtonGen
, 50);
333 * This method initializes this
337 private void init() {
338 this.setSize(500, 230);
339 this.setContentPane(getJContentPane());
340 this.setTitle("New");
345 * This method initializes jContentPane
347 * @return javax.swing.JPanel
349 private JPanel
getJContentPane() {
350 if (jContentPane
== null) {
351 jLabelIsLibrary
= new JLabel();
352 jLabelIsLibrary
.setBounds(new java
.awt
.Rectangle(15, 35, 120, 20));
353 jLabelIsLibrary
.setText("Is this a Library");
354 jLabelVersion
= new JLabel();
355 jLabelVersion
.setBounds(new java
.awt
.Rectangle(15, 135, 120, 20));
356 jLabelVersion
.setText("Version");
357 jLabelGuid
= new JLabel();
358 jLabelGuid
.setBounds(new java
.awt
.Rectangle(15, 110, 120, 20));
359 jLabelGuid
.setText("Guid");
360 jLabelName
= new JLabel();
361 jLabelName
.setBounds(new java
.awt
.Rectangle(15, 85, 120, 20));
362 jLabelName
.setText("Module Name");
363 jLabelFilePath
= new JLabel();
364 jLabelFilePath
.setBounds(new java
.awt
.Rectangle(15, 60, 120, 20));
365 jLabelFilePath
.setText("File Path");
366 jLabelPackage
= new JLabel();
367 jLabelPackage
.setBounds(new java
.awt
.Rectangle(15, 10, 120, 20));
368 jLabelPackage
.setText("Choose a Package");
369 jContentPane
= new JPanel();
370 jContentPane
.setLayout(null);
371 jContentPane
.setSize(new java
.awt
.Dimension(490, 198));
372 jContentPane
.add(getJComboBoxExistingPackage(), null);
373 jContentPane
.add(getJButtonOk(), null);
374 jContentPane
.add(getJButtonCancel(), null);
375 jContentPane
.add(jLabelPackage
, null);
376 jContentPane
.add(jLabelFilePath
, null);
377 jContentPane
.add(getJTextFieldFilePath(), null);
378 jContentPane
.add(getJButtonBrowse(), null);
379 jContentPane
.add(jLabelName
, null);
380 jContentPane
.add(getJTextFieldName(), null);
381 jContentPane
.add(jLabelGuid
, null);
382 jContentPane
.add(getJTextFieldGuid(), null);
383 jContentPane
.add(getJButtonGen(), null);
384 jContentPane
.add(jLabelVersion
, null);
385 jContentPane
.add(getJTextFieldVersion(), null);
387 jStarLabel1
= new StarLabel();
388 jStarLabel1
.setLocation(new java
.awt
.Point(0, 10));
389 jStarLabel2
= new StarLabel();
390 jStarLabel2
.setLocation(new java
.awt
.Point(0, 60));
391 jStarLabel3
= new StarLabel();
392 jStarLabel3
.setLocation(new java
.awt
.Point(0, 85));
393 jStarLabel4
= new StarLabel();
394 jStarLabel4
.setLocation(new java
.awt
.Point(0, 110));
395 jStarLabel5
= new StarLabel();
396 jStarLabel5
.setLocation(new java
.awt
.Point(0, 135));
397 jContentPane
.add(jStarLabel1
, null);
398 jContentPane
.add(jStarLabel2
, null);
399 jContentPane
.add(jStarLabel3
, null);
400 jContentPane
.add(jStarLabel4
, null);
401 jContentPane
.add(jStarLabel5
, null);
402 jContentPane
.add(jLabelIsLibrary
, null);
403 jContentPane
.add(getJRadioButtonYes(), null);
404 jContentPane
.add(getJRadioButtonNo(), null);
405 bg
.add(getJRadioButtonNo());
406 bg
.add(getJRadioButtonYes());
412 Query all existing packages and fill them into combox
415 private void initExistingPackage() {
416 packages
= wt
.getAllPackages();
417 for (int index
= 0; index
< packages
.size(); index
++) {
418 this.jComboBoxExistingPackage
.addItem(packages
.elementAt(index
).getName());
423 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
425 * Override actionPerformed to listen all actions
427 public void actionPerformed(ActionEvent arg0
) {
428 if (arg0
.getSource() == jButtonCancel
) {
429 this.setVisible(false);
430 this.returnType
= DataType
.RETURN_TYPE_CANCEL
;
433 if (arg0
.getSource() == jButtonOk
) {
439 this.setVisible(false);
440 this.returnType
= DataType
.RETURN_TYPE_OK
;
443 if (arg0
.getSource() == this.jButtonGen
) {
444 this.jTextFieldGuid
.setText(Tools
.generateUuidString());
447 if (arg0
.getSource() == this.jButtonBrowse
) {
448 JFileChooser fc
= new JFileChooser();
449 fc
.setAcceptAllFileFilterUsed(false);
451 if (mode
== DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
452 fc
.setCurrentDirectory(new File(packages
.elementAt(this.jComboBoxExistingPackage
.getSelectedIndex())
454 fc
.addChoosableFileFilter(new IFileFilter(DataType
.MODULE_SURFACE_AREA_EXT
));
456 if (mode
== DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
) {
457 fc
.setCurrentDirectory(new File(Workspace
.getCurrentWorkspace()));
458 fc
.addChoosableFileFilter(new IFileFilter(DataType
.PACKAGE_SURFACE_AREA_EXT
));
460 if (mode
== DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
) {
461 fc
.setCurrentDirectory(new File(Workspace
.getCurrentWorkspace()));
462 fc
.addChoosableFileFilter(new IFileFilter(DataType
.PLATFORM_SURFACE_AREA_EXT
));
464 int result
= fc
.showSaveDialog(new JPanel());
465 if (result
== JFileChooser
.APPROVE_OPTION
) {
466 this.jTextFieldFilePath
.setText(Tools
.addPathExt(fc
.getSelectedFile().getPath(), mode
));
472 Data validation for all fields
474 @retval true - All datas are valid
475 @retval false - At least one data is invalid
478 public boolean check() {
479 String path
= this.jTextFieldFilePath
.getText();
480 path
= Tools
.addPathExt(path
, mode
);
481 String guid
= this.jTextFieldGuid
.getText();
482 String version
= this.jTextFieldVersion
.getText();
485 // Check if all required fields are not empty
488 Log
.wrn("New File", "A File Path must be entered!");
491 if (isEmpty(this.jTextFieldName
.getText())) {
492 Log
.wrn("New File", "A Name must be entered");
496 Log
.wrn("New File", "The Guid must be entered!");
499 if (isEmpty(version
)) {
500 Log
.wrn("New File", "A Version number must be entered!");
505 // Check if all fields have correct data types
507 if (!DataValidation
.isBaseName(this.jTextFieldName
.getText())) {
508 Log
.wrn("New File", "Incorrect data type for the Name!");
511 if (!DataValidation
.isGuid((guid
))) {
512 Log
.wrn("New File", "Incorrect data type for Guid, which must be in registry format! (8-4-4-4-12)");
517 // Check if path is valid
519 File f
= new File(path
);
521 Log
.wrn("New File", "Please type a complete file path!");
526 if (mode
== DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
528 // Check if the module is already existed in current package
530 String packagePath
= packages
.elementAt(this.jComboBoxExistingPackage
.getSelectedIndex()).getPath();
531 String modulePath
= Tools
.convertPathToCurrentOsType(path
);
532 Vector
<String
> msaFile
= wt
.getAllModulesOfPackage(packagePath
);
534 for (int index
= 0; index
< msaFile
.size(); index
++) {
535 if (msaFile
.elementAt(index
).equals(modulePath
)) {
536 Log
.wrn("New File", "This module is already exists in the selected package!");
542 // Check if path already exists
543 // Currently we allow user to add multiple msa files in one same directory
544 // Remove this checkpoint
546 // if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(modulePath), mode)) {
547 // Log.wrn("New File", "There already exists a same directory with a module");
552 // Check if Guid+Version is unique
554 String packageGuid
= packages
.elementAt(this.jComboBoxExistingPackage
.getSelectedIndex()).getGuid();
555 String packageVersion
= packages
.elementAt(this.jComboBoxExistingPackage
.getSelectedIndex()).getVersion();
556 if (GlobalData
.findModuleId(guid
, version
, packageGuid
, packageVersion
) != null) {
557 Log
.wrn("New File", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");
562 if (mode
== DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
) {
564 // Check if the package is already existed in database
566 path
= Tools
.convertPathToCurrentOsType(path
);
567 Vector
<PackageIdentification
> vPackageList
= wt
.getAllPackages();
568 if (vPackageList
!= null && vPackageList
.size() > 0) {
569 for (int index
= 0; index
< vPackageList
.size(); index
++) {
570 if (vPackageList
.get(index
).getPath().equals(path
)) {
571 Log
.wrn("New File", "This package is already exists in this workspace!");
578 // Check if path already exists
580 if (GlobalData
.isDuplicateRelativePath(Tools
.getFilePathOnly(path
), mode
)) {
581 Log
.wrn("New File", "There already exists a same directory with a package");
586 // Check if Guid+Version is unique
588 if (GlobalData
.findPackageId(guid
, version
) != null) {
589 Log
.wrn("New File", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");
594 if (mode
== DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
) {
596 // Check if the platform is already existed in database
598 path
= Tools
.convertPathToCurrentOsType(path
);
599 Vector
<PlatformIdentification
> vPlatfromList
= wt
.getAllPlatforms();
600 if (vPlatfromList
!= null && vPlatfromList
.size() > 0) {
601 for (int index
= 0; index
< vPlatfromList
.size(); index
++) {
602 if (vPlatfromList
.get(index
).getPath().equals(path
)) {
603 Log
.wrn("New File", "This platform is already exists in this workspace!");
610 // Check if path already exists
612 if (GlobalData
.isDuplicateRelativePath(Tools
.getFilePathOnly(path
), mode
)) {
613 Log
.wrn("New File", "There already exists a same directory with a platform");
618 // Check if Guid+Version is unique
620 if (GlobalData
.findPlatformId(guid
, version
) != null) {
621 Log
.wrn("New File", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");
634 if (mode
== DataType
.RETURN_TYPE_MODULE_SURFACE_AREA
) {
637 if (mode
== DataType
.RETURN_TYPE_PACKAGE_SURFACE_AREA
) {
640 if (mode
== DataType
.RETURN_TYPE_PLATFORM_SURFACE_AREA
) {
646 Save all components of Msa Header
649 private void saveModule() {
651 String path
= Tools
.convertPathToCurrentOsType(this.jTextFieldFilePath
.getText());
657 MsaHeaderDocument
.MsaHeader msaHeader
= null;
659 msa
= ModuleSurfaceArea
.Factory
.newInstance();
660 msaHeader
= MsaHeaderDocument
.MsaHeader
.Factory
.newInstance();
662 msaHeader
.setModuleName(this.jTextFieldName
.getText());
663 msaHeader
.setGuidValue(this.jTextFieldGuid
.getText());
664 msaHeader
.setVersion(this.jTextFieldVersion
.getText());
665 msaHeader
.setModuleType(ModuleTypeDef
.BASE
);
667 msa
.setMsaHeader(msaHeader
);
668 } catch (Exception e
) {
669 Log
.err("Save ModuleSurfaceArea Document", e
.getMessage());
677 SaveFile
.saveMsaFile(path
, msa
);
678 } catch (Exception e
) {
679 Log
.wrn("Save Module to file system", e
.getMessage());
680 Log
.err("Save Module to file system", e
.getMessage());
685 // Save to identification
687 mid
= new ModuleIdentification(this.jTextFieldName
.getText(), this.jTextFieldGuid
.getText(),
688 this.jTextFieldVersion
.getText(), path
, jRadioButtonYes
.isSelected());
689 mid
.setPackageId(packages
.elementAt(this.jComboBoxExistingPackage
.getSelectedIndex()));
693 Save all components of Spd Header
696 private void savePackage() {
698 String path
= Tools
.convertPathToCurrentOsType(this.jTextFieldFilePath
.getText());
704 SpdHeaderDocument
.SpdHeader spdHeader
= null;
706 spd
= PackageSurfaceArea
.Factory
.newInstance();
707 spdHeader
= SpdHeaderDocument
.SpdHeader
.Factory
.newInstance();
709 spdHeader
.setPackageName(this.jTextFieldName
.getText());
710 spdHeader
.setGuidValue(this.jTextFieldGuid
.getText());
711 spdHeader
.setVersion(this.jTextFieldVersion
.getText());
713 spd
.setSpdHeader(spdHeader
);
714 } catch (Exception e
) {
715 Log
.wrn("Save Package Surface Area Description Document", e
.getMessage());
723 SaveFile
.saveSpdFile(path
, spd
);
725 } catch (Exception e
) {
726 Log
.wrn("Save Package to file system", e
.getMessage());
727 Log
.err("Save Package to file system", e
.getMessage());
732 // Save to identification
734 pid
= new PackageIdentification(this.jTextFieldName
.getText(), this.jTextFieldGuid
.getText(),
735 this.jTextFieldVersion
.getText(), path
);
739 Save all components of Fpd Header
742 private void savePlatform() {
744 String path
= Tools
.convertPathToCurrentOsType(this.jTextFieldFilePath
.getText());
750 PlatformHeader fpdHeader
= null;
752 fpd
= PlatformSurfaceArea
.Factory
.newInstance();
753 fpdHeader
= PlatformHeader
.Factory
.newInstance();
755 fpdHeader
.setPlatformName(this.jTextFieldName
.getText());
756 fpdHeader
.setGuidValue(this.jTextFieldGuid
.getText());
757 fpdHeader
.setVersion(this.jTextFieldVersion
.getText());
759 fpd
.setPlatformHeader(fpdHeader
);
760 } catch (Exception e
) {
761 Log
.wrn("Save Framework Platform Description Document", e
.getMessage());
769 SaveFile
.saveFpdFile(path
, fpd
);
771 } catch (Exception e
) {
772 Log
.wrn("Save Platform to file system", e
.getMessage());
773 Log
.err("Save Platform to file system", e
.getMessage());
778 // Save to identification
780 fid
= new PlatformIdentification(this.jTextFieldName
.getText(), this.jTextFieldGuid
.getText(),
781 this.jTextFieldVersion
.getText(), path
);
784 public ModuleIdentification
getMid() {
788 public PlatformIdentification
getFid() {
792 public PackageIdentification
getPid() {
796 private void upLocation(Component c
, int size
) {
797 c
.setLocation(c
.getLocation().x
, c
.getLocation().y
- size
);
800 public PlatformSurfaceArea
getFpd() {
804 public ModuleSurfaceArea
getMsa() {
808 public PackageSurfaceArea
getSpd() {