From f3b0ed9a12ec287bb336b9672a0937667f1958ec Mon Sep 17 00:00:00 2001
From: jlin16
Date: Thu, 6 Jul 2006 01:09:38 +0000
Subject: some bug fixing for FpdFrameworkModules
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@779 6f19259b-4bc3-4df7-8a09-765794883524
---
.../platform/ui/FpdBuildOptions.java | 7 +-
.../platform/ui/FpdDynamicPcdBuildDefinitions.java | 2 +-
.../platform/ui/FpdFileContents.java | 24 +-
.../platform/ui/FpdFrameworkModules.java | 31 ++-
.../frameworkwizard/platform/ui/FpdHeader.java | 1 +
.../frameworkwizard/platform/ui/FpdModuleSA.java | 65 ++++-
.../platform/ui/global/GlobalData.java | 300 ---------------------
.../platform/ui/global/SurfaceAreaQuery.java | 109 +-------
.../platform/ui/id/FpdModuleIdentification.java | 4 -
9 files changed, 102 insertions(+), 441 deletions(-)
(limited to 'Tools')
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
index b94e695ecc..af0c95cadd 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
@@ -390,6 +390,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable2 == null) {
antTaskTableModel = new DefaultTableModel();
jTable2 = new JTable(antTaskTableModel);
+ jTable2.setRowHeight(20);
antTaskTableModel.addColumn("ID");
antTaskTableModel.addColumn("Filename");
antTaskTableModel.addColumn("ANT Command Options");
@@ -635,6 +636,7 @@ public class FpdBuildOptions extends IInternalFrame {
ffsAttributesTableModel = new DefaultTableModel();
jTable4 = new JTable(ffsAttributesTableModel);
jTable4.setPreferredSize(new java.awt.Dimension(400,80));
+ jTable4.setRowHeight(20);
ffsAttributesTableModel.addColumn("Name");
ffsAttributesTableModel.addColumn("Value");
@@ -809,6 +811,7 @@ public class FpdBuildOptions extends IInternalFrame {
if (jTable5 == null) {
optionsTableModel = new DefaultTableModel();
jTable5 = new JTable(optionsTableModel);
+ jTable5.setRowHeight(20);
optionsTableModel.addColumn("BuildTargets");
optionsTableModel.addColumn("ToolChainFamily");
optionsTableModel.addColumn("SupportedArch");
@@ -1271,6 +1274,7 @@ public class FpdBuildOptions extends IInternalFrame {
sectionTableModel.addColumn("SectionType");
jTable1 = new JTable(sectionTableModel);
+ jTable1.setRowHeight(20);
JComboBox cb = new JComboBox();
cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
cb.addItem("EFI_SECTION_VERSION");
@@ -1333,6 +1337,7 @@ public class FpdBuildOptions extends IInternalFrame {
subsectionsTableModel = new DefaultTableModel();
subsectionsTableModel.addColumn("SectionType");
jTable3 = new JTable(subsectionsTableModel);
+ jTable3.setRowHeight(20);
JComboBox cb = new JComboBox();
cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
cb.addItem("EFI_SECTION_VERSION");
@@ -1572,7 +1577,7 @@ public class FpdBuildOptions extends IInternalFrame {
sectionsTableModel = new DefaultTableModel();
sectionsTableModel.addColumn("EncapsulationType");
jTable6 = new JTable(sectionsTableModel);
-
+ jTable6.setRowHeight(20);
jTable6.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable6.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
index 5c1393de58..58bdeb606d 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
@@ -183,7 +183,7 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
model.addColumn("MaxDatumSize");
model.addColumn("DatumType");
jTable = new JTable(model);
-
+ jTable.setRowHeight(20);
jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
index 21e0a5b25b..a8191aba5f 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
@@ -208,9 +208,27 @@ public class FpdFileContents {
ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();
while(li.hasNext()) {
ModuleSADocument.ModuleSA msa = (ModuleSADocument.ModuleSA)li.next();
- if (msa.getModuleGuid().equals(s[0]) && msa.getModuleVersion().equals(s[1])
- && msa.getPackageGuid().equals(s[2]) && msa.getPackageVersion().equals(s[3])) {
-
+ if (msa.getModuleGuid().equals(s[0]) && msa.getPackageGuid().equals(s[2])) {
+ if (msa.getModuleVersion() != null) {
+ if (!msa.getModuleVersion().equals(s[1])) {
+ continue;
+ }
+ }
+ else{
+ if (s[1] != null) {
+ continue;
+ }
+ }
+ if (msa.getPackageVersion() != null) {
+ if (!msa.getPackageVersion().equals(s[3])) {
+ continue;
+ }
+ }
+ else{
+ if (s[3] != null) {
+ continue;
+ }
+ }
return msa;
}
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
index 929e1647e0..2ab4d65d2b 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
@@ -134,6 +134,7 @@ public class FpdFrameworkModules extends IInternalFrame {
if (jTable == null) {
model = new NonEditableTableModel();
jTable = new JTable(model);
+ jTable.setRowHeight(20);
model.addColumn("ModuleName");
model.addColumn("ModuleGUID");
model.addColumn("ModuleVersion");
@@ -190,8 +191,11 @@ public class FpdFrameworkModules extends IInternalFrame {
fpdMsa.put(mg + mv + pg + pv, null);
String[] row = {" ", mg, mv, pg, pv};
- if (getModuleId(mg + " " + mv + " " + pg + " " + pv) != null) {
- row[0] = getModuleId(mg + " " + mv + " " + pg + " " + pv).getName();
+ ModuleIdentification mi = getModuleId(mg + " " + mv + " " + pg + " " + pv);
+ if (mi != null) {
+ row[0] = mi.getName();
+ row[2] = mi.getVersion();
+ row[4] = mi.getPackage().getVersion();
}
model1.addRow(row);
ffc.addFrameworkModulesPcdBuildDefs(miList.get(selectedRow), null);
@@ -241,6 +245,7 @@ public class FpdFrameworkModules extends IInternalFrame {
if (jTable1 == null) {
model1 = new NonEditableTableModel();
jTable1 = new JTable(model1);
+ jTable1.setRowHeight(20);
model1.addColumn("ModuleName");
model1.addColumn("ModuleGUID");
model1.addColumn("ModuleVersion");
@@ -273,10 +278,10 @@ public class FpdFrameworkModules extends IInternalFrame {
settingDlg = new FpdModuleSA(ffc);
}
- String mg = model1.getValueAt(selectedRow, 1).toString();
- String mv = model1.getValueAt(selectedRow, 2).toString();
- String pg = model1.getValueAt(selectedRow, 3).toString();
- String pv = model1.getValueAt(selectedRow, 4).toString();
+ String mg = model1.getValueAt(selectedRow, 1)+"";
+ String mv = model1.getValueAt(selectedRow, 2)+"";
+ String pg = model1.getValueAt(selectedRow, 3)+"";
+ String pv = model1.getValueAt(selectedRow, 4)+"";
settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv);
settingDlg.setVisible(true);
}
@@ -357,8 +362,11 @@ public class FpdFrameworkModules extends IInternalFrame {
String[][] saa = new String[ffc.getFrameworkModulesCount()][5];
ffc.getFrameworkModulesInfo(saa);
for (int i = 0; i < saa.length; ++i) {
- if (getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]) != null) {
- saa[i][0] = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]).getName();
+ ModuleIdentification mi = getModuleId(saa[i][1]+ " "+saa[i][2]+" "+saa[i][3]+" "+saa[i][4]);
+ if (mi != null) {
+ saa[i][0] = mi.getName();
+ saa[i][2] = mi.getVersion();
+ saa[i][4] = mi.getPackage().getVersion();
}
model1.addRow(saa[i]);
fpdMsa.put(saa[i][1]+saa[i][2]+saa[i][3]+saa[i][4], saa[i][0]);
@@ -417,14 +425,17 @@ public class FpdFrameworkModules extends IInternalFrame {
while(ispi.hasNext()) {
PackageIdentification pi = (PackageIdentification)ispi.next();
- if ( !pi.getGuid().equals(keyPart[2]) || !pi.getVersion().equals(keyPart[3])){
+ if ( !pi.getGuid().equals(keyPart[2])){
+// || !pi.getVersion().equals(keyPart[3])){
continue;
}
Set smi = GlobalData.getModules(pi);
Iterator ismi = smi.iterator();
while(ismi.hasNext()) {
ModuleIdentification mi = (ModuleIdentification)ismi.next();
- if (mi.getGuid().equals(keyPart[0]) && mi.getVersion().equals(keyPart[1])){
+ if (mi.getGuid().equals(keyPart[0])){
+// && mi.getVersion().equals(keyPart[1])){
+
return mi;
}
}
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
index d897959aea..3f50fb6862 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
@@ -674,6 +674,7 @@ public class FpdHeader extends IInternalFrame {
resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
+ resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jScrollPaneLicense, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);
resizeComponentWidth(this.jScrollPaneDescription, this.getWidth(), intPreferredWidth);
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
index 58c181dcd3..daca39c657 100644
--- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
+++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
@@ -1,6 +1,8 @@
package org.tianocore.frameworkwizard.platform.ui;
import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
@@ -398,6 +400,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
*/
private void initialize() {
this.setSize(664, 515);
+ this.centerWindow();
this.setModal(true);
this.setTitle("Module Settings");
this.setContentPane(getJContentPane());
@@ -499,6 +502,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (jTable == null) {
model = new PartialEditableTableModel();
jTable = new JTable(model);
+ jTable.setRowHeight(20);
model.addColumn("CName");
model.addColumn("TokenSpaceGUID");
model.addColumn("ItemType");
@@ -682,7 +686,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
model1.addColumn("PackageGUID");
model1.addColumn("PackageVersion");
jTable1 = new JTable(model1);
-
+ jTable1.setRowHeight(20);
jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
@@ -731,7 +735,8 @@ public class FpdModuleSA extends JDialog implements ActionListener {
model2 = new LibraryTableModel();
model2.addColumn("LibraryClass");
jTable2 = new JTable(model2);
-
+ jTable2.setRowHeight(20);
+ jTable2.setShowGrid(false);
jTable2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable2.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
@@ -803,7 +808,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
model3.addColumn("PackageGUID");
model3.addColumn("PackageVersion");
jTable3 = new JTable(model3);
-
+ jTable3.setRowHeight(20);
jTable3.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable3.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {
@@ -1099,6 +1104,15 @@ public class FpdModuleSA extends JDialog implements ActionListener {
optionsTableModel.addColumn("SupportedArchs");
optionsTableModel.addColumn("Contents");
jTable4 = new JTable(optionsTableModel);
+ jTable4.setRowHeight(20);
+ Vector vArch = new Vector();
+ vArch.add("IA32");
+ vArch.add("X64");
+ vArch.add("IPF");
+ vArch.add("EBC");
+ vArch.add("ARM");
+ vArch.add("PPC");
+ jTable4.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch));
jTable4.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
jTable4.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent arg0) {
@@ -1109,23 +1123,28 @@ public class FpdModuleSA extends JDialog implements ActionListener {
if (arg0.getType() == TableModelEvent.UPDATE){
//ToDo Data Validition check.
String targets = m.getValueAt(row, 0) + "";
- Vector
-
- For example:
-
-
- "/nologo", "/W3", "/WX"
- "/C", "/DSTRING_DEFINES_FILE=\"BdsStrDefs.h\""
-
-
- @param add the add flags set
- @param sub the sub flags set
- @return flags with original format
- **/
- private static String getRawFlags(Set add, Set sub) {
- String result = null;
- add.removeAll(sub);
- Iterator iter = add.iterator();
- while (iter.hasNext()) {
- String str = (String) iter.next();
- result += "\"" + str.substring(1, str.length() - 1) + "\", ";
- }
- return result;
- }
-
- private static String parseOptionString(String optionString, Set addSet, Set subSet) {
- boolean overrideOption = false;
- Pattern pattern = Pattern.compile("ADD\\.\\[(.+)\\]");
- Matcher matcher = pattern.matcher(optionString);
-
- while (matcher.find()) {
- overrideOption = true;
- String addOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();
- putFlagsToSet(addSet, addOption);
-
- }
-
- pattern = Pattern.compile("SUB\\.\\[(.+)\\]");
- matcher = pattern.matcher(optionString);
-
- while (matcher.find()) {
- overrideOption = true;
- String subOption = optionString.substring(matcher.start(1), matcher.end(1)).trim();
- putFlagsToSet(subSet, subOption);
- }
-
- if (overrideOption == true) {
- return null;
- }
-
- return optionString;
- }
-
- public static String getOption(Map options, String[] toolDefString) {
- Stack