JAL-2243 update discovered features on opening structure in Chimera
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 21 Mar 2017 09:44:08 +0000 (09:44 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 21 Mar 2017 09:44:08 +0000 (09:44 +0000)
src/jalview/gui/ChimeraViewFrame.java
src/jalview/structures/models/AAStructureBindingModel.java
test/jalview/structures/models/AAStructureBindingModelTest.java

index fe4a000..ec9feb7 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.api.FeatureRenderer;
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
@@ -613,6 +614,16 @@ public class ChimeraViewFrame extends StructureViewerBase
       jmb.setFinishedInit(true);
       jmb.setLoadingFromArchive(false);
 
+      /*
+       * ensure that any newly discovered features (e.g. RESNUM)
+       * are added to any open feature settings dialog
+       */
+      FeatureRenderer fr = getBinding().getFeatureRenderer(null);
+      if (fr != null)
+      {
+        fr.featuresAdded();
+      }
+
       // refresh the sequence colours for the new structure(s)
       for (AlignmentPanel ap : _colourwith)
       {
index 82ba2d7..84475fe 100644 (file)
@@ -770,6 +770,6 @@ public abstract class AAStructureBindingModel extends
     return fileLoadingError != null && fileLoadingError.length() > 0;
   }
 
-  protected abstract jalview.api.FeatureRenderer getFeatureRenderer(
+  public abstract jalview.api.FeatureRenderer getFeatureRenderer(
           AlignmentViewPanel alignment);
 }
index 30f9e68..7ba22b4 100644 (file)
@@ -212,7 +212,7 @@ public class AAStructureBindingModelTest
       }
 
       @Override
-      protected FeatureRenderer getFeatureRenderer(
+      public FeatureRenderer getFeatureRenderer(
               AlignmentViewPanel alignment)
       {
         return null;