X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=77700d036f2c92ba09196a50a6ec89f009213332;hb=36dceb54710feb97a81f4bd69ad051f316141dc3;hp=32d528c28ebeb62e8bc7b16ab81e4abe3abf8b16;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 32d528c..77700d0 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -150,7 +150,7 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, String label = ""; if (av.getColumnSelection() != null - && av.getColumnSelection().size() > 0 + && !av.getColumnSelection().isEmpty() && anot[av.getColumnSelection().getMin()] != null) { label = anot[av.getColumnSelection().getMin()].displayCharacter; @@ -158,9 +158,12 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, if (evt.getActionCommand().equals(REMOVE)) { - for (int i = 0; i < av.getColumnSelection().size(); i++) + for (int sel : av.getColumnSelection().getSelected()) { - anot[av.getColumnSelection().columnAt(i)] = null; + // TODO: JAL-2001 check if applet has faulty 'REMOVE' selected columns + // of + // annotation if selection includes hidden columns + anot[sel] = null; } } else if (evt.getActionCommand().equals(LABEL)) @@ -177,10 +180,10 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, aa[activeRow].hasText = true; } - for (int i = 0; i < av.getColumnSelection().size(); i++) + for (int index : av.getColumnSelection().getSelected()) { - int index = av.getColumnSelection().columnAt(i); - + // TODO: JAL-2001 - provide a fast method to list visible selected + // columns if (!av.getColumnSelection().isVisible(index)) { continue; @@ -201,10 +204,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, Color col = udc.getColor(); - for (int i = 0; i < av.getColumnSelection().size(); i++) + for (int index : av.getColumnSelection().getSelected()) { - int index = av.getColumnSelection().columnAt(i); - if (!av.getColumnSelection().isVisible(index)) { continue; @@ -262,10 +263,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, } } - for (int i = 0; i < av.getColumnSelection().size(); i++) + for (int index : av.getColumnSelection().getSelected()) { - int index = av.getColumnSelection().columnAt(i); - if (!av.getColumnSelection().isVisible(index)) { continue;