X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColumnChooser.java;h=5e12d2bf418bfddc1a690296402b930b19022368;hb=48706194673ef84e1a94ca801c3236864b0ed051;hp=8dd988ee99fb99945712a2a71bbf565441f82c07;hpb=f1e2d882404c5cdc821a772f0bd6103a226822ac;p=jalview.git diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index 8dd988e..5e12d2b 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -33,6 +33,8 @@ 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; @@ -243,7 +245,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter av.getAlignment().setHiddenColumns(oldHidden); } av.sendSelection(); - ap.paintAlignment(true); + ap.paintAlignment(true, true); } } @@ -256,7 +258,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter updateView(); propagateSeqAssociatedThreshold(updateAllAnnotation, getCurrentAnnotation()); - ap.paintAlignment(false); + ap.paintAlignment(false, false); } } @@ -380,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(); } @@ -388,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() @@ -727,10 +731,9 @@ public class AnnotationColumnChooser extends AnnotationRowFilter MessageManager.getString("label.search_filter"))); searchBox.setPrototypeDisplayValue("XXXXXXXXXXXXXXXXXXXXXXX"); - searchBox.setToolTipText( + searchBox.getComponent().setToolTipText( MessageManager.getString("info.enter_search_text_here")); - searchBox.getEditor().getEditorComponent() - .addKeyListener(new java.awt.event.KeyAdapter() + searchBox.addKeyListener(new java.awt.event.KeyAdapter() { @Override public void keyPressed(KeyEvent e) @@ -742,6 +745,14 @@ public class AnnotationColumnChooser extends AnnotationRowFilter } } }); + searchBox.addFocusListener(new FocusAdapter() + { + @Override + public void focusLost(FocusEvent e) + { + searchStringAction(); + } + }); JvSwingUtils.jvInitComponent(displayName, "label.label"); displayName.addActionListener(new ActionListener() @@ -759,12 +770,12 @@ public class AnnotationColumnChooser extends AnnotationRowFilter @Override public void actionPerformed(ActionEvent actionEvent) { - discriptionCheckboxAction(); + descriptionCheckboxAction(); } }); syncState(); - this.add(searchBox); + this.add(searchBox.getComponent()); this.add(displayName); this.add(description); } @@ -775,7 +786,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter aColChooser.updateView(); } - public void discriptionCheckboxAction() + public void descriptionCheckboxAction() { aColChooser.setCurrentSearchPanel(this); aColChooser.updateView();