{\r
for (int g = 0; g < sg.getSize(true); g++)\r
{\r
- if (source == toggleCase)\r
- ((SequenceI) sg.getSequences(true).elementAt(g))\r
- .toggleCase(sg.getStartRes(), sg.getEndRes() + 1);\r
- else\r
- ((SequenceI) sg.getSequences(true).elementAt(g))\r
- .changeCase(source == toUpper, sg.getStartRes(),\r
- sg.getEndRes() + 1);\r
+ int start = sg.getStartRes();\r
+ int end = sg.getEndRes() + 1;\r
+\r
+ do\r
+ {\r
+ if (ap.av.hasHiddenColumns)\r
+ {\r
+ end = ap.av.colSel.getHiddenBoundaryRight(start);\r
+ if (start == end)\r
+ end = sg.getEndRes() + 1;\r
+ if (end > sg.getEndRes())\r
+ end = sg.getEndRes() + 1;\r
+ }\r
+\r
+ if (source == toggleCase)\r
+ ( (SequenceI) sg.getSequences(true).elementAt(g))\r
+ .toggleCase(start, end);\r
+ else\r
+ ( (SequenceI) sg.getSequences(true).elementAt(g))\r
+ .changeCase(source == toUpper, start, end);\r
+\r
+ if (ap.av.hasHiddenColumns)\r
+ {\r
+ start = ap.av.colSel.adjustForHiddenColumns(end);\r
+ start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1;\r
+ }\r
+\r
+ }\r
+ while (end < sg.getEndRes());\r
}\r
ap.seqPanel.seqCanvas.repaint();\r
}\r
\r
public void upperCase_actionPerformed(ActionEvent e)\r
{\r
- SequenceGroup sg = ap.av.getSelectionGroup();\r
- if(sg==null)\r
- return;\r
-\r
- for(int g=0; g<sg.getSize(true); g++)\r
- {\r
- ( (SequenceI)sg.getSequences(true).elementAt(g))\r
- .changeCase(true, sg.getStartRes(), sg.getEndRes()+1);\r
- }\r
- ap.repaint();\r
+ changeCase(e.getSource());\r
}\r
\r
public void lowerCase_actionPerformed(ActionEvent e)\r
{\r
- SequenceGroup sg = ap.av.getSelectionGroup();\r
- if(sg==null)\r
- return;\r
-\r
- for(int g=0; g<sg.getSize(true); g++)\r
- {\r
- ( (SequenceI)sg.getSequences(true).elementAt(g))\r
- .changeCase(false, sg.getStartRes(), sg.getEndRes()+1);\r
- }\r
- ap.repaint();\r
+ changeCase(e.getSource());\r
}\r
\r
public void toggle_actionPerformed(ActionEvent e)\r
{\r
- SequenceGroup sg = ap.av.getSelectionGroup();\r
- if (sg == null)\r
- return;\r
+ changeCase(e.getSource());\r
+ }\r
\r
- for (int g = 0; g < sg.getSize(true); g++)\r
+ void changeCase(Object source)\r
+ {\r
+ SequenceGroup sg = ap.av.getSelectionGroup();\r
+ if (sg != null)\r
{\r
- ( (SequenceI)sg.getSequences(true).elementAt(g))\r
- .toggleCase(sg.getStartRes(), sg.getEndRes() + 1);\r
- }\r
+ for (int g = 0; g < sg.getSize(true); g++)\r
+ {\r
+ int start = sg.getStartRes();\r
+ int end = sg.getEndRes() + 1;\r
+\r
+ do\r
+ {\r
+ if (ap.av.hasHiddenColumns)\r
+ {\r
+ end = ap.av.colSel.getHiddenBoundaryRight(start);\r
+ if (start == end)\r
+ end = sg.getEndRes() + 1;\r
+ if (end > sg.getEndRes())\r
+ end = sg.getEndRes() + 1;\r
+ }\r
+\r
+ if (source == toggle)\r
+ ( (SequenceI) sg.getSequences(true).elementAt(g))\r
+ .toggleCase(start, end);\r
+ else\r
+ ( (SequenceI) sg.getSequences(true).elementAt(g))\r
+ .changeCase(source == upperCase, start, end);\r
\r
- ap.repaint();\r
+ if (ap.av.hasHiddenColumns)\r
+ {\r
+ start = ap.av.colSel.adjustForHiddenColumns(end);\r
+ start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1;\r
+ }\r
+\r
+ }\r
+ while (end < sg.getEndRes());\r
+ }\r
+ ap.repaint();\r
+ }\r
}\r
\r
public void outputText_actionPerformed(ActionEvent e)\r