\r
public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)\r
{\r
- addHistoryItem(new HistoryItem("Remove Gaps",\r
- viewport.alignment,\r
+ addHistoryItem(new HistoryItem("Remove Gaps", viewport.alignment,\r
HistoryItem.HIDE));\r
+\r
SequenceI current;\r
int jSize;\r
- for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++)\r
+\r
+ Vector seqs=null;\r
+\r
+ int start=0, end = viewport.alignment.getWidth();\r
+\r
+ if(viewport.getSelectionGroup()!=null)\r
{\r
- current = viewport.getAlignment().getSequenceAt(i);\r
+ seqs = viewport.getSelectionGroup().sequences;\r
+ start = viewport.getSelectionGroup().getStartRes();\r
+ end = viewport.getSelectionGroup().getEndRes();\r
+ }\r
+ else\r
+ seqs = viewport.alignment.getSequences();\r
+\r
+ for (int i = 0; i <seqs.size(); i++)\r
+ {\r
+ current = (SequenceI)seqs.elementAt(i);\r
jSize = current.getLength();\r
- for (int j = 0; j < jSize; j++)\r
+\r
+ int j = start;\r
+ do\r
{\r
if (jalview.util.Comparison.isGap(current.getCharAt(j)))\r
{\r
j--;\r
jSize--;\r
}\r
+ j++;\r
}\r
+ while(j < end);\r
}\r
+\r
viewport.updateConservation();\r
viewport.updateConsensus();\r
alignPanel.repaint();\r
}\r
\r
+\r
public void findMenuItem_actionPerformed(ActionEvent e)\r
{\r
Finder finder = new Finder(alignPanel);\r
SequenceI current;\r
int jSize;\r
\r
- for (int i = 0; i < viewport.getAlignment().getSequences().size();\r
- i++)\r
+ Vector seqs=null;\r
+\r
+ int start=0, end = viewport.alignment.getWidth();\r
+\r
+ if(viewport.getSelectionGroup()!=null)\r
{\r
- current = viewport.getAlignment().getSequenceAt(i);\r
+ seqs = viewport.getSelectionGroup().sequences;\r
+ start = viewport.getSelectionGroup().getStartRes();\r
+ end = viewport.getSelectionGroup().getEndRes();\r
+ }\r
+ else\r
+ seqs = viewport.alignment.getSequences();\r
+\r
+ for (int i = 0; i <seqs.size(); i++)\r
+ {\r
+ current = (SequenceI)seqs.elementAt(i);\r
jSize = current.getLength();\r
\r
- for (int j = 0; j < jSize; j++)\r
+ int j = start;\r
+ do\r
{\r
if (jalview.util.Comparison.isGap(current.getCharAt(j)))\r
{\r
j--;\r
jSize--;\r
}\r
+ j++;\r
}\r
+ while(j < end);\r
}\r
\r
viewport.updateConservation();\r