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
better test for when to update column selection when receiving a selection message...
[jalview.git]
/
src
/
jalview
/
gui
/
SeqPanel.java
diff --git
a/src/jalview/gui/SeqPanel.java
b/src/jalview/gui/SeqPanel.java
index
f3502a6
..
640b7e4
100755
(executable)
--- a/
src/jalview/gui/SeqPanel.java
+++ b/
src/jalview/gui/SeqPanel.java
@@
-1883,7
+1883,8
@@
public class SeqPanel extends JPanel implements MouseListener,
}
// do we want to thread this ? (contention with seqsel and colsel locks, I
// suspect)
}
// do we want to thread this ? (contention with seqsel and colsel locks, I
// suspect)
- boolean repaint = false;
+ // rules are: colsel is copied if there is a real intersection between sequence selection
+ boolean repaint = false,copycolsel=true;
if (av.selectionGroup == null || !av.isSelectionGroupChanged())
{
SequenceGroup sgroup = null;
if (av.selectionGroup == null || !av.isSelectionGroupChanged())
{
SequenceGroup sgroup = null;
@@
-1898,6
+1899,11
@@
public class SeqPanel extends JPanel implements MouseListener,
}
sgroup = seqsel.intersect(av.alignment,
(av.hasHiddenRows) ? av.hiddenRepSequences : null);
}
sgroup = seqsel.intersect(av.alignment,
(av.hasHiddenRows) ? av.hiddenRepSequences : null);
+ if ((sgroup==null || sgroup.getSize()==0) && (colsel==null || colsel.size()==0))
+ {
+ // don't copy columns if the region didn't intersect.
+ copycolsel=false;
+ }
}
if (sgroup != null && sgroup.getSize() > 0)
{
}
if (sgroup != null && sgroup.getSize() > 0)
{
@@
-1909,7
+1915,7
@@
public class SeqPanel extends JPanel implements MouseListener,
}
repaint = av.isSelectionGroupChanged();
}
}
repaint = av.isSelectionGroupChanged();
}
- if (av.colSel == null || !av.isColSelChanged())
+ if (copycolsel && (av.colSel == null || !av.isColSelChanged()))
{
// the current selection is unset or from a previous message
// so import the new colsel.
{
// the current selection is unset or from a previous message
// so import the new colsel.
@@
-1922,6
+1928,7
@@
public class SeqPanel extends JPanel implements MouseListener,
}
else
{
}
else
{
+ // TODO: shift colSel according to the intersecting sequences
if (av.colSel == null)
{
av.colSel = new ColumnSelection(colsel);
if (av.colSel == null)
{
av.colSel = new ColumnSelection(colsel);
@@
-1933,7
+1940,7
@@
public class SeqPanel extends JPanel implements MouseListener,
}
repaint |= av.isColSelChanged();
}
}
repaint |= av.isColSelChanged();
}
- if (av.hasHiddenColumns
+ if (copycolsel && av.hasHiddenColumns
&& (av.colSel == null || av.colSel.getHiddenColumns() == null))
{
System.err.println("Bad things");
&& (av.colSel == null || av.colSel.getHiddenColumns() == null))
{
System.err.println("Bad things");