From b169b1a49c078d123feb729db6acb9779f50e7d6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 15 Aug 2006 10:34:11 +0000 Subject: [PATCH] Select revealed seqs --- src/jalview/appletgui/AlignViewport.java | 33 ++++++++++++++++++++++++---- src/jalview/datamodel/HiddenSequences.java | 17 +++++++++++--- src/jalview/gui/AlignViewport.java | 29 ++++++++++++++++++++++-- 3 files changed, 70 insertions(+), 9 deletions(-) diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 99d0794..7c46cd9 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -775,9 +775,23 @@ public class AlignViewport public void showSequence(int index) { - alignment.getHiddenSequences().showSequence(index); + Vector tmp = alignment.getHiddenSequences().showSequence(index); + if (tmp.size() > 0) + { + if (selectionGroup == null) + { + selectionGroup = new SequenceGroup(); + selectionGroup.setEndRes(alignment.getWidth() - 1); + } - if(alignment.getHiddenSequences().getSize()<1) + for (int t = 0; t < tmp.size(); t++) + { + selectionGroup.addSequence( + (SequenceI) tmp.elementAt(t), false + ); + } + } + if (alignment.getHiddenSequences().getSize() < 1) hasHiddenRows = false; } @@ -798,9 +812,20 @@ public class AlignViewport { if(alignment.getHiddenSequences().getSize()>0) { - alignment.getHiddenSequences().showAll(); + if(selectionGroup==null) + { + selectionGroup = new SequenceGroup(); + selectionGroup.setEndRes(alignment.getWidth()-1); + } + Vector tmp = alignment.getHiddenSequences().showAll(); + for(int t=0; t0) + { + if(selectionGroup==null) + { + selectionGroup = new SequenceGroup(); + selectionGroup.setEndRes(alignment.getWidth()-1); + } + for (int t = 0; t < tmp.size(); t++) + { + selectionGroup.addSequence( + (SequenceI) tmp.elementAt(t), false + ); + } + } if(alignment.getHiddenSequences().getSize()<1) hasHiddenRows = false; } @@ -1156,7 +1170,18 @@ public class AlignViewport { if(alignment.getHiddenSequences().getSize()>0) { - alignment.getHiddenSequences().showAll(); + if(selectionGroup==null) + { + selectionGroup = new SequenceGroup(); + selectionGroup.setEndRes(alignment.getWidth()-1); + } + Vector tmp = alignment.getHiddenSequences().showAll(); + for(int t=0; t