X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColumnChooser.java;h=5adecad0a226dbe24e45a7c72c9ee25177844a18;hb=54360f0110522c5832ebabff8a8498ed4a087261;hp=84b2c6f096fd8b6cda6f3edb7bb5b81e3861a6c5;hpb=3d0101179759ef157b088ea135423cd909512d9f;p=jalview.git diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index 84b2c6f..5adecad 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -33,10 +33,11 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.KeyEvent; -import java.util.ArrayList; import javax.swing.ButtonGroup; import javax.swing.JCheckBox; @@ -241,20 +242,10 @@ public class AnnotationColumnChooser extends AnnotationRowFilter { HiddenColumns oldHidden = av.getAnnotationColumnSelectionState() .getOldHiddenColumns(); - if (oldHidden != null) - { - ArrayList regions = oldHidden.getHiddenColumnsCopy(); - for (int[] positions : regions) - { - 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); + ap.paintAlignment(true, true); } } @@ -267,7 +258,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter updateView(); propagateSeqAssociatedThreshold(updateAllAnnotation, getCurrentAnnotation()); - ap.paintAlignment(false); + ap.paintAlignment(false, false); } } @@ -391,7 +382,8 @@ public class AnnotationColumnChooser extends AnnotationRowFilter av.getColumnSelection().filterAnnotations( getCurrentAnnotation().annotations, filterParams); - if (getActionOption() == ACTION_OPTION_HIDE) + boolean hideCols = getActionOption() == ACTION_OPTION_HIDE; + if (hideCols) { av.hideSelectedColumns(); } @@ -399,7 +391,8 @@ public class AnnotationColumnChooser extends AnnotationRowFilter filterParams = null; av.setAnnotationColumnSelectionState(this); - ap.paintAlignment(true); + // only update overview and structures if columns were hidden + ap.paintAlignment(hideCols, hideCols); } public HiddenColumns getOldHiddenColumns() @@ -753,6 +746,15 @@ public class AnnotationColumnChooser extends AnnotationRowFilter } } }); + searchBox.getEditor().getEditorComponent() + .addFocusListener(new FocusAdapter() + { + @Override + public void focusLost(FocusEvent e) + { + searchStringAction(); + } + }); JvSwingUtils.jvInitComponent(displayName, "label.label"); displayName.addActionListener(new ActionListener() @@ -770,7 +772,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent actionEvent) { - discriptionCheckboxAction(); + descriptionCheckboxAction(); } }); @@ -786,7 +788,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter aColChooser.updateView(); } - public void discriptionCheckboxAction() + public void descriptionCheckboxAction() { aColChooser.setCurrentSearchPanel(this); aColChooser.updateView();