From b321b54427b86297419763808dda86e9b10e7a00 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Wed, 15 Feb 2006 15:18:41 +0000 Subject: [PATCH] Feature replaces new superGroup --- src/jalview/appletgui/Finder.java | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/jalview/appletgui/Finder.java b/src/jalview/appletgui/Finder.java index ac7bc2c..fb8c280 100755 --- a/src/jalview/appletgui/Finder.java +++ b/src/jalview/appletgui/Finder.java @@ -31,7 +31,6 @@ public class Finder extends Panel implements ActionListener AlignViewport av; AlignmentPanel ap; Frame frame; - SuperGroup searchGroup; SearchResults searchResults; @@ -84,36 +83,23 @@ public class Finder extends Panel implements ActionListener public void createNewGroup_actionPerformed() { - Color[] newColors = new Color[24]; - for (int i = 0; i < 24; i++) - { - newColors[i] = new Color(60, 160, 115); - } - - jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme( - newColors); - String searchString = textfield.getText(); - - searchGroup = new SuperGroup(searchString, ucs, true, true, false); for (int i = 0; i < searchResults.getSize(); i ++ ) { - // its possible edits may have occurred since search was performed - // account for this here - - SequenceI seq = searchResults.getResultSequence(i); - int startRes = seq.findIndex(searchResults.getResultStart(i)) - 1; - int endRes = seq.findIndex(searchResults.getResultEnd(i)) - 1; + SequenceI seq = searchResults.getResultSequence(i); - SequenceGroup sg = new SequenceGroup(searchString, ucs, true, true, false, - startRes, endRes); - sg.addSequence(seq, false); - av.alignment.addGroup(sg); - searchGroup.addGroup(sg); + SequenceFeature sf = new SequenceFeature(textfield.getText(), + "Search Results", null, + searchResults.getResultStart(i), + searchResults.getResultEnd(i)); + ap.seqPanel.seqCanvas.getFeatureRenderer().addNewFeature( + textfield.getText(), new Color(60,160,115)); + seq.addSequenceFeature(sf); } - ap.av.alignment.addSuperGroup(searchGroup); + ap.alignFrame.sequenceFeatures.setState(true); + av.showSequenceFeatures(true); ap.highlightSearchResults(null); } @@ -321,7 +307,7 @@ public class Finder extends Panel implements ActionListener gridLayout1.setVgap(2); createNewGroup.setEnabled(false); createNewGroup.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10)); - createNewGroup.setLabel("Create new group"); + createNewGroup.setLabel("New Feature"); createNewGroup.addActionListener(this); jPanel1.add(findNext, null); jPanel1.add(findAll, null); -- 1.7.10.2