validCharWidth moved to viewport
[jalview.git] / src / jalview / gui / AlignViewport.java
index 3509217..d4ba5ea 100755 (executable)
@@ -61,6 +61,7 @@ public class AlignViewport
     SequenceGroup selectionGroup;\r
     int charHeight;\r
     int charWidth;\r
+    boolean validCharWidth;\r
     int wrappedWidth;\r
     Font font;\r
     AlignmentI alignment;\r
@@ -317,12 +318,19 @@ public class AlignViewport
       }\r
       catch (OutOfMemoryError error)\r
       {\r
-        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-            "Out of memory calculating conservation!!"\r
-            +\r
-            "\nSee help files for increasing Java Virtual Machine memory."\r
-            , "Out of memory",\r
-            javax.swing.JOptionPane.WARNING_MESSAGE);\r
+        javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+        {\r
+          public void run()\r
+          {\r
+            javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                "Out of memory calculating conservation!!"\r
+                +\r
+                "\nSee help files for increasing Java Virtual Machine memory."\r
+                , "Out of memory",\r
+                javax.swing.JOptionPane.WARNING_MESSAGE);\r
+          }\r
+        });\r
+\r
         System.out.println("Conservation calculation: " + error);\r
         System.gc();\r
 \r
@@ -402,12 +410,20 @@ public class AlignViewport
 \r
       }catch(OutOfMemoryError error)\r
       {\r
-        javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-            "Out of memory calculating consensus!!"\r
-            +\r
-            "\nSee help files for increasing Java Virtual Machine memory."\r
-            , "Out of memory",\r
-            javax.swing.JOptionPane.WARNING_MESSAGE);\r
+        javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+        {\r
+          public void run()\r
+          {\r
+            javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                "Out of memory calc45ulating consensus!!"\r
+                +\r
+                "\nSee help files for increasing Java Virtual Machine memory."\r
+                , "Out of memory",\r
+                javax.swing.JOptionPane.WARNING_MESSAGE);\r
+          }\r
+        });\r
+\r
+\r
         System.out.println("Consensus calculation: " + error);\r
         System.gc();\r
       }\r
@@ -609,6 +625,7 @@ public class AlignViewport
         java.awt.FontMetrics fm = c.getFontMetrics(font);\r
         setCharHeight(fm.getHeight());\r
         setCharWidth(fm.charWidth('M'));\r
+        validCharWidth = true;\r
     }\r
 \r
     /**\r