X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColumnChooser.java;h=0fe64625876fed4f1a565c0cfc647c55dbe6d6e3;hb=e5b2edf3955c50cfd61799ad12cdc9016603ee1c;hp=fa63e0dfd1d13658be592efeb7973743f75d21e7;hpb=df98ae3e601ff44c9a1d7beb5c9014aebf0e960e;p=jalview.git diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index fa63e0d..0fe6462 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -110,20 +110,23 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements setAnnotations(new JComboBox(getAnnotationItems(false))); populateThresholdComboBox(threshold); - + AnnotationColumnChooser lastChooser = av + .getAnnotationColumnSelectionState(); // restore Object state from the previous session if one exists - if (av.getAnnotationColumnSelectionState() != null) + if (lastChooser != null) { - currentSearchPanel = av.getAnnotationColumnSelectionState() + currentSearchPanel = lastChooser .getCurrentSearchPanel(); - currentStructureFilterPanel = av.getAnnotationColumnSelectionState() + currentStructureFilterPanel = lastChooser .getCurrentStructureFilterPanel(); - annotations.setSelectedIndex(av.getAnnotationColumnSelectionState() + annotations.setSelectedIndex(lastChooser .getAnnotations().getSelectedIndex()); - threshold.setSelectedIndex(av.getAnnotationColumnSelectionState() + threshold.setSelectedIndex(lastChooser .getThreshold().getSelectedIndex()); - actionOption = av.getAnnotationColumnSelectionState() + actionOption = lastChooser .getActionOption(); + percentThreshold.setSelected(lastChooser.percentThreshold + .isSelected()); } try @@ -151,6 +154,9 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements thresholdPanel.setFont(JvSwingUtils.getLabelFont()); thresholdPanel.setLayout(new MigLayout("", "[left][right]", "[][]")); + percentThreshold.setBackground(Color.white); + percentThreshold.setFont(JvSwingUtils.getLabelFont()); + JPanel actionPanel = new JPanel(); actionPanel.setBackground(Color.white); actionPanel.setFont(JvSwingUtils.getLabelFont()); @@ -174,8 +180,9 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements ngStructureFilterPanel = new StructureFilterPanel(this); thresholdPanel.add(getThreshold()); - thresholdPanel.add(thresholdValue, "wrap"); - thresholdPanel.add(slider, "grow, span, wrap"); + thresholdPanel.add(percentThreshold, "wrap"); + thresholdPanel.add(slider, "grow"); + thresholdPanel.add(thresholdValue, "span, wrap"); actionPanel.add(ok); actionPanel.add(cancel); @@ -282,12 +289,14 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements slider.setEnabled(true); thresholdValue.setEnabled(true); + percentThreshold.setEnabled(true); if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD) { slider.setEnabled(false); thresholdValue.setEnabled(false); thresholdValue.setText(""); + percentThreshold.setEnabled(false); // build filter params } else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) @@ -308,7 +317,9 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000)); slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000)); slider.setValue((int) (getCurrentAnnotation().threshold.value * 1000)); - thresholdValue.setText(getCurrentAnnotation().threshold.value + ""); + + setThresholdValueText(); + slider.setMajorTickSpacing((int) (range / 10f)); slider.setEnabled(true); thresholdValue.setEnabled(true);