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:
0619399
)
avoid creating lots of identical search results. patch for JAL-751
author
jprocter
<Jim Procter>
Tue, 18 Jan 2011 17:40:16 +0000
(17:40 +0000)
committer
jprocter
<Jim Procter>
Tue, 18 Jan 2011 17:40:16 +0000
(17:40 +0000)
src/jalview/structure/StructureSelectionManager.java
patch
|
blob
|
history
diff --git
a/src/jalview/structure/StructureSelectionManager.java
b/src/jalview/structure/StructureSelectionManager.java
index
c4566d8
..
0e4ec2f
100644
(file)
--- a/
src/jalview/structure/StructureSelectionManager.java
+++ b/
src/jalview/structure/StructureSelectionManager.java
@@
-213,7
+213,9
@@
public class StructureSelectionManager
maxChain.transferRESNUMFeatures(sequence[s], null);
maxChain.transferRESNUMFeatures(sequence[s], null);
- int[][] mapping = new int[sequence[s].getEnd() + 2][2];
+ // allocate enough slots to store the mapping from positions in
+ // sequence[s] to the associated chain
+ int[][] mapping = new int[maxChain.sequence.getEnd() + 2][2];
int resNum = -10000;
int index = 0;
int resNum = -10000;
int index = 0;
@@
-304,6
+306,8
@@
public class StructureSelectionManager
{
boolean hasSequenceListeners = handlingVamsasMo || seqmappings != null;
SearchResults results = null;
{
boolean hasSequenceListeners = handlingVamsasMo || seqmappings != null;
SearchResults results = null;
+ SequenceI lastseq = null;
+ int lastipos = -1, indexpos;
for (int i = 0; i < listeners.size(); i++)
{
if (listeners.elementAt(i) instanceof SequenceListener)
for (int i = 0; i < listeners.size(); i++)
{
if (listeners.elementAt(i) instanceof SequenceListener)
@@
-312,7
+316,6
@@
public class StructureSelectionManager
{
results = new SearchResults();
}
{
results = new SearchResults();
}
- int indexpos;
if (mappings != null)
{
for (int j = 0; j < mappings.length; j++)
if (mappings != null)
{
for (int j = 0; j < mappings.length; j++)
@@
-321,19
+324,25
@@
public class StructureSelectionManager
&& mappings[j].pdbchain.equals(chain))
{
indexpos = mappings[j].getSeqPos(pdbResNum);
&& mappings[j].pdbchain.equals(chain))
{
indexpos = mappings[j].getSeqPos(pdbResNum);
- results.addResult(mappings[j].sequence, indexpos, indexpos);
- // construct highlighted sequence list
- if (seqmappings != null)
+ if (lastipos != indexpos && lastseq != mappings[j].sequence)
{
{
+ results.addResult(mappings[j].sequence, indexpos, indexpos);
+ lastipos = indexpos;
+ lastseq = mappings[j].sequence;
+ // construct highlighted sequence list
+ if (seqmappings != null)
+ {
- Enumeration e = seqmappings.elements();
- while (e.hasMoreElements())
+ Enumeration e = seqmappings.elements();
+ while (e.hasMoreElements())
- {
- ((AlignedCodonFrame) e.nextElement()).markMappedRegion(
- mappings[j].sequence, indexpos, results);
+ {
+ ((AlignedCodonFrame) e.nextElement()).markMappedRegion(
+ mappings[j].sequence, indexpos, results);
+ }
}
}
}
}
+
}
}
}
}
}
}
@@
-363,7
+372,8
@@
public class StructureSelectionManager
* the sequence position (if -1, seq.findPosition is called to
* resolve the residue number)
*/
* the sequence position (if -1, seq.findPosition is called to
* resolve the residue number)
*/
- public void mouseOverSequence(SequenceI seq, int indexpos, int index, VamsasSource source)
+ public void mouseOverSequence(SequenceI seq, int indexpos, int index,
+ VamsasSource source)
{
boolean hasSequenceListeners = handlingVamsasMo || seqmappings != null;
SearchResults results = null;
{
boolean hasSequenceListeners = handlingVamsasMo || seqmappings != null;
SearchResults results = null;
@@
-446,8
+456,8
@@
public class StructureSelectionManager
// index);
// pass the mouse over and absolute position onto the
// VamsasListener(s)
// index);
// pass the mouse over and absolute position onto the
// VamsasListener(s)
- ((VamsasListener) listeners.elementAt(i))
- .mouseOver(seq, indexpos, source);
+ ((VamsasListener) listeners.elementAt(i)).mouseOver(seq,
+ indexpos, source);
}
}
}
}
}
}
@@
-468,7
+478,8
@@
public class StructureSelectionManager
* @param position
* in an alignment sequence
*/
* @param position
* in an alignment sequence
*/
- public void mouseOverVamsasSequence(SequenceI sequenceI, int position, VamsasSource source)
+ public void mouseOverVamsasSequence(SequenceI sequenceI, int position,
+ VamsasSource source)
{
handlingVamsasMo = true;
long msg = sequenceI.hashCode() * (1 + position);
{
handlingVamsasMo = true;
long msg = sequenceI.hashCode() * (1 + position);