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:
f5a779f
)
updatingConsensus, updatingConservation is static - only one thread can run the calcu...
author
amwaterhouse
<Andrew Waterhouse>
Fri, 27 Oct 2006 16:43:54 +0000
(16:43 +0000)
committer
amwaterhouse
<Andrew Waterhouse>
Fri, 27 Oct 2006 16:43:54 +0000
(16:43 +0000)
src/jalview/gui/AlignViewport.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/AlignViewport.java
b/src/jalview/gui/AlignViewport.java
index
efce038
..
36f69a5
100755
(executable)
--- a/
src/jalview/gui/AlignViewport.java
+++ b/
src/jalview/gui/AlignViewport.java
@@
-264,6
+264,21
@@
public class AlignViewport
{
try
{
{
try
{
+ while (updatingConservation)
+ {
+ try
+ {
+ Thread.sleep(200);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ updatingConservation = true;
+
+
int alWidth = alignment.getWidth();
if(alWidth<0)
return;
int alWidth = alignment.getWidth();
if(alWidth<0)
return;
@@
-381,15
+396,15
@@
public class AlignViewport
}
}
- static ConservationThread conservationThread;
+ ConservationThread conservationThread;
- static ConsensusThread consensusThread;
+ ConsensusThread consensusThread;
boolean consUpdateNeeded = false;
boolean consUpdateNeeded = false;
- boolean updatingConsensus = false;
+ static boolean updatingConsensus = false;
- boolean updatingConservation = false;
+ static boolean updatingConservation = false;
/**
* DOCUMENT ME!
/**
* DOCUMENT ME!
@@
-399,21
+414,8
@@
public class AlignViewport
if (alignment.isNucleotide() || conservation==null)
return;
if (alignment.isNucleotide() || conservation==null)
return;
- updatingConservation = true;
- // javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() {
- while (conservationThread != null && conservationThread.isAlive())
- {
- try
- {
- // Thread.sleep(100);
- ap.repaint();
- }
- catch (Exception ex)
- {}
- }
- conservationThread = new ConservationThread(ap);
- conservationThread.start();
- // } });
+ conservationThread = new ConservationThread(ap);
+ conservationThread.start();
}
/**
}
/**
@@
-421,22
+423,8
@@
public class AlignViewport
*/
public void updateConsensus(final AlignmentPanel ap)
{
*/
public void updateConsensus(final AlignmentPanel ap)
{
- updatingConsensus = true;
-
- // javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() {
- while (consensusThread != null && consensusThread.isAlive())
- {
- try
- {
- // Thread.sleep(100);
- ap.repaint();
- }
- catch (Exception ex)
- {}
- }
- consensusThread = new ConsensusThread(ap);
- consensusThread.start();
- // } });
+ consensusThread = new ConsensusThread(ap);
+ consensusThread.start();
}
}
@@
-449,6
+437,20
@@
public class AlignViewport
}
public void run()
{
}
public void run()
{
+ while (updatingConsensus)
+ {
+ try
+ {
+ Thread.sleep(200);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ updatingConsensus = true;
+
try
{
int aWidth = alignment.getWidth();
try
{
int aWidth = alignment.getWidth();
@@
-1510,6
+1512,7
@@
public class AlignViewport
resetAllColourSchemes();
alignment.adjustSequenceAnnotations();
resetAllColourSchemes();
alignment.adjustSequenceAnnotations();
+
}
}