From: jprocter Date: Tue, 25 Sep 2012 14:21:04 +0000 (+0100) Subject: JAL-1031 JAL-1032 if selection is non-null but empty, then calculate PCA or tree... X-Git-Tag: Jalview_2_9~290 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=af4a464ed5537d777ec821929704e9169d8fba9e;p=jalview.git JAL-1031 JAL-1032 if selection is non-null but empty, then calculate PCA or tree over whole view --- diff --git a/src/jalview/appletgui/PCAPanel.java b/src/jalview/appletgui/PCAPanel.java index 44711d7..ff8b506 100755 --- a/src/jalview/appletgui/PCAPanel.java +++ b/src/jalview/appletgui/PCAPanel.java @@ -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(); } diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index aa57908..ec2512f 100644 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -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(); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 8396e6a..39884ce 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -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) { diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index ad7d1fd..bafacc5 100755 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -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(); } diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index 14802e7..60557ca 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -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();