JAL-3949 - refactor logging from jalview.bin.Cache to jalview.bin.Console
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 5a7b448..3414e95 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.structures.models;
 
+import java.util.Locale;
+
 import java.awt.Color;
 import java.io.File;
 import java.io.IOException;
@@ -39,7 +41,7 @@ import jalview.api.FeatureRenderer;
 import jalview.api.SequenceRenderer;
 import jalview.api.StructureSelectionManagerProvider;
 import jalview.api.structures.JalviewStructureDisplayI;
-import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.MappedFeatures;
@@ -67,7 +69,7 @@ import jalview.util.MessageManager;
 
 /**
  * 
- * A base class to hold common function for protein structure model binding.
+ * A base class to hold common function for 3D structure model binding.
  * Initial version created by refactoring JMol and Chimera binding models, but
  * other structure viewers could in principle be accommodated in future.
  * 
@@ -582,6 +584,7 @@ public abstract class AAStructureBindingModel
       }
     }
   }
+  
 
   @Override
   public abstract void highlightAtoms(List<AtomSpec> atoms);
@@ -930,7 +933,7 @@ public abstract class AAStructureBindingModel
           for (String reply : replies)
           {
             // return this error (Chimera only) to the user
-            if (reply.toLowerCase().contains("unequal numbers of atoms"))
+            if (reply.toLowerCase(Locale.ROOT).contains("unequal numbers of atoms"))
             {
               error += "; " + reply;
             }
@@ -1072,7 +1075,10 @@ public abstract class AAStructureBindingModel
    * executed.
    * <p>
    * If a reply is wanted, the execution is done synchronously (waits),
-   * otherwise it is done in a separate thread (doesn't wait).
+   * otherwise it is done in a separate thread (doesn't wait). WARNING: if you
+   * are sending commands that need to execute before later calls to
+   * executeCommand (e.g. mouseovers, which clean up after previous ones) then
+   * set getReply true to ensure that commands are not executed out of order.
    * 
    * @param getReply
    * @param msg
@@ -1491,7 +1497,7 @@ public abstract class AAStructureBindingModel
       saveSession(f);
     } catch (IOException e)
     {
-      Cache.log.error(String.format("Error saving %s session: %s", prefix,
+      Console.error(String.format("Error saving %s session: %s", prefix,
               e.toString()));
     }