}\r
}\r
\r
+\r
+ if( applet.getParameter("servletAllowed") !=null)\r
+ {\r
+ ServletGUI plug = new ServletGUI(this, fileMenu, calculateMenu);\r
+ }\r
+\r
+\r
+\r
}\r
\r
public void inputText_actionPerformed(ActionEvent e)\r
orderedSeqs.put(index + "", seq);\r
}\r
\r
- int index = 0;\r
+ int index = 0, startRes, endRes;\r
+ char ch;\r
+\r
for (int i = 0; i < sg.getSize(); i++)\r
{\r
- SequenceI seq = null;\r
- while (seq == null)\r
- {\r
- if (orderedSeqs.containsKey(index + ""))\r
+ SequenceI seq = null;\r
+\r
+ while (seq == null)\r
{\r
- seq = (SequenceI) orderedSeqs.get(index + "");\r
- index++;\r
- break;\r
+ if (orderedSeqs.containsKey(index + ""))\r
+ {\r
+ seq = (SequenceI) orderedSeqs.get(index + "");\r
+ index++;\r
+\r
+ break;\r
+ }\r
+ else\r
+ {\r
+ index++;\r
+ }\r
}\r
- else\r
+\r
+ //FIND START RES\r
+ //Returns residue following index if gap\r
+ startRes = seq.findPosition(sg.getStartRes());\r
+\r
+ //FIND END RES\r
+ //Need to find the residue preceeding index if gap\r
+ endRes = 0;\r
+\r
+ for (int j = 0; j < sg.getEndRes()+1 && j < seq.getLength(); j++)\r
+ {\r
+ ch = seq.getCharAt(j);\r
+ if (!jalview.util.Comparison.isGap( (ch)))\r
+ {\r
+ endRes++;\r
+ }\r
+ }\r
+\r
+ if(endRes>0)\r
{\r
- index++;\r
+ endRes += seq.getStart() -1;\r
}\r
- }\r
\r
- copiedSequences.append(seq.getName() + "\t" +\r
- seq.findPosition(sg.getStartRes()) + "\t"\r
- + seq.findPosition(sg.getEndRes()) + "\t"\r
- +\r
- seq.getSequence(sg.getStartRes(),\r
- sg.getEndRes() + 1) + "\n");\r
+ copiedSequences.append(seq.getName() + "\t" +\r
+ startRes + "\t" +\r
+ endRes + "\t" +\r
+ seq.getSequence(sg.getStartRes(),\r
+ sg.getEndRes() + 1) + "\n");\r
}\r
\r
}\r
//are the sequences aligned?\r
if (!viewport.alignment.isAligned())\r
{\r
- return;\r
+ SequenceI current;\r
+ int Width = viewport.getAlignment().getWidth();\r
+\r
+ for (int i = 0; i < viewport.getAlignment().getSequences().size();\r
+ i++)\r
+ {\r
+ current = viewport.getAlignment().getSequenceAt(i);\r
+\r
+ if (current.getLength() < Width)\r
+ {\r
+ current.insertCharAt(Width - 1, viewport.getGapCharacter());\r
+ }\r
+ }\r
+ alignPanel.repaint();\r
+\r
}\r
\r
final TreePanel tp;\r
orderedSeqs.put(index + "", seq);\r
}\r
\r
- int index = 0;\r
+ int index = 0, startRes, endRes;\r
+ char ch;\r
\r
for (int i = 0; i < sg.getSize(); i++)\r
{\r
}\r
}\r
\r
+ //FIND START RES\r
+ //Returns residue following index if gap\r
+ startRes = seq.findPosition(sg.getStartRes());\r
+\r
+ //FIND END RES\r
+ //Need to find the residue preceeding index if gap\r
+ endRes = 0;\r
+\r
+ for (int j = 0; j < sg.getEndRes()+1 && j < seq.getLength(); j++)\r
+ {\r
+ ch = seq.getCharAt(j);\r
+ if (!jalview.util.Comparison.isGap( (ch)))\r
+ {\r
+ endRes++;\r
+ }\r
+ }\r
+\r
+ if(endRes>0)\r
+ {\r
+ endRes += seq.getStart() -1;\r
+ }\r
+\r
buffer.append(seq.getName() + "\t" +\r
- seq.findPosition(sg.getStartRes()) + "\t" +\r
- seq.findPosition(sg.getEndRes()) + "\t" +\r
+ startRes + "\t" +\r
+ endRes + "\t" +\r
seq.getSequence(sg.getStartRes(),\r
sg.getEndRes() + 1) + "\n");\r
}\r
sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);\r
}\r
\r
- sg.setEndRes(viewport.alignment.getWidth());\r
+ sg.setEndRes(viewport.alignment.getWidth()-1);\r
viewport.setSelectionGroup(sg);\r
PaintRefresher.Refresh(null, viewport.alignment);\r
}\r