From: gmungoc Date: Mon, 14 Sep 2015 14:50:41 +0000 (+0100) Subject: JAL-1865 fixed so initial state of annotation sort options matches X-Git-Tag: Release_2_10_0~415 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bfd019e68fc472cb1ac9a71e8118adc4eedc6609;p=jalview.git JAL-1865 fixed so initial state of annotation sort options matches display --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 3996dee..c9183d5 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -302,6 +302,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, alignPanel.annotationSpaceFillerHolder.addKeyListener(this); alignPanel.alabels.addKeyListener(this); + setAnnotationsVisibility(); + if (addToDisplay) { addToDisplay(embedded); @@ -913,7 +915,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, /** * Set the visibility state of sequence-related and/or alignment-related - * annotations depending on checkbox selections. Repaint after calling. + * annotations depending on checkbox selections, and repaint. * * @param visible */ @@ -3357,8 +3359,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, MessageManager.getString("label.sort_annotations_by_label")); showAutoFirst = new CheckboxMenuItem( MessageManager.getString("label.show_first")); + showAutoFirst.setState(false); // pending applet parameter + setShowAutoCalculatedAbove(showAutoFirst.getState()); showAutoLast = new CheckboxMenuItem( MessageManager.getString("label.show_last")); + showAutoLast.setState(!showAutoFirst.getState()); showAlignmentAnnotations.addItemListener(this); showSequenceAnnotations.addItemListener(this); sortAnnBySequence.addItemListener(this); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 500dfdb..88271b9 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -368,6 +368,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, setGUINucleotide(viewport.getAlignment().isNucleotide()); } + this.alignPanel.av + .setShowAutocalculatedAbove(isShowAutoCalculatedAbove()); + setMenusFromViewport(viewport); buildSortByAnnotationScoresMenu(); buildTreeMenu(); diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 8d18064..73d34c2 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -1295,8 +1295,10 @@ public class GAlignFrame extends JInternalFrame MessageManager.getString("label.show_last")); buttonGroup.add(showAutoFirst); buttonGroup.add(showAutoLast); - showAutoFirst.setSelected(Cache.getDefault( - Preferences.SHOW_AUTOCALC_ABOVE, false)); + final boolean autoFirst = Cache.getDefault( + Preferences.SHOW_AUTOCALC_ABOVE, false); + showAutoFirst.setSelected(autoFirst); + setShowAutoCalculatedAbove(autoFirst); showAutoFirst.addActionListener(new ActionListener() { @Override