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-2899 colouring moved from SwingWorker to a background thread
[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
..
2a85a9f
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();
}
/**
}
/**