From: amwaterhouse Date: Tue, 22 Aug 2006 14:29:10 +0000 (+0000) Subject: To uppercase only visible X-Git-Tag: Release_2_1~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=16019224bf7ab31b3b19e6e27aa55b4d75de6f8b;p=jalview.git To uppercase only visible --- diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 9429671..82477ea 100755 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -239,13 +239,35 @@ public class APopupMenu { for (int g = 0; g < sg.getSize(true); g++) { - if (source == toggleCase) - ((SequenceI) sg.getSequences(true).elementAt(g)) - .toggleCase(sg.getStartRes(), sg.getEndRes() + 1); - else - ((SequenceI) sg.getSequences(true).elementAt(g)) - .changeCase(source == toUpper, sg.getStartRes(), - sg.getEndRes() + 1); + int start = sg.getStartRes(); + int end = sg.getEndRes() + 1; + + do + { + if (ap.av.hasHiddenColumns) + { + end = ap.av.colSel.getHiddenBoundaryRight(start); + if (start == end) + end = sg.getEndRes() + 1; + if (end > sg.getEndRes()) + end = sg.getEndRes() + 1; + } + + if (source == toggleCase) + ( (SequenceI) sg.getSequences(true).elementAt(g)) + .toggleCase(start, end); + else + ( (SequenceI) sg.getSequences(true).elementAt(g)) + .changeCase(source == toUpper, start, end); + + if (ap.av.hasHiddenColumns) + { + start = ap.av.colSel.adjustForHiddenColumns(end); + start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1; + } + + } + while (end < sg.getEndRes()); } ap.seqPanel.seqCanvas.repaint(); } diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 3481a31..69e83f5 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -1160,45 +1160,58 @@ public class PopupMenu extends JPopupMenu public void upperCase_actionPerformed(ActionEvent e) { - SequenceGroup sg = ap.av.getSelectionGroup(); - if(sg==null) - return; - - for(int g=0; g sg.getEndRes()) + end = sg.getEndRes() + 1; + } + + if (source == toggle) + ( (SequenceI) sg.getSequences(true).elementAt(g)) + .toggleCase(start, end); + else + ( (SequenceI) sg.getSequences(true).elementAt(g)) + .changeCase(source == upperCase, start, end); - ap.repaint(); + if (ap.av.hasHiddenColumns) + { + start = ap.av.colSel.adjustForHiddenColumns(end); + start = ap.av.colSel.getHiddenBoundaryLeft(start) + 1; + } + + } + while (end < sg.getEndRes()); + } + ap.repaint(); + } } public void outputText_actionPerformed(ActionEvent e)