From: jprocter Date: Wed, 27 Sep 2006 14:35:43 +0000 (+0000) Subject: fixed tree building exception when one residue or a single column of residues is... X-Git-Tag: Release_2_2~335 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f4fd7b0e74572c8fddbfe9e3e55bc624f8ba0c6a;p=jalview.git fixed tree building exception when one residue or a single column of residues is selected. --- diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 0fd974b..87753f4 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -940,9 +940,9 @@ public class AlignViewport } // Final match if necessary. if (last 3)) - { + if (viewport.getSelectionGroup() != null) { + if (viewport.getSelectionGroup().getSize(false) < 3) { + JOptionPane.showMessageDialog(Desktop.desktop, + "You need to have more than two sequences selected to build a tree!", + "Not enough sequences", + JOptionPane.WARNING_MESSAGE); + return; + } + int s = 0; SequenceGroup sg = viewport.getSelectionGroup(); diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 30113c3..05a52dd 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -1334,9 +1334,9 @@ public class AlignViewport } // Final match if necessary. if (last