Fix the problem of label, button text part-display on Linux and iMac.
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Oct 2006 08:46:53 +0000 (08:46 +0000)
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Oct 2006 08:46:53 +0000 (08:46 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1829 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java

index 8aaad5db45e1a43e1b7807f24bc4d862daf722de..2357df2b09af997f4694deca97d22a4744ba8fb3 100644 (file)
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.frameworkwizard.packaging.ui;\r
 \r
 import java.awt.Dimension;\r
+import java.awt.FontMetrics;\r
 import java.awt.Point;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ComponentEvent;\r
@@ -163,7 +164,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     protected JTextField getJTextFieldGuid() {\r
         if (jTextFieldGuid == null) {\r
             jTextFieldGuid = new JTextField();\r
-            jTextFieldGuid.setBounds(new java.awt.Rectangle(137,60,435,20));\r
+            jTextFieldGuid.setBounds(new java.awt.Rectangle(137,60,336,20));\r
             jTextFieldGuid.setPreferredSize(new java.awt.Dimension(200,20));\r
             \r
         }\r
@@ -490,16 +491,20 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
             jLabelGuidType.setText("GUID Type List");\r
             jLabelGuidType.setEnabled(true);\r
             starLabel = new StarLabel();\r
-            starLabel.setLocation(new Point(jLabelGuidType.getX() - 20, jLabelGuidType.getY()));\r
+            starLabel.setLocation(new Point(jLabelGuidType.getX() - 10, jLabelGuidType.getY()));\r
             starLabel.setVisible(true);\r
             jLabelSupArch = new JLabel();\r
             jLabelSupArch.setBounds(new java.awt.Rectangle(197,122,108,16));\r
-            jLabelSupArch.setText("Supported Arch");\r
+            jLabelSupArch.setText("Supported Architectures");\r
             jLabelSupArch.setEnabled(true);\r
+            FontMetrics fm = jLabelSupArch.getFontMetrics(jLabelSupArch.getFont());\r
+            jLabelSupArch.setSize(fm.stringWidth(jLabelSupArch.getText()) + 10, 20);\r
             jLabelSupMod = new JLabel();\r
             jLabelSupMod.setBounds(new java.awt.Rectangle(14,120,110,16));\r
-            jLabelSupMod.setText("Supported Module");\r
+            jLabelSupMod.setText("Supported Module Types");\r
             jLabelSupMod.setEnabled(true);\r
+            fm = jLabelSupMod.getFontMetrics(jLabelSupMod.getFont());\r
+            jLabelSupMod.setSize(fm.stringWidth(jLabelSupMod.getText()) + 10, 20);\r
             jLabelHelp = new JLabel();\r
             jLabelHelp.setText("HelpText");\r
             jLabelHelp.setSize(new java.awt.Dimension(109,20));\r
@@ -716,7 +721,7 @@ public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
     protected JButton getJButtonGen() {\r
         if (jButtonGen == null) {\r
             jButtonGen = new JButton();\r
-            jButtonGen.setBounds(new java.awt.Rectangle(379,58,92,21));\r
+            jButtonGen.setBounds(new java.awt.Rectangle(485,58,92,21));\r
             jButtonGen.setText("Gen GUID");\r
             jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));\r
             jButtonGen.addActionListener(this);\r
index a69a95887155123a1bec0dce611cd55082091e7b..a0882d2e772ef293a92f2ab540e925518c0a0b5b 100644 (file)
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.frameworkwizard.packaging.ui;\r
 \r
 import java.awt.Dimension;\r
+import java.awt.FontMetrics;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ComponentEvent;\r
 import java.io.File;\r
@@ -423,8 +424,9 @@ public class SpdLibClassDecls extends IInternalFrame implements TableModelListen
         if (jButtonRemoveAll == null) {\r
             jButtonRemoveAll = new JButton();\r
             jButtonRemoveAll.setText("Remove All");\r
-            jButtonRemoveAll.setSize(new java.awt.Dimension(buttonWidth,20));\r
-            jButtonRemoveAll.setBounds(new java.awt.Rectangle(removeAllButtonCol,rowSeven,buttonWidth,20));\r
+            jButtonRemoveAll.setLocation(removeAllButtonCol,rowSeven);\r
+            FontMetrics fm = jButtonRemoveAll.getFontMetrics(jButtonRemoveAll.getFont());\r
+            jButtonRemoveAll.setSize(fm.stringWidth(jButtonRemoveAll.getText()) + 50, 20);\r
             jButtonRemoveAll.addActionListener(this);\r
         }\r
         return jButtonRemoveAll;\r
index dade7ca3dc82fce567c301f8db1b7cf3852b58d5..7abf5c0f2e65721c2a296ec1d198d1f55b9d828e 100644 (file)
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 package org.tianocore.frameworkwizard.packaging.ui;\r
 \r
 import java.awt.Dimension;\r
+import java.awt.FontMetrics;\r
 import java.awt.event.ActionEvent;\r
 import java.awt.event.ComponentEvent;\r
 \r
@@ -171,6 +172,15 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
         this.setTitle("PCD Declarations");\r
         this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\r
 \r
+        int xPos = jCheckBoxPatchInMod.getX() + jCheckBoxPatchInMod.getWidth();\r
+        jCheckBoxFixedAtBuild.setLocation(xPos,133);\r
+        \r
+        xPos = jCheckBoxFeatureFlag.getX() + jCheckBoxFeatureFlag.getWidth();\r
+        jCheckBoxDyn.setLocation(xPos,161);\r
+        \r
+        xPos = jCheckBoxDyn.getX() + jCheckBoxDyn.getWidth();\r
+        jCheckBoxDynEx.setLocation(xPos,161);\r
+        \r
     }\r
 \r
     /**\r
@@ -355,17 +365,23 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jLabelSupArch.setBounds(new java.awt.Rectangle(241,192,89,16));\r
             jLabelSupArch.setText("Supported Architectures");\r
             jLabelSupArch.setEnabled(true);\r
+            FontMetrics fm = jLabelSupArch.getFontMetrics(jLabelSupArch.getFont());\r
+            jLabelSupArch.setSize(fm.stringWidth(jLabelSupArch.getText()) + 10, 20);\r
             jLabelSupMod = new JLabel();\r
             jLabelSupMod.setBounds(new java.awt.Rectangle(15,193,103,16));\r
-            jLabelSupMod.setText("Supported Module type");\r
+            jLabelSupMod.setText("Supported Module types");\r
             jLabelSupMod.setEnabled(true);\r
+            fm = jLabelSupMod.getFontMetrics(jLabelSupMod.getFont());\r
+            jLabelSupMod.setSize(fm.stringWidth(jLabelSupMod.getText()) + 10, 20);\r
             starLabel = new StarLabel();\r
             starLabel.setBounds(new java.awt.Rectangle(2,134,10,20));\r
             jLabelDefVal = new JLabel();\r
             jLabelDefVal.setBounds(new java.awt.Rectangle(277,84,80,20));\r
             jLabelDefVal.setText("Default Value");\r
+            fm = jLabelDefVal.getFontMetrics(jLabelDefVal.getFont());\r
+            jLabelDefVal.setSize(fm.stringWidth(jLabelDefVal.getText()) + 10, 20);\r
             jLabelVarVal = new JLabel();\r
-            jLabelVarVal.setBounds(new java.awt.Rectangle(11,133,84,20));\r
+            jLabelVarVal.setBounds(new java.awt.Rectangle(11,133,100,20));\r
             jLabelVarVal.setText("Valid Usage");\r
             jLabelC_Name = new JLabel();\r
             jLabelC_Name.setText("C Name");\r
@@ -575,7 +591,8 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     private JTextField getJTextFieldDefaultValue() {\r
         if (jTextFieldDefaultValue == null) {\r
             jTextFieldDefaultValue = new JTextField();\r
-            jTextFieldDefaultValue.setBounds(new java.awt.Rectangle(368,84,105,20));\r
+            int xPos = jLabelDefVal.getX() + jLabelDefVal.getWidth();\r
+            jTextFieldDefaultValue.setBounds(new java.awt.Rectangle(xPos,84,105,20));\r
             jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(104,20));\r
         }\r
         return jTextFieldDefaultValue;\r
@@ -871,7 +888,8 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
             jCheckBoxFeatureFlag = new JCheckBox();\r
             jCheckBoxFeatureFlag.setBounds(new java.awt.Rectangle(156,161,100,21));\r
             jCheckBoxFeatureFlag.setText("Feature Flag");\r
-            jCheckBoxFeatureFlag.setPreferredSize(new java.awt.Dimension(21,20));\r
+            FontMetrics fm = jCheckBoxFeatureFlag.getFontMetrics(jCheckBoxFeatureFlag.getFont());\r
+            jCheckBoxFeatureFlag.setSize(fm.stringWidth(jCheckBoxFeatureFlag.getText()) + 30, 20);\r
             jCheckBoxFeatureFlag.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r
                     if (jCheckBoxFeatureFlag.isSelected()) {\r
@@ -894,9 +912,10 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     private JCheckBox getJCheckBoxFixedAtBuild() {\r
         if (jCheckBoxFixedAtBuild == null) {\r
             jCheckBoxFixedAtBuild = new JCheckBox();\r
-            jCheckBoxFixedAtBuild.setBounds(new java.awt.Rectangle(312,133,108,20));\r
+            \r
             jCheckBoxFixedAtBuild.setText("Fixed at Build");\r
-            jCheckBoxFixedAtBuild.setPreferredSize(new java.awt.Dimension(21,20));\r
+            FontMetrics fm = jCheckBoxFixedAtBuild.getFontMetrics(jCheckBoxFixedAtBuild.getFont());\r
+            jCheckBoxFixedAtBuild.setSize(fm.stringWidth(jCheckBoxFixedAtBuild.getText()) + 30, 20);\r
             jCheckBoxFixedAtBuild.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r
                     if (jCheckBoxFixedAtBuild.isSelected()) {\r
@@ -916,9 +935,11 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     private JCheckBox getJCheckBoxPatchInMod() {\r
         if (jCheckBoxPatchInMod == null) {\r
             jCheckBoxPatchInMod = new JCheckBox();\r
+            \r
             jCheckBoxPatchInMod.setBounds(new java.awt.Rectangle(156,133,154,20));\r
             jCheckBoxPatchInMod.setText("Patchable in Module");\r
-            jCheckBoxPatchInMod.setPreferredSize(new java.awt.Dimension(21,20));\r
+            FontMetrics fm = jCheckBoxPatchInMod.getFontMetrics(jCheckBoxPatchInMod.getFont());\r
+            jCheckBoxPatchInMod.setSize(fm.stringWidth(jCheckBoxPatchInMod.getText()) + 30, 20);\r
             jCheckBoxPatchInMod.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r
                     if (jCheckBoxPatchInMod.isSelected()) {\r
@@ -938,9 +959,10 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     private JCheckBox getJCheckBoxDyn() {\r
         if (jCheckBoxDyn == null) {\r
             jCheckBoxDyn = new JCheckBox();\r
-            jCheckBoxDyn.setBounds(new java.awt.Rectangle(278,161,80,20));\r
+            \r
             jCheckBoxDyn.setText("Dynamic");\r
-            jCheckBoxDyn.setPreferredSize(new java.awt.Dimension(21,20));\r
+            FontMetrics fm = jCheckBoxDyn.getFontMetrics(jCheckBoxDyn.getFont());\r
+            jCheckBoxDyn.setSize(fm.stringWidth(jCheckBoxDyn.getText()) + 30, 20);\r
             jCheckBoxDyn.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r
                     if (jCheckBoxDyn.isSelected()) {\r
@@ -960,9 +982,10 @@ public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
     private JCheckBox getJCheckBoxDynEx() {\r
         if (jCheckBoxDynEx == null) {\r
             jCheckBoxDynEx = new JCheckBox();\r
-            jCheckBoxDynEx.setBounds(new java.awt.Rectangle(371,161,99,20));\r
+            \r
             jCheckBoxDynEx.setText("DynamicEx");\r
-            jCheckBoxDynEx.setPreferredSize(new java.awt.Dimension(21,20));\r
+            FontMetrics fm = jCheckBoxDynEx.getFontMetrics(jCheckBoxDynEx.getFont());\r
+            jCheckBoxDynEx.setSize(fm.stringWidth(jCheckBoxDynEx.getText()) + 30, 20);\r
             jCheckBoxDynEx.addItemListener(new java.awt.event.ItemListener() {\r
                 public void itemStateChanged(java.awt.event.ItemEvent e) {\r
                     if (jCheckBoxDynEx.isSelected()) {\r
index 2dd39b459cd874dfcf37682fef373b66a4e7e5f2..04fc791c48228d585da448d98a7268a7c7371fca 100644 (file)
@@ -1,6 +1,8 @@
 package org.tianocore.frameworkwizard.platform.ui;\r
 \r
 import java.awt.BorderLayout;\r
+import java.awt.Dimension;\r
+import java.awt.FontMetrics;\r
 \r
 import javax.swing.ButtonGroup;\r
 import javax.swing.JOptionPane;\r
@@ -487,7 +489,9 @@ public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
         if (jButtonSkuInfoUpdate == null) {\r
             jButtonSkuInfoUpdate = new JButton();\r
             jButtonSkuInfoUpdate.setPreferredSize(new java.awt.Dimension(180,20));\r
-            jButtonSkuInfoUpdate.setText(" Update SKU Information");\r
+            jButtonSkuInfoUpdate.setText("Update SKU Value");\r
+            FontMetrics fm = jButtonSkuInfoUpdate.getFontMetrics(jButtonSkuInfoUpdate.getFont());\r
+            jButtonSkuInfoUpdate.setPreferredSize(new Dimension (fm.stringWidth(jButtonSkuInfoUpdate.getText()) + 40, 20));\r
             jButtonSkuInfoUpdate.addActionListener(new java.awt.event.ActionListener() {\r
                 public void actionPerformed(java.awt.event.ActionEvent e) {\r
                     int pcdSelected = jTableDynPcd.getSelectedRow();\r
index 2d1142301caaa7f6df4fd184a2a4374650b5f303..78ea7d641a7bf48edad8ee1d0a6369af5fd116ca 100644 (file)
@@ -15,6 +15,8 @@
 package org.tianocore.frameworkwizard.platform.ui;\r
 \r
 import java.awt.BorderLayout;\r
+import java.awt.Dimension;\r
+import java.awt.FontMetrics;\r
 \r
 import javax.swing.JFrame;\r
 import javax.swing.JOptionPane;\r
@@ -719,8 +721,9 @@ public class FpdFrameworkModules extends IInternalFrame {
     private JButton getJButtonRemoveModule() {\r
         if (jButtonRemoveModule == null) {\r
             jButtonRemoveModule = new JButton();\r
-            jButtonRemoveModule.setPreferredSize(new java.awt.Dimension(130, 20));\r
             jButtonRemoveModule.setText("Remove Module");\r
+            FontMetrics fm = jButtonRemoveModule.getFontMetrics(jButtonRemoveModule.getFont());\r
+            jButtonRemoveModule.setPreferredSize(new Dimension (fm.stringWidth(jButtonRemoveModule.getText()) + 40, 20));\r
             jButtonRemoveModule.addActionListener(new java.awt.event.ActionListener() {\r
                 public void actionPerformed(java.awt.event.ActionEvent e) {\r
                     int selectedRow = jTableFpdModules.getSelectedRow();\r
index 18cb1603b9c50627297604f5ecb599d3de5ecfac..917585908ca0192258ed9dd374d66d2a4ba3bd06 100644 (file)
@@ -199,7 +199,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
             //\r
             resolveLibraryInstances(moduleKey);\r
         } catch (Exception e) {\r
-            JOptionPane.showMessageDialog(frame, e.getMessage());\r
+            JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());\r
         }\r
         //\r
         // display lib instances already selected for key\r
@@ -225,7 +225,7 @@ public class FpdModuleSA extends JDialog implements ActionListener {
                     try {\r
                         resolveLibraryInstances(saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4]);\r
                     } catch (Exception e) {\r
-                        JOptionPane.showMessageDialog(frame, e.getMessage());\r
+                        JOptionPane.showMessageDialog(frame, e.getCause() + " " + e.getMessage());\r
                     }\r
                     selectedInstancesTableModel.addRow(saa[i]);\r
                 }\r
@@ -1905,7 +1905,7 @@ class MultipleInstanceException extends Exception {
     @Override\r
     public String getMessage() {\r
         // TODO Auto-generated method stub\r
-        return "Library Class " + className + "is Produced by Two Instances: " \r
+        return " Library Class " + className + "is Produced by Two Instances: " \r
             + libInstance1 + " and " + libInstance2 + ". Platform Build will Fail.";\r
     }\r
     \r