JAL-1031 JAL-1032 if selection is non-null but empty, then calculate PCA or tree...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 14:21:04 +0000 (15:21 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 25 Sep 2012 14:21:04 +0000 (15:21 +0100)
src/jalview/appletgui/PCAPanel.java
src/jalview/appletgui/TreePanel.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/PCAPanel.java
src/jalview/gui/TreePanel.java

index 44711d7..ff8b506 100755 (executable)
@@ -55,11 +55,12 @@ public class PCAPanel extends EmbmenuFrame implements Runnable,
     }
 
     this.av = av;
+    boolean selected=av.getSelectionGroup()!=null && av.getSelectionGroup().getSize()>0;
     AlignmentView seqstrings = av
-            .getAlignmentView(av.getSelectionGroup() != null);
+            .getAlignmentView(selected);
     boolean nucleotide = av.getAlignment().isNucleotide();
     SequenceI[] seqs;
-    if (av.getSelectionGroup() == null)
+    if (!selected)
     {
       seqs = av.getAlignment().getSequencesArray();
     }
index aa57908..ec2512f 100644 (file)
@@ -199,9 +199,11 @@ public class TreePanel extends EmbmenuFrame implements ActionListener,
       {
         int start, end;
         SequenceI[] seqs;
-        AlignmentView seqStrings = av.getAlignmentView(av
-                .getSelectionGroup() != null);
-        if (av.getSelectionGroup() == null)
+        boolean selview=(av
+                .getSelectionGroup() != null) && (av
+                .getSelectionGroup().getSize()>1);
+        AlignmentView seqStrings = av.getAlignmentView(selview);
+        if (!selview)
         {
           start = 0;
           end = av.getAlignment().getWidth();
index 8396e6a..39884ce 100755 (executable)
@@ -3668,7 +3668,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     TreePanel tp;
 
-    if (viewport.getSelectionGroup() != null)
+    if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup().getSize()>0)
     {
       if (viewport.getSelectionGroup().getSize() < 3)
       {
index ad7d1fd..bafacc5 100755 (executable)
@@ -63,12 +63,12 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     this.ap = ap;
 
     boolean sameLength = true;
-
+    boolean selected=av.getSelectionGroup()!=null && av.getSelectionGroup().getSize()>0;
     AlignmentView seqstrings = av
-            .getAlignmentView(av.getSelectionGroup() != null);
+            .getAlignmentView(selected);
     boolean nucleotide = av.getAlignment().isNucleotide();
     SequenceI[] seqs;
-    if (av.getSelectionGroup() == null)
+    if (!selected)
     {
       seqs = av.getAlignment().getSequencesArray();
     }
index 14802e7..60557ca 100755 (executable)
@@ -273,9 +273,11 @@ public class TreePanel extends GTreePanel
       {
         int start, end;
         SequenceI[] seqs;
-        AlignmentView seqStrings = av.getAlignmentView(av
-                .getSelectionGroup() != null);
-        if (av.getSelectionGroup() == null)
+        boolean selview=av
+                .getSelectionGroup() != null & av
+                .getSelectionGroup().getSize()>1;
+        AlignmentView seqStrings = av.getAlignmentView(selview);
+        if (!selview)
         {
           start = 0;
           end = av.getAlignment().getWidth();