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 'releases/Release_2_10_4_Branch'
[jalview.git]
/
src
/
jalview
/
ext
/
jmol
/
JalviewJmolBinding.java
diff --git
a/src/jalview/ext/jmol/JalviewJmolBinding.java
b/src/jalview/ext/jmol/JalviewJmolBinding.java
index
41bc116
..
8832278
100644
(file)
--- a/
src/jalview/ext/jmol/JalviewJmolBinding.java
+++ b/
src/jalview/ext/jmol/JalviewJmolBinding.java
@@
-478,6
+478,7
@@
public abstract class JalviewJmolBinding extends AAStructureBindingModel
lastCommand = command;
}
lastCommand = command;
}
+ Thread colourby = null;
/**
* Sends a set of colour commands to the structure viewer
*
/**
* Sends a set of colour commands to the structure viewer
*
@@
-485,15
+486,28
@@
public abstract class JalviewJmolBinding extends AAStructureBindingModel
*/
@Override
protected void colourBySequence(
*/
@Override
protected void colourBySequence(
- StructureMappingcommandSet[] colourBySequenceCommands)
+ final StructureMappingcommandSet[] colourBySequenceCommands)
{
{
- for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+ if (colourby != null)
{
{
- for (String cbyseq : cpdbbyseq.commands)
+ colourby.interrupt();
+ colourby = null;
+ }
+ colourby = new Thread(new Runnable()
+ {
+ @Override
+ public void run()
{
{
- executeWhenReady(cbyseq);
+ for (StructureMappingcommandSet cpdbbyseq : colourBySequenceCommands)
+ {
+ for (String cbyseq : cpdbbyseq.commands)
+ {
+ executeWhenReady(cbyseq);
+ }
+ }
}
}
- }
+ });
+ colourby.start();
}
/**
}
/**
@@
-862,19
+876,30
@@
public abstract class JalviewJmolBinding extends AAStructureBindingModel
try
{
// recover PDB filename for the model hovered over.
try
{
// recover PDB filename for the model hovered over.
- int _mp = _modelFileNameMap.length - 1,
- mnumber = new Integer(mdlId).intValue() - 1;
- while (mnumber < _modelFileNameMap[_mp])
+ int mnumber = new Integer(mdlId).intValue() - 1;
+ if (_modelFileNameMap != null)
{
{
- _mp--;
+ int _mp = _modelFileNameMap.length - 1;
+
+ while (mnumber < _modelFileNameMap[_mp])
+ {
+ _mp--;
+ }
+ pdbfilename = modelFileNames[_mp];
}
}
- pdbfilename = modelFileNames[_mp];
- if (pdbfilename == null)
+ else
{
{
- pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
- .getAbsolutePath();
- }
+ if (mnumber >= 0 && mnumber < modelFileNames.length)
+ {
+ pdbfilename = modelFileNames[mnumber];
+ }
+ if (pdbfilename == null)
+ {
+ pdbfilename = new File(viewer.ms.getModelFileName(mnumber))
+ .getAbsolutePath();
+ }
+ }
} catch (Exception e)
{
}
} catch (Exception e)
{
}