fixed deadlock
authorjprocter <Jim Procter>
Mon, 30 Apr 2007 15:35:17 +0000 (15:35 +0000)
committerjprocter <Jim Procter>
Mon, 30 Apr 2007 15:35:17 +0000 (15:35 +0000)
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java

index 0d701ac..a1de62e 100755 (executable)
@@ -397,13 +397,16 @@ public class FeatureRenderer
    * them. Then fires a PropertyChangeEvent on the changeSupport object.
    *
    */
-  synchronized void findAllFeatures()
+  void findAllFeatures()
   {
-    findAllFeatures(true); // add all new features as visible
-    if (!firing) {
-      firing=true;
-      changeSupport.firePropertyChange("changeSupport",null,null);
-      firing=false;
+    synchronized (firing)
+    {
+        if (firing.equals(Boolean.FALSE)) {
+          firing=Boolean.TRUE;
+          findAllFeatures(true); // add all new features as visible
+          changeSupport.firePropertyChange("changeSupport",null,null);
+          firing=Boolean.FALSE;
+      }
     }
   }
   /**
@@ -494,7 +497,7 @@ public class FeatureRenderer
     updateRenderOrder(allfeatures);
     findingFeatures = false;
   }
-  protected boolean firing=false;
+  protected Boolean firing=Boolean.FALSE;
   /**
    * replaces the current renderOrder with the unordered features in allfeatures.
    * The ordering of any types in both renderOrder and allfeatures is preserved,
index 96e82c1..2d47b60 100755 (executable)
@@ -277,8 +277,12 @@ public class FeatureSettings
       return false;
   }
   boolean resettingTable=false;
-  void resetTable(String[] groupChanged)
+  synchronized void resetTable(String[] groupChanged)
   {
+    if (resettingTable==true)
+    {
+      return;
+    }
     resettingTable=true;
     typeWidth=new Hashtable();
     // TODO: change avWidth calculation to 'per-sequence' average and use long rather than float
@@ -800,6 +804,17 @@ public class FeatureSettings
     fetchDAS.setEnabled(true);
     cancelDAS.setEnabled(false);
   }
+  public void noDasSourceActive()
+  {
+    JOptionPane.showInternalConfirmDialog(Desktop.desktop,
+            "No das sources were selected.\n"
+            + "Please select some sources and\n"
+            +" try again.",
+            "No Sources Selected",
+            JOptionPane.DEFAULT_OPTION,
+            JOptionPane.INFORMATION_MESSAGE);
+    complete();
+  }
 
   /////////////////////////////////////////////////////////////////////////
   // http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
@@ -914,6 +929,7 @@ public class FeatureSettings
       return this;
     }
   }
+
 }
 
 class ColorEditor