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 branch 'features/JAL-2447experimentalFlag' into develop
[jalview.git]
/
src
/
jalview
/
appletgui
/
AnnotationColumnChooser.java
diff --git
a/src/jalview/appletgui/AnnotationColumnChooser.java
b/src/jalview/appletgui/AnnotationColumnChooser.java
index
b139fb8
..
60775d3
100644
(file)
--- a/
src/jalview/appletgui/AnnotationColumnChooser.java
+++ b/
src/jalview/appletgui/AnnotationColumnChooser.java
@@
-21,7
+21,7
@@
package jalview.appletgui;
import jalview.datamodel.AlignmentAnnotation;
package jalview.appletgui;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.HiddenColumns;
import jalview.schemes.AnnotationColourGradient;
import jalview.util.MessageManager;
import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
import jalview.schemes.AnnotationColourGradient;
import jalview.util.MessageManager;
import jalview.viewmodel.annotationfilter.AnnotationFilterParameter;
@@
-110,7
+110,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
private int actionOption = ACTION_OPTION_SELECT;
private int actionOption = ACTION_OPTION_SELECT;
- private ColumnSelection oldColumnSelection;
+ private HiddenColumns oldHiddenColumns;
public AnnotationColumnChooser()
{
public AnnotationColumnChooser()
{
@@
-140,7
+140,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
{
return;
}
{
return;
}
- setOldColumnSelection(av.getColumnSelection());
+ setOldHiddenColumns(av.getAlignment().getHiddenColumns());
adjusting = true;
Vector<String> list = new Vector<String>();
int index = 1;
adjusting = true;
Vector<String> list = new Vector<String>();
int index = 1;
@@
-245,10
+245,10
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
ngStructureFilterPanel = new StructureFilterPanel(this);
thresholdPanel.setTitle("Threshold Filter");
ngStructureFilterPanel = new StructureFilterPanel(this);
thresholdPanel.setTitle("Threshold Filter");
- thresholdPanel.add(percentThreshold);
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);
@@
-289,26
+289,26
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
@SuppressWarnings("unchecked")
public void reset()
{
@SuppressWarnings("unchecked")
public void reset()
{
- if (this.getOldColumnSelection() != null)
+ if (this.getOldHiddenColumns() != null)
{
av.getColumnSelection().clear();
if (av.getAnnotationColumnSelectionState() != null)
{
{
av.getColumnSelection().clear();
if (av.getAnnotationColumnSelectionState() != null)
{
- ColumnSelection oldSelection = av
+ HiddenColumns oldHidden = av
.getAnnotationColumnSelectionState()
.getAnnotationColumnSelectionState()
- .getOldColumnSelection();
- if (oldSelection != null && oldSelection.getHiddenColumns() != null
- && !oldSelection.getHiddenColumns().isEmpty())
+ .getOldHiddenColumns();
+ if (oldHidden != null && oldHidden.getHiddenRegions() != null
+ && !oldHidden.getHiddenRegions().isEmpty())
{
{
- for (Iterator<int[]> itr = oldSelection.getHiddenColumns()
+ for (Iterator<int[]> itr = oldHidden.getHiddenRegions()
.iterator(); itr.hasNext();)
{
int positions[] = itr.next();
av.hideColumns(positions[0], positions[1]);
}
}
.iterator(); itr.hasNext();)
{
int positions[] = itr.next();
av.hideColumns(positions[0], positions[1]);
}
}
- av.setColumnSelection(oldSelection);
+ av.getAlignment().setHiddenColumns(oldHidden);
}
ap.paintAlignment(true);
}
}
ap.paintAlignment(true);
}
@@
-320,7
+320,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
{
if (!adjusting)
{
{
if (!adjusting)
{
- thresholdValue.setText((slider.getValue() / 1000f) + "");
+ setThresholdValueText();
valueChanged(!sliderDragging);
}
}
valueChanged(!sliderDragging);
}
}
@@
-406,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)
@@
-436,12
+438,13
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
// 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
filterParams
.setThresholdType(AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
adjusting = false;
// build filter params
filterParams
.setThresholdType(AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
- if (getCurrentAnnotation().graph != AlignmentAnnotation.NO_GRAPH)
+ if (getCurrentAnnotation().isQuantitative())
{
filterParams
.setThresholdValue(getCurrentAnnotation().threshold.value);
{
filterParams
.setThresholdValue(getCurrentAnnotation().threshold.value);
@@
-515,16
+518,16
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
ap.paintAlignment(true);
}
ap.paintAlignment(true);
}
- public ColumnSelection getOldColumnSelection()
+ public HiddenColumns getOldHiddenColumns()
{
{
- return oldColumnSelection;
+ return oldHiddenColumns;
}
}
- public void setOldColumnSelection(ColumnSelection currentColumnSelection)
+ public void setOldHiddenColumns(HiddenColumns currentHiddenColumns)
{
{
- if (currentColumnSelection != null)
+ if (currentHiddenColumns != null)
{
{
- this.oldColumnSelection = new ColumnSelection(currentColumnSelection);
+ this.oldHiddenColumns = new HiddenColumns(currentHiddenColumns);
}
}
}
}
@@
-595,7
+598,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
{
String currentView = AnnotationColumnChooser.NO_GRAPH_VIEW;
if (av.getAlignment().getAlignmentAnnotation()[getAnnotations()
{
String currentView = AnnotationColumnChooser.NO_GRAPH_VIEW;
if (av.getAlignment().getAlignmentAnnotation()[getAnnotations()
- .getSelectedIndex()].graph != AlignmentAnnotation.NO_GRAPH)
+ .getSelectedIndex()].isQuantitative())
{
currentView = AnnotationColumnChooser.GRAPH_VIEW;
}
{
currentView = AnnotationColumnChooser.GRAPH_VIEW;
}
@@
-892,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);
}