public void createNewGroup_actionPerformed()\r
{\r
\r
+ CutAndPasteTransfer cap = new CutAndPasteTransfer(true, null);\r
+ Dialog dialog = new Dialog(ap.alignFrame, "Enter New Feature Name", true);\r
+ dialog.add(cap);\r
+\r
+ cap.setText(textfield.getText());\r
+\r
+ dialog.setBounds( frame.getLocation().x+frame.getSize().width+5,\r
+ frame.getLocation().y+20,300,100);\r
+ dialog.show();\r
+\r
+\r
+ String featureName = cap.getText().trim();\r
+ if(featureName.length()<1)\r
+ return;\r
+\r
+\r
for (int i = 0; i < searchResults.getSize(); i ++ )\r
{\r
SequenceI seq = searchResults.getResultSequence(i);\r
\r
- SequenceFeature sf = new SequenceFeature(textfield.getText(),\r
- "Search Results", null,\r
+ SequenceFeature sf = new SequenceFeature(featureName,\r
+ null, null,\r
searchResults.getResultStart(i),\r
searchResults.getResultEnd(i));\r
\r
ap.seqPanel.seqCanvas.getFeatureRenderer().addNewFeature(\r
- textfield.getText(), new Color(60,160,115));\r
+ featureName, new Color(60,160,115));\r
seq.addSequenceFeature(sf);\r
}\r
\r
+ ap.seqPanel.seqCanvas.getFeatureRenderer().findAllFeatures();\r
ap.alignFrame.sequenceFeatures.setState(true);\r
av.showSequenceFeatures(true);\r
ap.highlightSearchResults(null);\r
\r
while (!found && seqIndex < end)\r
{\r
+\r
seq = (Sequence) av.alignment.getSequenceAt(seqIndex);\r
\r
if (selection != null && !selection.sequences.contains(seq))\r
}\r
\r
///Shall we ignore gaps????\r
- StringBuffer noGaps = new StringBuffer();\r
+ StringBuffer noGapsSB = new StringBuffer();\r
int insertCount = 0;\r
Vector spaces = new Vector();\r
\r
\r
if (!jalview.util.Comparison.isGap(item.charAt(j)))\r
{\r
- noGaps.append(item.charAt(j));\r
+ noGapsSB.append(item.charAt(j));\r
spaces.addElement(new Integer(insertCount));\r
}\r
else\r
}\r
}\r
\r
+ String noGaps = noGapsSB.toString();\r
+\r
for (int r = resIndex; r < noGaps.length(); r++)\r
{\r
\r
- if (regex.searchFrom(noGaps.toString(), r))\r
+ if (regex.searchFrom(noGaps, r))\r
{\r
resIndex = regex.matchedFrom();\r
if (selection != null &&\r
\r
if (findAll)\r
{\r
- String message = (searchResults.getSize()) + " matches found.";\r
- System.out.println(message);\r
+ String message = (searchResults==null?0 : searchResults.getSize()) + " matches found.";\r
+ ap.alignFrame.statusBar.setText("Search results: "+searchString+" : "+message);\r
}\r
\r
}\r