JAL-2422 general pull-up/removal of common or unused fields and methods
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 8c2dc46..49561d7 100644 (file)
@@ -361,7 +361,11 @@ public abstract class AAStructureBindingModel
    */
   protected void releaseUIResources()
   {
+  }
 
+  @Override
+  public void releaseReferences(Object svl)
+  {
   }
 
   public boolean isColourBySequence()
@@ -369,6 +373,25 @@ public abstract class AAStructureBindingModel
     return colourBySequence;
   }
 
+  /**
+   * Called when the binding thinks the UI needs to be refreshed after a
+   * structure viewer state change. This could be because structures were
+   * loaded, or because an error has occurred. Default does nothing, override as
+   * required.
+   */
+  public void refreshGUI()
+  {
+  }
+
+  /**
+   * Instruct the Jalview binding to update the pdbentries vector if necessary
+   * prior to matching the jmol view's contents to the list of structure files
+   * Jalview knows about. By default does nothing, override as required.
+   */
+  public void refreshPdbEntries()
+  {
+  }
+
   public void setColourBySequence(boolean colourBySequence)
   {
     this.colourBySequence = colourBySequence;
@@ -1108,4 +1131,19 @@ public abstract class AAStructureBindingModel
   {
     return chainFile.get(chainId);
   }
+
+  @Override
+  public void updateColours(Object source)
+  {
+    AlignmentViewPanel ap = (AlignmentViewPanel) source;
+    // ignore events from panels not used to colour this view
+    if (!getViewer().isUsedForColourBy(ap))
+    {
+      return;
+    }
+    if (!isLoadingFromArchive())
+    {
+      colourBySequence(ap);
+    }
+  }
 }