git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'origin/develop' into
[jalview.git]
/
src
/
jalview
/
appletgui
/
AnnotationColumnChooser.java
diff --git
a/src/jalview/appletgui/AnnotationColumnChooser.java
b/src/jalview/appletgui/AnnotationColumnChooser.java
index
7efb490
..
2acb568
100644
(file)
--- a/
src/jalview/appletgui/AnnotationColumnChooser.java
+++ b/
src/jalview/appletgui/AnnotationColumnChooser.java
@@
-167,20
+167,22
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
}
populateThresholdComboBox(threshold);
}
populateThresholdComboBox(threshold);
-
+ AnnotationColumnChooser lastChooser = av
+ .getAnnotationColumnSelectionState();
// restore Object state from the previous session if one exists
// restore Object state from the previous session if one exists
- if (av.getAnnotationColumnSelectionState() != null)
+ if (lastChooser != null)
{
{
- currentSearchPanel = av.getAnnotationColumnSelectionState()
+ currentSearchPanel = lastChooser
.getCurrentSearchPanel();
.getCurrentSearchPanel();
- currentStructureFilterPanel = av.getAnnotationColumnSelectionState()
+ currentStructureFilterPanel = lastChooser
.getCurrentStructureFilterPanel();
.getCurrentStructureFilterPanel();
- annotations.select(av.getAnnotationColumnSelectionState()
+ annotations.select(lastChooser
.getAnnotations().getSelectedIndex());
.getAnnotations().getSelectedIndex());
- threshold.select(av.getAnnotationColumnSelectionState()
+ threshold.select(lastChooser
.getThreshold().getSelectedIndex());
.getThreshold().getSelectedIndex());
- actionOption = av.getAnnotationColumnSelectionState()
+ actionOption = lastChooser
.getActionOption();
.getActionOption();
+ percentThreshold.setState(lastChooser.percentThreshold.getState());
}
try
}
try
@@
-204,6
+206,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
thresholdValue.setEnabled(false);
thresholdValue.setColumns(7);
thresholdValue.setEnabled(false);
thresholdValue.setColumns(7);
+ thresholdValue.setCaretPosition(0);
ok.addActionListener(this);
cancel.addActionListener(this);
ok.addActionListener(this);
cancel.addActionListener(this);
@@
-219,6
+222,9
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
// thresholdPanel.setFont(JvSwingUtils.getLabelFont());
// thresholdPanel.setLayout(new MigLayout("", "[left][right]", "[][]"));
// thresholdPanel.setFont(JvSwingUtils.getLabelFont());
// thresholdPanel.setLayout(new MigLayout("", "[left][right]", "[][]"));
+ percentThreshold.setLabel("As percentage");
+ percentThreshold.addItemListener(this);
+
actionPanel.setBackground(Color.white);
// actionPanel.setFont(JvSwingUtils.getLabelFont());
actionPanel.setBackground(Color.white);
// actionPanel.setFont(JvSwingUtils.getLabelFont());
@@
-242,6
+248,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
thresholdPanel.add(getThreshold());
thresholdPanel.add(slider);
thresholdPanel.add(thresholdValue);
thresholdPanel.add(getThreshold());
thresholdPanel.add(slider);
thresholdPanel.add(thresholdValue);
+ thresholdPanel.add(percentThreshold);
actionPanel.add(ok);
actionPanel.add(cancel);
actionPanel.add(ok);
actionPanel.add(cancel);
@@
-313,7
+320,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
{
if (!adjusting)
{
{
if (!adjusting)
{
- thresholdValue.setText((slider.getValue() / 1000f) + "");
+ setThresholdValueText();
valueChanged(!sliderDragging);
}
}
valueChanged(!sliderDragging);
}
}
@@
-399,12
+406,14
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
slider.setEnabled(true);
thresholdValue.setEnabled(true);
slider.setEnabled(true);
thresholdValue.setEnabled(true);
+ percentThreshold.setEnabled(true);
if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD)
{
slider.setEnabled(false);
thresholdValue.setEnabled(false);
thresholdValue.setText("");
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)
// build filter params
}
else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD)
@@
-425,10
+434,11
@@
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));
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);
// slider.setMajorTickSpacing((int) (range / 10f));
slider.setEnabled(true);
thresholdValue.setEnabled(true);
+ percentThreshold.setEnabled(true);
adjusting = false;
// build filter params
adjusting = false;
// build filter params
@@
-574,6
+584,14
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
{
threshold_actionPerformed(null);
}
{
threshold_actionPerformed(null);
}
+ else if (e.getSource() == percentThreshold)
+ {
+ if (!adjusting)
+ {
+ percentageValue_actionPerformed();
+ }
+
+ }
}
public void selectedAnnotationChanged()
}
public void selectedAnnotationChanged()
@@
-877,19
+895,8
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
@Override
public void actionPerformed(ActionEvent evt)
{
@Override
public void actionPerformed(ActionEvent evt)
{
- if (evt.getSource() == thresholdValue)
- {
- try
- {
- float f = new Float(thresholdValue.getText()).floatValue();
- slider.setValue((int) (f * 1000));
- adjustmentValueChanged(null);
- } catch (NumberFormatException ex)
- {
- }
- }
- else if (evt.getSource() == ok)
+ if (evt.getSource() == ok)
{
ok_actionPerformed(null);
}
{
ok_actionPerformed(null);
}