boolean gatherViewsHere = false;
+ Stack historyList = new Stack();
+ Stack redoList = new Stack();
+
/**
* Creates a new AlignViewport object.
*
globalColourScheme.setConsensus(hconsensus);
}
}
+
+ wrapAlignment = jalview.bin.Cache.getDefault("WRAP_ALIGNMENT", false);
}
{
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;
updateConservation(ap);
}
+ //Reset endRes of groups if beyond alignment width
+ int alWidth = alignment.getWidth();
+ Vector groups = alignment.getGroups();
+ if(groups!=null)
+ {
+ for(int i=0; i<groups.size(); i++)
+ {
+ SequenceGroup sg = (SequenceGroup)groups.elementAt(i);
+ if(sg.getEndRes()>alWidth)
+ sg.setEndRes(alWidth-1);
+ }
+ }
+
+ if(selectionGroup!=null && selectionGroup.getEndRes()>alWidth)
+ selectionGroup.setEndRes(alWidth-1);
+
resetAllColourSchemes();
alignment.adjustSequenceAnnotations();