X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fworkers%2FInformationThread.java;h=c8084b92914453b61371ca22c1259ecd853a0fe4;hb=747167089ecf8d6afc70d417f5a20352e029bd95;hp=d35025b8b3f832b47a08d2556baf6f650467d27c;hpb=b8790847f686f6d31d2098c6b9804f8acc1041c9;p=jalview.git diff --git a/src/jalview/workers/InformationThread.java b/src/jalview/workers/InformationThread.java index d35025b..c8084b9 100644 --- a/src/jalview/workers/InformationThread.java +++ b/src/jalview/workers/InformationThread.java @@ -48,73 +48,34 @@ public class InformationThread extends AlignCalcWorker { return; } - if (calcMan.isPending(this)) + if (alignViewport.isClosed()) { + abortAndDestroy(); return; } - calcMan.notifyStart(this); - // long started = System.currentTimeMillis(); - try + AlignmentI alignment = alignViewport.getAlignment(); + int aWidth = alignment == null ? -1 : alignment.getWidth(); + if (aWidth < 0) { - if (calcMan.isPending(this)) - { - // another instance of this is waiting to run - calcMan.workerComplete(this); - return; - } - while (!calcMan.notifyWorking(this)) - { - // another thread in progress, wait my turn - try - { - if (ap != null) - { - ap.paintAlignment(false, false); - } - Thread.sleep(200); - } catch (Exception ex) - { - ex.printStackTrace(); - } - } - if (alignViewport.isClosed()) - { - abortAndDestroy(); - return; - } - - AlignmentI alignment = alignViewport.getAlignment(); - int aWidth = alignment == null ? -1 : alignment.getWidth(); - if (aWidth < 0) - { - calcMan.workerComplete(this); - return; - } + return; + } - /* - * compute information profiles for any HMM consensus sequences - * for the alignment or sub-groups - */ - computeProfiles(alignment); + /* + * compute information profiles for any HMM consensus sequences + * for the alignment or sub-groups + */ + computeProfiles(alignment); - /* - * construct the corresponding annotations - */ - updateAnnotation(); + /* + * construct the corresponding annotations + */ + updateAnnotation(); - if (ap != null) - { - ap.adjustAnnotationHeight(); - ap.paintAlignment(true, true); - } - } catch (OutOfMemoryError error) - { - calcMan.disableWorker(this); - ap.raiseOOMWarning("calculating information", error); - } finally + if (ap != null) { - calcMan.workerComplete(this); + ap.adjustAnnotationHeight(); + ap.paintAlignment(true, true); } } @@ -178,7 +139,7 @@ public class InformationThread extends AlignCalcWorker */ protected AlignmentAnnotation getGapAnnotation() { - return alignViewport.getOccupancyAnnotation(); + return alignViewport.getAlignmentGapAnnotation(); } /**