Merge branch 'feature/JAL-3551Pymol' into develop
[jalview.git] / src / jalview / structures / models / AAStructureBindingModel.java
index 870a761..5949847 100644 (file)
@@ -1245,6 +1245,10 @@ public abstract class AAStructureBindingModel
   {
     AlignmentViewPanel ap = (avp == null) ? getViewer().getAlignmentPanel()
             : avp;
+    if (ap == null)
+    {
+      return null;
+    }
     return ap.getAlignViewport().isShowSequenceFeatures()
             ? ap.getFeatureRenderer()
             : null;
@@ -1851,4 +1855,17 @@ public abstract class AAStructureBindingModel
       }
     }
   }
+
+  /**
+   * Returns the number of structure files in the structure viewer and mapped to
+   * Jalview. This may be zero if the files are still in the process of loading
+   * in the viewer.
+   * 
+   * @return
+   */
+  public int getMappedStructureCount()
+  {
+    String[] files = getStructureFiles();
+    return files == null ? 0 : files.length;
+  }
 }