X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fappletgui%2FAnnotationColumnChooser.java;h=3a7188ea47d3aa8966a830ed9032bec812a17ad1;hb=9ba5a485b66e9c5a86b12dedc7b32616f3ef6db8;hp=c49a5f3b4ccdf8ca0b4c31ceb5ee105da457ec0c;hpb=5e8ec77d921ff2d604811e5e4ba7e9211b0f48de;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationColumnChooser.java b/src/jalview/appletgui/AnnotationColumnChooser.java index c49a5f3..3a7188e 100644 --- a/src/jalview/appletgui/AnnotationColumnChooser.java +++ b/src/jalview/appletgui/AnnotationColumnChooser.java @@ -46,7 +46,7 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.TextEvent; import java.awt.event.TextListener; -import java.util.Iterator; +import java.util.ArrayList; import java.util.Vector; //import javax.swing.JPanel; @@ -300,14 +300,17 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements .getOldHiddenColumns(); if (oldHidden != null) { - for (Iterator itr = oldHidden.iterator(); itr.hasNext();) + ArrayList regions = oldHidden.getHiddenColumnsCopy(); + for (int[] positions : regions) { - int positions[] = itr.next(); av.hideColumns(positions[0], positions[1]); } } + // TODO not clear why we need to hide all the columns (above) if we are + // going to copy the hidden columns over wholesale anyway av.getAlignment().setHiddenColumns(oldHidden); } + av.sendSelection(); ap.paintAlignment(true); } @@ -426,8 +429,8 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements } adjusting = true; - float range = getCurrentAnnotation().graphMax * 1000 - - getCurrentAnnotation().graphMin * 1000; + // float range = getCurrentAnnotation().graphMax * 1000 + // - getCurrentAnnotation().graphMin * 1000; slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); @@ -502,10 +505,13 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements } } + // show hidden columns here, before changing the column selection in + // filterAnnotations, because showing hidden columns has the side effect of + // adding them to the selection + av.showAllHiddenColumns(); av.getColumnSelection().filterAnnotations( getCurrentAnnotation().annotations, filterParams); - av.showAllHiddenColumns(); if (getActionOption() == ACTION_OPTION_HIDE) { av.hideSelectedColumns(); @@ -513,6 +519,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements filterParams = null; av.setAnnotationColumnSelectionState(this); + av.sendSelection(); ap.paintAlignment(true); }