X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFinder.java;h=2311a9f532f1a4220fec634e46fe41ae97973979;hb=ecb5ebdc2d8d549eeb63214bff868a8968fde50d;hp=c2cf25bbe221f1622f2a316f9a2682dfca51eb65;hpb=e79b8060ca9b0806e621774859a6cf2c77867fc8;p=jalview.git diff --git a/src/jalview/gui/Finder.java b/src/jalview/gui/Finder.java index c2cf25b..2311a9f 100755 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@ -6,7 +6,7 @@ import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.util.*; -import java.util.regex.*; +import java.awt.*; public class Finder extends GFinder { @@ -14,6 +14,7 @@ public class Finder extends GFinder AlignmentPanel ap; JInternalFrame frame; String searchString; + SuperGroup searchGroup; int seqIndex = 0; int resIndex = 0; @@ -32,11 +33,14 @@ public class Finder extends GFinder SwingUtilities.invokeLater(new Runnable() { public void run() - { - textfield.requestFocus(); - } + { textfield.requestFocus(); } }); - } + } + + public void internalFrameClosing(InternalFrameEvent evt) + { + cancel_actionPerformed(null); + } }); } @@ -63,20 +67,31 @@ public class Finder extends GFinder try{ // if allResults is null, this effectively switches displaySearch flag in seqCanvas ap.highlightSearchResults( null ); - frame.setClosed(true); + // frame.setClosed(true); }catch(Exception ex){ } + } + + + public void createNewGroup_actionPerformed(ActionEvent e) + { + for(int i=0; i0 && !av.getSelection().contains(seq)) + + if( av.getSelection().size()>0 && !av.getSelection().contains(seq) + || (rubberband!=null && !rubberband.sequences.contains(seq)) ) { // if a selection has been made, only search within that selection seqIndex++; @@ -111,6 +143,9 @@ public class Finder extends GFinder item = seq.getSequence(); + if(rubberband!=null) + item = item.substring(0, rubberband.getEndRes()+1); + ///Shall we ignore gaps???? StringBuffer noGaps = new StringBuffer(); int insertCount=0; @@ -129,19 +164,30 @@ public class Finder extends GFinder } - Pattern pattern = Pattern.compile(searchString); - Matcher matcher = pattern.matcher(noGaps); + com.stevesoft.pat.Regex regex = new com.stevesoft.pat.Regex(searchString); for(int r = resIndex; r