{
try
{
+ updatingConservation = true;
+
+ while (UPDATING_CONSERVATION)
+ {
+ try
+ {
+ if (ap != null)
+ {
+ ap.repaint();
+ }
+ Thread.sleep(200);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ UPDATING_CONSERVATION = true;
+
+
int alWidth = alignment.getWidth();
if(alWidth<0)
return;
}
+ UPDATING_CONSERVATION = false;
+ updatingConservation = false;
+
if(ap!=null)
{
ap.repaint();
}
- updatingConservation = false;
+
}
}
- static ConservationThread conservationThread;
+ ConservationThread conservationThread;
- static ConsensusThread consensusThread;
+ ConsensusThread consensusThread;
boolean consUpdateNeeded = false;
+ static boolean UPDATING_CONSENSUS = false;
+
+ static boolean UPDATING_CONSERVATION = false;
+
boolean updatingConsensus = false;
boolean updatingConservation = false;
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();
}
/**
*/
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();
}
}
public void run()
{
+ updatingConsensus = true;
+ while (UPDATING_CONSENSUS)
+ {
+ try
+ {
+ if (ap != null)
+ {
+ ap.repaint();
+ }
+
+ Thread.sleep(200);
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+
+ UPDATING_CONSENSUS = true;
+
try
{
int aWidth = alignment.getWidth();
}
catch (OutOfMemoryError error)
{
+ alignment.deleteAnnotation(consensus);
+
consensus = null;
hconsensus = null;
javax.swing.SwingUtilities.invokeLater(new Runnable()
System.out.println("Consensus calculation: " + error);
System.gc();
}
+ UPDATING_CONSENSUS = false;
+ updatingConsensus = false;
if (ap != null)
{
ap.repaint();
}
-
-
- updatingConsensus = false;
}
}
/**
seqs.append(consensus.annotations[i].displayCharacter);
}
}
+
SequenceI sq = new Sequence("Consensus", seqs.toString());
sq.setDescription("Percentage Identity Consensus "+((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
return sq;
resetAllColourSchemes();
alignment.adjustSequenceAnnotations();
+
}