JAL-4386 - Implementation of retrieving secondary structure
[jalview.git] / src / jalview / gui / CalculationChooser.java
index 7747a6b..4e22a74 100644 (file)
@@ -594,6 +594,8 @@ public class CalculationChooser extends JPanel
     AlignmentAnnotation[] annotations = af.getViewport().getAlignment().getAlignmentAnnotation();
     
     List<String> ssSources = AlignmentUtils.getSecondaryStructureSources(annotations);
+    //List<String> ssSources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(annotations);
+    
                  
     return ssSources;
   }
@@ -605,10 +607,16 @@ public class CalculationChooser extends JPanel
   {
     boolean doPCA = pca.isSelected();
     String modelName = modelNames.getSelectedItem().toString();
-    String ssSource = ssSourceDropdown.getSelectedItem().toString();
+    String ssSource = "";
+    Object selectedItem = ssSourceDropdown.getSelectedItem();
+    if (selectedItem != null) {
+        ssSource = selectedItem.toString();
+    }
     SimilarityParams params = getSimilarityParameters(doPCA);
     if(ssSource.length()>0)
+    {
       params.setSecondaryStructureSource(ssSource);
+    }
     if (doPCA)
     {
       openPcaPanel(modelName, params);