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
JAL-2611 reinstate missed merge - again!
[jalview.git]
/
src
/
jalview
/
appletgui
/
AnnotationColumnChooser.java
diff --git
a/src/jalview/appletgui/AnnotationColumnChooser.java
b/src/jalview/appletgui/AnnotationColumnChooser.java
index
2acb568
..
3a7188e
100644
(file)
--- a/
src/jalview/appletgui/AnnotationColumnChooser.java
+++ b/
src/jalview/appletgui/AnnotationColumnChooser.java
@@
-46,7
+46,7
@@
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.TextEvent;
import java.awt.event.TextListener;
import java.awt.event.MouseListener;
import java.awt.event.TextEvent;
import java.awt.event.TextListener;
-import java.util.Iterator;
+import java.util.ArrayList;
import java.util.Vector;
//import javax.swing.JPanel;
import java.util.Vector;
//import javax.swing.JPanel;
@@
-142,7
+142,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
}
setOldHiddenColumns(av.getAlignment().getHiddenColumns());
adjusting = true;
}
setOldHiddenColumns(av.getAlignment().getHiddenColumns());
adjusting = true;
- Vector<String> list = new Vector<String>();
+ Vector<String> list = new Vector<>();
int index = 1;
for (int i = 0; i < anns.length; i++)
{
int index = 1;
for (int i = 0; i < anns.length; i++)
{
@@
-298,18
+298,19
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
HiddenColumns oldHidden = av
.getAnnotationColumnSelectionState()
.getOldHiddenColumns();
HiddenColumns oldHidden = av
.getAnnotationColumnSelectionState()
.getOldHiddenColumns();
- if (oldHidden != null && oldHidden.getListOfCols() != null
- && !oldHidden.getListOfCols().isEmpty())
+ if (oldHidden != null)
{
{
- for (Iterator<int[]> itr = oldHidden.getListOfCols()
- .iterator(); itr.hasNext();)
+ ArrayList<int[]> regions = oldHidden.getHiddenColumnsCopy();
+ for (int[] positions : regions)
{
{
- int positions[] = itr.next();
av.hideColumns(positions[0], positions[1]);
}
}
av.hideColumns(positions[0], positions[1]);
}
}
+ // TODO not clear why we need to hide all the columns (above) if we are
+ // going to copy the hidden columns over wholesale anyway
av.getAlignment().setHiddenColumns(oldHidden);
}
av.getAlignment().setHiddenColumns(oldHidden);
}
+ av.sendSelection();
ap.paintAlignment(true);
}
ap.paintAlignment(true);
}
@@
-428,8
+429,8
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
}
adjusting = true;
}
adjusting = true;
- float range = getCurrentAnnotation().graphMax * 1000
- - getCurrentAnnotation().graphMin * 1000;
+ // float range = getCurrentAnnotation().graphMax * 1000
+ // - getCurrentAnnotation().graphMin * 1000;
slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000));
slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000));
slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000));
slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000));
@@
-444,7
+445,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
// build filter params
filterParams
.setThresholdType(AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
// 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);
@@
-504,10
+505,13
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
}
}
}
}
+ // show hidden columns here, before changing the column selection in
+ // filterAnnotations, because showing hidden columns has the side effect of
+ // adding them to the selection
+ av.showAllHiddenColumns();
av.getColumnSelection().filterAnnotations(
getCurrentAnnotation().annotations, filterParams);
av.getColumnSelection().filterAnnotations(
getCurrentAnnotation().annotations, filterParams);
- av.showAllHiddenColumns();
if (getActionOption() == ACTION_OPTION_HIDE)
{
av.hideSelectedColumns();
if (getActionOption() == ACTION_OPTION_HIDE)
{
av.hideSelectedColumns();
@@
-515,6
+519,7
@@
public class AnnotationColumnChooser extends AnnotationRowFilter implements
filterParams = null;
av.setAnnotationColumnSelectionState(this);
filterParams = null;
av.setAnnotationColumnSelectionState(this);
+ av.sendSelection();
ap.paintAlignment(true);
}
ap.paintAlignment(true);
}
@@
-598,7
+603,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;
}