From 7b53427e0e375aeb5146867c3022c712f637959b Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 16 Mar 2005 14:51:41 +0000 Subject: [PATCH] selection area search bugs fixed --- src/jalview/gui/Finder.java | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/jalview/gui/Finder.java b/src/jalview/gui/Finder.java index 8567451..7483a0a 100755 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@ -94,7 +94,7 @@ public class Finder extends GFinder String item=null; boolean found = false; - /// is the searchString a residue number? + ////// is the searchString a residue number? try{ int res = Integer.parseInt(searchString); found = true; @@ -109,6 +109,8 @@ public class Finder extends GFinder searchResults.add( Integer.toString( seq.findIndex(res)-1 ) ); }catch(NumberFormatException ex){} + /////////////////////////////////////////////// + jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(); Color [] newColors = new Color[24]; @@ -121,30 +123,27 @@ public class Finder extends GFinder int end = av.alignment.getHeight(); - - SequenceGroup rubberband = av.getSelectionGroup(); - if(rubberband!=null) - end = rubberband.getEndRes(); - - + SequenceGroup selection = av.getSelectionGroup(); + if(selection!=null) + if(selection.getSize()<1 || (selection.getEndRes()-selection.getStartRes()<2)) + selection = null; while( !found && seqIndex0 && !av.getSelectionGroup().sequences.contains(seq) - || (rubberband!=null && !rubberband.sequences.contains(seq)) ) + + if(selection!=null && !selection.sequences.contains(seq)) { - // if a selection has been made, only search within that selection seqIndex++; resIndex=0; continue; } - item = seq.getSequence(); + item = seq.getSequence().toUpperCase(); - if(rubberband!=null) - item = item.substring(0, rubberband.getEndRes()+1); + if(selection!=null && selection.getEndRes()