X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FFrameworkWizard%2Fsrc%2Forg%2Ftianocore%2Fframeworkwizard%2Fmodule%2Fui%2FMsaHeader.java;h=18757ae473b55bd6576281a2e96870a158015d71;hp=07081bcaee7e4ef06ccfa5cb22a879c9e5321eec;hb=0f6a65114ec9fae703d8f04de48d5d13bd9b8b7a;hpb=8792f60fcb339fedcc1a62b1da3dbb0cfc4b5d1b
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
index 07081bcaee..18757ae473 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
@@ -29,10 +29,12 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
+import org.tianocore.ExternsDocument;
import org.tianocore.ModuleDefinitionsDocument;
import org.tianocore.ModuleSurfaceAreaDocument;
import org.tianocore.ModuleTypeDef;
import org.tianocore.MsaHeaderDocument;
+import org.tianocore.PcdDriverTypes;
import org.tianocore.LicenseDocument.License;
import org.tianocore.frameworkwizard.common.DataType;
import org.tianocore.frameworkwizard.common.DataValidation;
@@ -57,6 +59,17 @@ public class MsaHeader extends IInternalFrame {
///
private static final long serialVersionUID = -8152099582923006900L;
+ private int dialogWidth = 500;
+
+ private int dialogHeight = 630;
+
+ private final int labelWidth = 155;
+
+ private int valueWidth = 320;
+
+ private final int labelCol = 12;
+
+ private final int valueCol = 168;
//
//Define class members
//
@@ -148,8 +161,6 @@ public class MsaHeader extends IInternalFrame {
private StarLabel jStarLabel14 = null;
- private StarLabel jStarLabel15 = null;
-
private JCheckBox jCheckBoxIa32 = null;
private JCheckBox jCheckBoxX64 = null;
@@ -162,6 +173,12 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox jCheckBoxPpc = null;
+ private JComboBox jComboBoxPcdIsDriver = null;
+
+ private JCheckBox jCheckBoxPcd = null;
+
+ private JCheckBox jCheckBoxFlashMap = null;
+
//
// Not used for UI
//
@@ -171,6 +188,8 @@ public class MsaHeader extends IInternalFrame {
private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
+ private ExternsDocument.Externs ex = null;
+
private OpeningModuleType omt = null;
private EnumerationData ed = new EnumerationData();
@@ -183,7 +202,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxIa32() {
if (jCheckBoxIa32 == null) {
jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(160, 505, 55, 20));
+ jCheckBoxIa32.setBounds(new java.awt.Rectangle(valueCol, 505, 55, 20));
jCheckBoxIa32.setText("IA32");
jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxIa32.addFocusListener(this);
@@ -199,7 +218,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxX64() {
if (jCheckBoxX64 == null) {
jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setBounds(new java.awt.Rectangle(215, 505, 53, 20));
+ jCheckBoxX64.setBounds(new java.awt.Rectangle(valueCol + 55, 505, 53, 20));
jCheckBoxX64.setText("X64");
jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxX64.addFocusListener(this);
@@ -215,7 +234,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxIpf() {
if (jCheckBoxIpf == null) {
jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(270, 505, 52, 20));
+ jCheckBoxIpf.setBounds(new java.awt.Rectangle(valueCol + 110, 505, 52, 20));
jCheckBoxIpf.setText("IPF");
jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxIpf.addFocusListener(this);
@@ -231,7 +250,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxEbc() {
if (jCheckBoxEbc == null) {
jCheckBoxEbc = new JCheckBox();
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(325, 505, 53, 20));
+ jCheckBoxEbc.setBounds(new java.awt.Rectangle(valueCol + 165, 505, 53, 20));
jCheckBoxEbc.setText("EBC");
jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxEbc.addFocusListener(this);
@@ -247,7 +266,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxArm() {
if (jCheckBoxArm == null) {
jCheckBoxArm = new JCheckBox();
- jCheckBoxArm.setBounds(new java.awt.Rectangle(380, 505, 54, 20));
+ jCheckBoxArm.setBounds(new java.awt.Rectangle(valueCol + 220, 505, 54, 20));
jCheckBoxArm.setText("ARM");
jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxArm.addFocusListener(this);
@@ -263,7 +282,7 @@ public class MsaHeader extends IInternalFrame {
private JCheckBox getJCheckBoxPpc() {
if (jCheckBoxPpc == null) {
jCheckBoxPpc = new JCheckBox();
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(435, 505, 53, 20));
+ jCheckBoxPpc.setBounds(new java.awt.Rectangle(valueCol + 285, 505, 53, 20));
jCheckBoxPpc.setText("PPC");
jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
jCheckBoxPpc.addFocusListener(this);
@@ -280,7 +299,7 @@ public class MsaHeader extends IInternalFrame {
private JTextField getJTextFieldBaseName() {
if (jTextFieldBaseName == null) {
jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 320, 20));
+ jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueCol, 10, valueWidth, 20));
jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320, 20));
jTextFieldBaseName.addFocusListener(this);
jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");
@@ -298,7 +317,7 @@ public class MsaHeader extends IInternalFrame {
if (jTextFieldGuid == null) {
jTextFieldGuid = new JTextField();
jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250, 20));
- jTextFieldGuid.setLocation(new java.awt.Point(160, 60));
+ jTextFieldGuid.setLocation(new java.awt.Point(valueCol, 60));
jTextFieldGuid.setSize(new java.awt.Dimension(250, 20));
jTextFieldGuid.addFocusListener(this);
jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");
@@ -315,9 +334,9 @@ public class MsaHeader extends IInternalFrame {
private JTextField getJTextFieldVersion() {
if (jTextFieldVersion == null) {
jTextFieldVersion = new JTextField();
- jTextFieldVersion.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldVersion.setLocation(new java.awt.Point(160, 85));
- jTextFieldVersion.setSize(new java.awt.Dimension(320, 20));
+ jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
+ jTextFieldVersion.setLocation(new java.awt.Point(valueCol, 85));
+ jTextFieldVersion.setSize(new java.awt.Dimension(valueWidth, 20));
jTextFieldVersion.addFocusListener(this);
jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");
}
@@ -332,10 +351,11 @@ public class MsaHeader extends IInternalFrame {
**/
private JButton getJButtonGenerateGuid() {
if (jButtonGenerateGuid == null) {
+ int genGuidCol = valueCol + 285;
jButtonGenerateGuid = new JButton();
jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));
jButtonGenerateGuid.setSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setLocation(new java.awt.Point(415, 60));
+ jButtonGenerateGuid.setLocation(new java.awt.Point(genGuidCol, 60));
jButtonGenerateGuid.setText("GEN");
jButtonGenerateGuid.addActionListener(this);
}
@@ -373,7 +393,7 @@ public class MsaHeader extends IInternalFrame {
jTextAreaDescription = new JTextArea();
jTextAreaDescription.setLineWrap(true);
jTextAreaDescription.addFocusListener(this);
- jTextAreaDescription.setToolTipText("A verbose description of the module");
+ jTextAreaDescription.setToolTipText("A verbose description of the module.");
jTextAreaDescription.setWrapStyleWord(true);
jTextAreaDescription.setSelectionStart(0);
jTextAreaDescription.setSelectionEnd(0);
@@ -389,11 +409,15 @@ public class MsaHeader extends IInternalFrame {
**/
private JTextField getJTextFieldSpecification() {
if (jTextFieldSpecification == null) {
+ int specWidth = valueWidth + 50;
jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320, 20));
+
+ jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth, 20));
jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
- jTextFieldSpecification.setSize(new java.awt.Dimension(320, 20));
- jTextFieldSpecification.setLocation(new java.awt.Point(160, 530));
+ jTextFieldSpecification.setBorder(null);
+
+ jTextFieldSpecification.setSize(new java.awt.Dimension(specWidth, 20));
+ jTextFieldSpecification.setLocation(new java.awt.Point(labelCol, dialogHeight - 30));
jTextFieldSpecification.setEditable(false);
jTextFieldSpecification.addFocusListener(this);
}
@@ -446,10 +470,10 @@ public class MsaHeader extends IInternalFrame {
if (jScrollPaneLicense == null) {
jScrollPaneLicense = new JScrollPane();
jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setSize(new java.awt.Dimension(320, 120));
- jScrollPaneLicense.setLocation(new java.awt.Point(160, 305));
+ jScrollPaneLicense.setSize(new java.awt.Dimension(valueWidth, 120));
+ jScrollPaneLicense.setLocation(new java.awt.Point(valueCol, 305));
jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(320, 120));
+ jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
}
return jScrollPaneLicense;
}
@@ -464,10 +488,10 @@ public class MsaHeader extends IInternalFrame {
if (jScrollPaneDescription == null) {
jScrollPaneDescription = new JScrollPane();
jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setSize(new java.awt.Dimension(320, 120));
- jScrollPaneDescription.setLocation(new java.awt.Point(160, 135));
+ jScrollPaneDescription.setSize(new java.awt.Dimension(valueWidth, 120));
+ jScrollPaneDescription.setLocation(new java.awt.Point(valueCol, 135));
jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(320, 120));
+ jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
}
return jScrollPaneDescription;
}
@@ -481,11 +505,11 @@ public class MsaHeader extends IInternalFrame {
private JTextField getJTextFieldAbstract() {
if (jTextFieldAbstract == null) {
jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldAbstract.setLocation(new java.awt.Point(160, 110));
- jTextFieldAbstract.setSize(new java.awt.Dimension(320, 20));
+ jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
+ jTextFieldAbstract.setLocation(new java.awt.Point(valueCol, 110));
+ jTextFieldAbstract.setSize(new java.awt.Dimension(valueWidth, 20));
jTextFieldAbstract.addFocusListener(this);
- jTextFieldAbstract.setToolTipText("A one sentence description of this module");
+ jTextFieldAbstract.setToolTipText("A one sentence description of this module.");
}
return jTextFieldAbstract;
}
@@ -499,8 +523,8 @@ public class MsaHeader extends IInternalFrame {
private JComboBox getJComboBoxModuleType() {
if (jComboBoxModuleType == null) {
jComboBoxModuleType = new JComboBox();
- jComboBoxModuleType.setBounds(new java.awt.Rectangle(160, 35, 320, 20));
- jComboBoxModuleType.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxModuleType.setBounds(new java.awt.Rectangle(valueCol, 35, valueWidth, 20));
+ jComboBoxModuleType.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
jComboBoxModuleType.addFocusListener(this);
}
return jComboBoxModuleType;
@@ -515,11 +539,11 @@ public class MsaHeader extends IInternalFrame {
private JTextField getJTextFieldURL() {
if (jTextFieldURL == null) {
jTextFieldURL = new JTextField();
- jTextFieldURL.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldURL.setLocation(new java.awt.Point(160, 430));
- jTextFieldURL.setSize(new java.awt.Dimension(320, 20));
+ jTextFieldURL.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
+ jTextFieldURL.setLocation(new java.awt.Point(valueCol, 430));
+ jTextFieldURL.setSize(new java.awt.Dimension(valueWidth, 20));
jTextFieldURL.addFocusListener(this);
- jTextFieldURL.setToolTipText("A URL for the latest version of the license");
+ jTextFieldURL.setToolTipText("A URL for the latest version of the license.");
}
return jTextFieldURL;
}
@@ -547,10 +571,10 @@ public class MsaHeader extends IInternalFrame {
private JScrollPane getJScrollPaneCopyright() {
if (jScrollPaneCopyright == null) {
jScrollPaneCopyright = new JScrollPane();
- jScrollPaneCopyright.setBounds(new java.awt.Rectangle(160, 260, 320, 40));
- jScrollPaneCopyright.setPreferredSize(new java.awt.Dimension(320, 40));
+ jScrollPaneCopyright.setBounds(new java.awt.Rectangle(valueCol, 260, valueWidth, 40));
+ jScrollPaneCopyright.setPreferredSize(new java.awt.Dimension(valueWidth, 40));
jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());
- jScrollPaneCopyright.setSize(new java.awt.Dimension(320, 40));
+ jScrollPaneCopyright.setSize(new java.awt.Dimension(valueWidth, 40));
}
return jScrollPaneCopyright;
}
@@ -569,8 +593,8 @@ public class MsaHeader extends IInternalFrame {
jTextAreaCopyright.setWrapStyleWord(true);
jTextAreaCopyright.setSelectionStart(0);
jTextAreaCopyright.setSelectionEnd(0);
- jTextAreaCopyright.setBounds(new java.awt.Rectangle(0, 0, 320, 40));
- jTextAreaCopyright.setToolTipText("One or more copyright lines");
+ jTextAreaCopyright.setBounds(new java.awt.Rectangle(0, 0, valueWidth, 40));
+ jTextAreaCopyright.setToolTipText("One or more copyright lines.");
}
return jTextAreaCopyright;
}
@@ -583,8 +607,8 @@ public class MsaHeader extends IInternalFrame {
private JComboBox getJComboBoxBinaryModule() {
if (jComboBoxBinaryModule == null) {
jComboBoxBinaryModule = new JComboBox();
- jComboBoxBinaryModule.setBounds(new java.awt.Rectangle(160, 480, 320, 20));
- jComboBoxBinaryModule.setPreferredSize(new java.awt.Dimension(320, 20));
+ jComboBoxBinaryModule.setBounds(new java.awt.Rectangle(valueCol, 480, valueWidth, 20));
+ jComboBoxBinaryModule.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
jComboBoxBinaryModule.addFocusListener(this);
jComboBoxBinaryModule.setToolTipText("Modules are either source modules
"
+ "which can be compiled or binary
"
@@ -592,7 +616,7 @@ public class MsaHeader extends IInternalFrame {
+ "A module cannot contain both.
"
+ "The GUID numbers should be identical
"
+ "for a binary and source MSA,
"
- + "but the BINARY MSA should have
"
+ + "however the BINARY MSA should have
"
+ "a higher version number.");
}
return jComboBoxBinaryModule;
@@ -606,14 +630,33 @@ public class MsaHeader extends IInternalFrame {
private JTextField getJTextFieldOutputFileBasename() {
if (jTextFieldOutputFileBasename == null) {
jTextFieldOutputFileBasename = new JTextField();
- jTextFieldOutputFileBasename.setBounds(new java.awt.Rectangle(160, 455, 320, 20));
- jTextFieldOutputFileBasename.setPreferredSize(new java.awt.Dimension(320, 20));
+ jTextFieldOutputFileBasename.setBounds(new java.awt.Rectangle(valueCol, 455, valueWidth, 20));
+ jTextFieldOutputFileBasename.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
jTextFieldOutputFileBasename.addFocusListener(this);
- jTextFieldOutputFileBasename.setToolTipText("Enter a single word for generated output file names");
+ jTextFieldOutputFileBasename.setToolTipText("Enter a single word for generated output file names.");
}
return jTextFieldOutputFileBasename;
}
+ /**
+ * This method initializes jComboBoxPcdIsDriver
+ *
+ * @return javax.swing.JComboBox
+ */
+ private JComboBox getJComboBoxPcdIsDriver() {
+ if (jComboBoxPcdIsDriver == null) {
+ jComboBoxPcdIsDriver = new JComboBox();
+ jComboBoxPcdIsDriver.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
+ jComboBoxPcdIsDriver.setBounds(new java.awt.Rectangle(valueCol, 530, valueWidth, 20));
+ jComboBoxPcdIsDriver.addItemListener(this);
+ jComboBoxPcdIsDriver.addFocusListener(this);
+ jComboBoxPcdIsDriver.setEnabled(false);
+ Tools.generateComboBoxByVector(jComboBoxPcdIsDriver, ed.getVPcdDriverTypes());
+ jComboBoxPcdIsDriver.setVisible(false);
+ }
+ return jComboBoxPcdIsDriver;
+ }
+
/**
This is the default constructor
@@ -646,8 +689,14 @@ public class MsaHeader extends IInternalFrame {
md.setSupportedArchitectures(ed.getVSupportedArchitectures());
msa.setModuleDefinitions(md);
}
+
+ //
+ // Init items of Header, Definitions and Externs
+ //
init(msa.getMsaHeader());
init(msa.getModuleDefinitions());
+ init(msa.getExterns());
+
this.setVisible(true);
this.setViewMode(false);
}
@@ -680,8 +729,8 @@ public class MsaHeader extends IInternalFrame {
**/
private void init() {
- this.setSize(500, 515);
- this.setPreferredSize(new java.awt.Dimension(490, 615));
+ this.setSize(dialogWidth, dialogHeight);
+ this.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
this.setContentPane(getJScrollPane());
this.setTitle("Module Surface Area Header");
initFrame();
@@ -759,6 +808,28 @@ public class MsaHeader extends IInternalFrame {
}
}
+ /**
+ This method initializes this
+ Fill values to all fields if these values are not empty
+
+ @param inEx The input data of ExternsDocument.Externs
+
+ **/
+ private void init(ExternsDocument.Externs inEx) {
+ if (inEx != null) {
+ this.ex = inEx;
+ if (ex.getPcdIsDriver() != null) {
+ this.jCheckBoxPcd.setSelected(true);
+ this.jComboBoxPcdIsDriver.setEnabled(true);
+ this.jComboBoxPcdIsDriver.setSelectedItem(ex.getPcdIsDriver());
+ // TODO: If the module type is DXE_DRIVER, set PCD_DXE_DRIVER
+ // If the module type is PEIM, set PCD_PEI_DRIVER
+ // If the module type is anything else, unset this!
+ }
+ this.jCheckBoxFlashMap.setSelected(ex.getTianoR8FlashMapH());
+ }
+ }
+
/**
This method initializes jContentPane
@@ -770,55 +841,56 @@ public class MsaHeader extends IInternalFrame {
jLabelURL = new JLabel();
jLabelURL.setText("License URL");
- jLabelURL.setLocation(new java.awt.Point(15, 430));
- jLabelURL.setSize(new java.awt.Dimension(140, 20));
+ jLabelURL.setLocation(new java.awt.Point(labelCol, 430));
+ jLabelURL.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelBaseName = new JLabel();
jLabelBaseName.setText("Module Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(15, 10, 140, 20));
+ jLabelBaseName.setBounds(new java.awt.Rectangle(labelCol, 10, labelWidth, 20));
jLabelModuleType = new JLabel();
- jLabelModuleType.setBounds(new java.awt.Rectangle(15, 35, 140, 20));
+ jLabelModuleType.setBounds(new java.awt.Rectangle(labelCol, 35, labelWidth, 20));
jLabelModuleType.setText("Module Type");
jLabelGuid = new JLabel();
jLabelGuid.setText("Guid Value");
- jLabelGuid.setLocation(new java.awt.Point(15, 60));
- jLabelGuid.setSize(new java.awt.Dimension(140, 20));
+ jLabelGuid.setLocation(new java.awt.Point(labelCol, 60));
+ jLabelGuid.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelVersion = new JLabel();
jLabelVersion.setText("Version");
- jLabelVersion.setLocation(new java.awt.Point(15, 85));
- jLabelVersion.setSize(new java.awt.Dimension(140, 20));
+ jLabelVersion.setLocation(new java.awt.Point(labelCol, 85));
+ jLabelVersion.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelAbstract = new JLabel();
jLabelAbstract.setText("Abstract");
- jLabelAbstract.setLocation(new java.awt.Point(15, 110));
- jLabelAbstract.setSize(new java.awt.Dimension(140, 20));
+ jLabelAbstract.setLocation(new java.awt.Point(labelCol, 110));
+ jLabelAbstract.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelDescription = new JLabel();
jLabelDescription.setText("Description");
- jLabelDescription.setLocation(new java.awt.Point(15, 135));
- jLabelDescription.setSize(new java.awt.Dimension(140, 20));
+ jLabelDescription.setLocation(new java.awt.Point(labelCol, 135));
+ jLabelDescription.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelCopyright = new JLabel();
jLabelCopyright.setText("Copyright");
- jLabelCopyright.setLocation(new java.awt.Point(15, 260));
- jLabelCopyright.setSize(new java.awt.Dimension(140, 20));
+ jLabelCopyright.setLocation(new java.awt.Point(labelCol, 260));
+ jLabelCopyright.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelLicense = new JLabel();
jLabelLicense.setText("License");
- jLabelLicense.setLocation(new java.awt.Point(15, 305));
- jLabelLicense.setSize(new java.awt.Dimension(140, 20));
+ jLabelLicense.setLocation(new java.awt.Point(labelCol, 305));
+ jLabelLicense.setSize(new java.awt.Dimension(labelWidth, 20));
jLabelOutputFileBasename = new JLabel();
- jLabelOutputFileBasename.setBounds(new java.awt.Rectangle(15, 455, 140, 20));
+ jLabelOutputFileBasename.setBounds(new java.awt.Rectangle(labelCol, 455, labelWidth, 20));
jLabelOutputFileBasename.setText("Output File Basename");
jLabelBinaryModule = new JLabel();
- jLabelBinaryModule.setBounds(new java.awt.Rectangle(15, 480, 140, 20));
+ jLabelBinaryModule.setBounds(new java.awt.Rectangle(labelCol, 480, labelWidth, 20));
jLabelBinaryModule.setText("Binary Module");
jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(15, 505, 140, 20));
+ jLabelArch.setBounds(new java.awt.Rectangle(labelCol, 505, labelWidth, 20));
jLabelArch.setText("Supported Architectures");
jLabelSpecification = new JLabel();
jLabelSpecification.setText("Specification");
- jLabelSpecification.setLocation(new java.awt.Point(14, 530));
- jLabelSpecification.setSize(new java.awt.Dimension(140, 20));
+ jLabelSpecification.setLocation(new java.awt.Point(labelCol, 530));
+ jLabelSpecification.setSize(new java.awt.Dimension(labelWidth, 20));
jContentPane = new JPanel();
jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 565));
+ jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 10, dialogHeight - 10));
+
jContentPane.addFocusListener(this);
jContentPane.add(jLabelBaseName, null);
@@ -831,7 +903,6 @@ public class MsaHeader extends IInternalFrame {
jContentPane.add(jLabelLicense, null);
jContentPane.add(jLabelCopyright, null);
jContentPane.add(jLabelDescription, null);
- jContentPane.add(jLabelSpecification, null);
jContentPane.add(getJTextFieldSpecification(), null);
jContentPane.add(getJButtonOk(), null);
jContentPane.add(getJButtonCancel(), null);
@@ -871,8 +942,6 @@ public class MsaHeader extends IInternalFrame {
jStarLabel13.setLocation(new java.awt.Point(0, 480));
jStarLabel14 = new StarLabel();
jStarLabel14.setLocation(new java.awt.Point(0, 505));
- jStarLabel15 = new StarLabel();
- jStarLabel15.setLocation(new java.awt.Point(0, 530));
jContentPane.add(jStarLabel1, null);
jContentPane.add(jStarLabel2, null);
@@ -885,7 +954,6 @@ public class MsaHeader extends IInternalFrame {
jContentPane.add(jStarLabel12, null);
jContentPane.add(jStarLabel13, null);
jContentPane.add(jStarLabel14, null);
- jContentPane.add(jStarLabel15, null);
jContentPane.add(getJScrollPaneCopyright(), null);
jContentPane.add(getJCheckBoxIa32(), null);
@@ -894,6 +962,12 @@ public class MsaHeader extends IInternalFrame {
jContentPane.add(getJCheckBoxEbc(), null);
jContentPane.add(getJCheckBoxArm(), null);
jContentPane.add(getJCheckBoxPpc(), null);
+
+
+ jContentPane.add(getJCheckBoxPcd(), null);
+ jContentPane.add(getJComboBoxPcdIsDriver(), null);
+
+ jContentPane.add(getJCheckBoxFlashMap(), null);
}
return jContentPane;
}
@@ -914,11 +988,19 @@ public class MsaHeader extends IInternalFrame {
this.setEdited(true);
this.dispose();
}
+
if (arg0.getSource() == jButtonCancel) {
this.setEdited(false);
}
+
if (arg0.getSource() == jButtonGenerateGuid) {
jTextFieldGuid.setText(Tools.generateUuidString());
+ jTextFieldGuid.requestFocus();
+ jButtonGenerateGuid.requestFocus();
+ }
+
+ if (arg0.getSource() == this.jCheckBoxPcd) {
+ this.jComboBoxPcdIsDriver.setEnabled(this.jCheckBoxPcd.isSelected());
}
}
@@ -939,12 +1021,12 @@ public class MsaHeader extends IInternalFrame {
// Check Base Name
//
if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Base Name couldn't be empty");
+ Log.wrn("Update Msa Header", "Name must be entered!");
//this.jTextFieldBaseName.requestFocus();
return false;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Base Name");
+ Log.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");
//this.jTextFieldBaseName.requestFocus();
return false;
}
@@ -953,12 +1035,12 @@ public class MsaHeader extends IInternalFrame {
// Check Guid
//
if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "Guid Value couldn't be empty");
+ Log.wrn("Update Msa Header", "The Guid Value must be entered!");
//this.jTextFieldGuid.requestFocus();
return false;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid");
+ Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");
//this.jTextFieldGuid.requestFocus();
return false;
}
@@ -967,12 +1049,12 @@ public class MsaHeader extends IInternalFrame {
// Check Version
//
if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version couldn't be empty");
+ Log.wrn("Update Msa Header", "Version must be entered!");
//this.jTextFieldVersion.requestFocus();
return false;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version");
+ Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
//this.jTextFieldVersion.requestFocus();
return false;
}
@@ -981,12 +1063,13 @@ public class MsaHeader extends IInternalFrame {
// Check Abstact
//
if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract couldn't be empty");
+ Log.wrn("Update Msa Header", "Abstract must be entered!");
//this.jTextFieldAbstract.requestFocus();
return false;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Abstract");
+ Log.wrn("Update Msa Header",
+ "Incorrect data type for Abstract, is should be a sentence describing the module.");
//this.jTextFieldAbstract.requestFocus();
return false;
}
@@ -995,7 +1078,7 @@ public class MsaHeader extends IInternalFrame {
// Check Description
//
if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description couldn't be empty");
+ Log.wrn("Update Msa Header", "Description must be entered!");
//this.jTextAreaDescription.requestFocus();
return false;
}
@@ -1004,7 +1087,7 @@ public class MsaHeader extends IInternalFrame {
// Check Copyright
//
if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright couldn't be empty");
+ Log.wrn("Update Msa Header", "Copyright must be entered!");
//this.jTextFieldCopyright.requestFocus();
return false;
}
@@ -1013,7 +1096,7 @@ public class MsaHeader extends IInternalFrame {
// Check License
//
if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License couldn't be empty");
+ Log.wrn("Update Msa Header", "License must be entered!");
//this.jTextAreaLicense.requestFocus();
return false;
}
@@ -1022,11 +1105,14 @@ public class MsaHeader extends IInternalFrame {
// Check Specification
//
if (isEmpty(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Msa Header", "Specification couldn't be empty");
+ Log.wrn("Update Msa Header", "Specification must exist.");
//this.jTextFieldSpecification.requestFocus();
return false;
}
if (!DataValidation.isSpecification(this.jTextFieldSpecification.getText())) {
+ // TODO Add code to check the specification number.
+ // Future releases of Schema may require that we process these files
+ // differently.
Log.wrn("Update Msa Header", "Incorrect data type for Specification");
//this.jTextFieldSpecification.requestFocus();
return false;
@@ -1100,14 +1186,15 @@ public class MsaHeader extends IInternalFrame {
Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);
Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);
Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
+ // Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth);
+ // Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
+ // Tools.resizeComponentWidth(this.jComboBoxBinaryModule, intCurrentWidth, intPreferredWidth);
Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);
+ // Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);
Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,
- DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
+ DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON - 5);
}
public void focusLost(FocusEvent arg0) {
@@ -1120,12 +1207,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldBaseName) {
if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Base Name couldn't be empty");
+ Log.wrn("Update Msa Header", "The Name must be entered!");
//this.jTextFieldBaseName.requestFocus();
return;
}
if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Base Name");
+ Log.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");
//this.jTextFieldBaseName.requestFocus();
return;
}
@@ -1152,12 +1239,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldGuid) {
if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "Guid Value couldn't be empty");
+ Log.wrn("Update Msa Header", "Guid must be entered!");
//this.jTextFieldGuid.requestFocus();
return;
}
if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid");
+ Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");
//this.jTextFieldGuid.requestFocus();
return;
}
@@ -1173,12 +1260,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldVersion) {
if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version couldn't be empty");
+ Log.wrn("Update Msa Header", "Version must be entered!");
//this.jTextFieldVersion.requestFocus();
return;
}
if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version");
+ Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
//this.jTextFieldVersion.requestFocus();
return;
}
@@ -1194,12 +1281,12 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldAbstract) {
if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract couldn't be empty");
+ Log.wrn("Update Msa Header", "Abstract must be entered!");
//this.jTextFieldAbstract.requestFocus();
return;
}
if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Abstract");
+ Log.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");
//this.jTextFieldAbstract.requestFocus();
return;
}
@@ -1215,7 +1302,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextAreaDescription) {
if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description couldn't be empty");
+ Log.wrn("Update Msa Header", "Description must be entered!");
//this.jTextAreaDescription.requestFocus();
return;
}
@@ -1231,7 +1318,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextAreaCopyright) {
if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright couldn't be empty");
+ Log.wrn("Update Msa Header", "Copyright must be entered!");
//this.jTextFieldCopyright.requestFocus();
return;
}
@@ -1247,7 +1334,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextAreaLicense) {
if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License couldn't be empty");
+ Log.wrn("Update Msa Header", "License must be entered!");
//this.jTextAreaLicense.requestFocus();
return;
}
@@ -1288,7 +1375,7 @@ public class MsaHeader extends IInternalFrame {
//
if (arg0.getSource() == this.jTextFieldOutputFileBasename) {
if (isEmpty(this.jTextFieldOutputFileBasename.getText())) {
- Log.wrn("Update Msa Header", "Output File Basename couldn't be empty");
+ Log.wrn("Update Msa Header", "Output File Basename must be entered!");
// jTextFieldOutputFileBasename.removeFocusListener(this);
// jTextFieldOutputFileBasename.requestFocus();
// jTextFieldOutputFileBasename.addFocusListener(this);
@@ -1333,6 +1420,84 @@ public class MsaHeader extends IInternalFrame {
}
}
+ //
+ // Check Pcd is Driver
+ //
+ if (arg0.getSource() == this.jCheckBoxPcd || arg0.getSource() == this.jComboBoxPcdIsDriver) {
+ if ((this.ex == null) && this.jCheckBoxPcd.isSelected()) {
+ this.ex = ExternsDocument.Externs.Factory.newInstance();
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()
+ .toString()));
+ this.msa.setExterns(this.ex);
+ } else if ((this.ex != null) && (this.ex.getPcdIsDriver() == null) && this.jCheckBoxPcd.isSelected()) {
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()
+ .toString()));
+ this.msa.setExterns(this.ex);
+ } else if ((this.ex != null) && (this.ex.getPcdIsDriver() != null)) {
+ if (this.jCheckBoxPcd.isSelected()
+ && !this.jComboBoxPcdIsDriver.getSelectedItem().toString().equals(
+ this.ex.getPcdIsDriver()
+ .toString())) {
+ this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getSelectedItem()
+ .toString()));
+ this.msa.setExterns(this.ex);
+ }
+ if (!this.jCheckBoxPcd.isSelected()) {
+ ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
+ if (this.ex.getExternList() != null) {
+ for (int index = 0; index < this.ex.getExternList().size(); index++) {
+ newEx.addNewExtern();
+ newEx.setExternArray(index, this.ex.getExternArray(index));
+ }
+ }
+ if (this.ex.getSpecificationList() != null) {
+ for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
+ newEx.addNewSpecification();
+ newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
+ }
+ }
+ if (this.ex.getTianoR8FlashMapH()) {
+ newEx.setTianoR8FlashMapH(this.ex.getTianoR8FlashMapH());
+ }
+ this.ex = newEx;
+ this.msa.setExterns(this.ex);
+ }
+ }
+ }
+
+ //
+ // Check Flash Map
+ //
+ if (arg0.getSource() == this.jCheckBoxFlashMap) {
+ if ((this.ex == null) && this.jCheckBoxFlashMap.isSelected()) {
+ this.ex = ExternsDocument.Externs.Factory.newInstance();
+ this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
+ this.msa.setExterns(this.ex);
+ } else if ((this.ex != null) && this.jCheckBoxFlashMap.isSelected()) {
+ this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
+ this.msa.setExterns(this.ex);
+ } else if ((this.ex != null) && !this.jCheckBoxFlashMap.isSelected()) {
+ ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
+ if (this.ex.getExternList() != null) {
+ for (int index = 0; index < this.ex.getExternList().size(); index++) {
+ newEx.addNewExtern();
+ newEx.setExternArray(index, this.ex.getExternArray(index));
+ }
+ }
+ if (this.ex.getSpecificationList() != null) {
+ for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
+ newEx.addNewSpecification();
+ newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
+ }
+ }
+ if (this.ex.getPcdIsDriver() != null) {
+ newEx.setPcdIsDriver(this.ex.getPcdIsDriver());
+ }
+ this.ex = newEx;
+ this.msa.setExterns(this.ex);
+ }
+ }
+
this.save();
}
@@ -1422,4 +1587,36 @@ public class MsaHeader extends IInternalFrame {
}
}
}
+
+ /**
+ * This method initializes jCheckBoxPcd
+ *
+ * @return javax.swing.JCheckBox
+ */
+ private JCheckBox getJCheckBoxPcd() {
+ if (jCheckBoxPcd == null) {
+ jCheckBoxPcd = new JCheckBox();
+ jCheckBoxPcd.setBounds(new java.awt.Rectangle(labelCol, 530, labelWidth, 20));
+ jCheckBoxPcd.setText("Is this a PCD Driver?");
+ jCheckBoxPcd.addFocusListener(this);
+ jCheckBoxPcd.addActionListener(this);
+ }
+ return jCheckBoxPcd;
+ }
+
+ /**
+ * This method initializes jCheckBoxFlashMap
+ *
+ * @return javax.swing.JCheckBox
+ */
+ private JCheckBox getJCheckBoxFlashMap() {
+ if (jCheckBoxFlashMap == null) {
+ jCheckBoxFlashMap = new JCheckBox();
+ jCheckBoxFlashMap.setBounds(new java.awt.Rectangle(labelCol, 555, 480, 20));
+ jCheckBoxFlashMap.setText("Are you using a legacy FlashMap header file?");
+ jCheckBoxFlashMap.addFocusListener(this);
+ }
+ return jCheckBoxFlashMap;
+ }
+
}