git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
46f8b48
)
JAL-2374 fix popup out by one and multiple groups bugs
author
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 5 Jan 2017 16:00:23 +0000
(16:00 +0000)
committer
gmungoc
<g.m.carstairs@dundee.ac.uk>
Thu, 5 Jan 2017 16:00:23 +0000
(16:00 +0000)
src/jalview/appletgui/SeqPanel.java
patch
|
blob
|
history
src/jalview/datamodel/Alignment.java
patch
|
blob
|
history
src/jalview/datamodel/AlignmentI.java
patch
|
blob
|
history
src/jalview/gui/SeqPanel.java
patch
|
blob
|
history
diff --git
a/src/jalview/appletgui/SeqPanel.java
b/src/jalview/appletgui/SeqPanel.java
index
8d6e683
..
4278744
100644
(file)
--- a/
src/jalview/appletgui/SeqPanel.java
+++ b/
src/jalview/appletgui/SeqPanel.java
@@
-1425,19
+1425,12
@@
public class SeqPanel extends Panel implements MouseMotionListener,
if (stretchGroup == null)
{
if (stretchGroup == null)
{
- stretchGroup = av.getAlignment().findGroup(sequence);
- if (stretchGroup != null && res > stretchGroup.getStartRes()
- && res < stretchGroup.getEndRes())
- {
- av.setSelectionGroup(stretchGroup);
- }
- else
- {
- stretchGroup = null;
- }
+ stretchGroup = av.getAlignment().findGroup(sequence, res);
+ av.setSelectionGroup(stretchGroup);
}
}
- else if (!stretchGroup.getSequences(null).contains(sequence)
+ if (stretchGroup == null
+ || !stretchGroup.getSequences(null).contains(sequence)
|| stretchGroup.getStartRes() > res
|| stretchGroup.getEndRes() < res)
{
|| stretchGroup.getStartRes() > res
|| stretchGroup.getEndRes() < res)
{
diff --git
a/src/jalview/datamodel/Alignment.java
b/src/jalview/datamodel/Alignment.java
index
d651c1d
..
90bdcae
100755
(executable)
--- a/
src/jalview/datamodel/Alignment.java
+++ b/
src/jalview/datamodel/Alignment.java
@@
-366,17
+366,18
@@
public class Alignment implements AlignmentI
* @see jalview.datamodel.AlignmentI#findGroup(jalview.datamodel.SequenceI)
*/
@Override
* @see jalview.datamodel.AlignmentI#findGroup(jalview.datamodel.SequenceI)
*/
@Override
- public SequenceGroup findGroup(SequenceI s)
+ public SequenceGroup findGroup(SequenceI seq, int position)
{
synchronized (groups)
{
{
synchronized (groups)
{
- for (int i = 0; i < this.groups.size(); i++)
+ for (SequenceGroup sg : groups)
{
{
- SequenceGroup sg = groups.get(i);
-
- if (sg.getSequences(null).contains(s))
+ if (sg.getSequences(null).contains(seq))
{
{
- return sg;
+ if (position >= sg.getStartRes() && position <= sg.getEndRes())
+ {
+ return sg;
+ }
}
}
}
}
}
}
diff --git
a/src/jalview/datamodel/AlignmentI.java
b/src/jalview/datamodel/AlignmentI.java
index
7274e5f
..
2df099a
100755
(executable)
--- a/
src/jalview/datamodel/AlignmentI.java
+++ b/
src/jalview/datamodel/AlignmentI.java
@@
-156,15
+156,16
@@
public interface AlignmentI extends AnnotatedCollectionI
int findIndex(SequenceI s);
/**
int findIndex(SequenceI s);
/**
- * Finds group that given sequence is part of.
+ * Returns the first group (in the order in which groups were added) that
+ * includes the given sequence and aligned position (base 0), or null if none
+ * found
*
*
- * @param s
- * Sequence in alignment.
+ * @param seq
+ * @param position
*
*
- * @return First group found for sequence. WARNING : Sequences may be members
- * of several groups. This method is incomplete.
+ * @return
*/
*/
- SequenceGroup findGroup(SequenceI s);
+ SequenceGroup findGroup(SequenceI seq, int position);
/**
* Finds all groups that a given sequence is part of.
/**
* Finds all groups that a given sequence is part of.
diff --git
a/src/jalview/gui/SeqPanel.java
b/src/jalview/gui/SeqPanel.java
index
8726c4a
..
5b87445
100644
(file)
--- a/
src/jalview/gui/SeqPanel.java
+++ b/
src/jalview/gui/SeqPanel.java
@@
-60,7
+60,6
@@
import java.awt.event.MouseWheelListener;
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
@@
-1589,19
+1588,11
@@
public class SeqPanel extends JPanel implements MouseListener,
if (stretchGroup == null)
{
if (stretchGroup == null)
{
- stretchGroup = av.getAlignment().findGroup(sequence);
-
- if ((stretchGroup != null) && (res > stretchGroup.getStartRes())
- && (res < stretchGroup.getEndRes()))
- {
- av.setSelectionGroup(stretchGroup);
- }
- else
- {
- stretchGroup = null;
- }
+ stretchGroup = av.getAlignment().findGroup(sequence, res);
+ av.setSelectionGroup(stretchGroup);
}
}
- else if (!stretchGroup.getSequences(null).contains(sequence)
+ if (stretchGroup == null
+ || !stretchGroup.getSequences(null).contains(sequence)
|| (stretchGroup.getStartRes() > res)
|| (stretchGroup.getEndRes() < res))
{
|| (stretchGroup.getStartRes() > res)
|| (stretchGroup.getEndRes() < res))
{