X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fjws2%2FMsaWSThread.java;h=611aa79bb599429a0484532692b1dc26a20fcc8b;hb=bc1a3842b31a35a7794f4afec4911ad421c7c3e4;hp=89cf024a30c40ee4867496cf68323ed38c85ab93;hpb=1498662aa27c17a6db8e79edcfa4e9891e4437d2;p=jalview.git diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index 89cf024..611aa79 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -21,7 +21,7 @@ package jalview.ws.jws2; import jalview.analysis.AlignSeq; -import jalview.bin.Cache; +import jalview.bin.Console; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.AlignmentOrder; @@ -574,7 +574,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI { cancelledMessage += ("\nProblems cancelling the job : Exception received...\n" + exc + "\n"); - Cache.log.warn( + Console.warn( "Exception whilst cancelling " + jobs[job].getJobId(), exc); } @@ -667,9 +667,9 @@ class MsaWSThread extends AWS2Thread implements WSClientI MsaWSJob j = (MsaWSJob) job; if (j.isSubmitted()) { - if (Cache.log.isDebugEnabled()) + if (Console.isDebugEnabled()) { - Cache.log.debug( + Console.debug( "Tried to submit an already submitted job " + j.getJobId()); } return; @@ -703,7 +703,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI { j.setSubmitted(true); j.setSubjobComplete(false); - // System.out.println(WsURL + " Job Id '" + jobId + "'"); + // jalview.bin.Console.outPrintln(WsURL + " Job Id '" + jobId + "'"); return; } else @@ -749,7 +749,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI } catch (Error e) { // For unexpected errors - System.err.println(WebServiceName + jalview.bin.Console.errPrintln(WebServiceName + "Client: Failed to submit the sequences for alignment (probably a server side problem)\n" + "When contacting Server:" + WsUrl + "\n"); e.printStackTrace(System.err); @@ -759,7 +759,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI } catch (Exception e) { // For unexpected errors - System.err.println(WebServiceName + jalview.bin.Console.errPrintln(WebServiceName + "Client: Failed to submit the sequences for alignment (probably a server side problem)\n" + "When contacting Server:" + WsUrl + "\n"); e.printStackTrace(System.err); @@ -811,7 +811,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI } catch (Exception e) { - Cache.log.warn( + Console.warn( "Exception when retrieving remaining Job progress data for job " + msjob.getJobId() + " on server " + WsUrl); e.printStackTrace(); @@ -835,12 +835,12 @@ class MsaWSThread extends AWS2Thread implements WSClientI } } while (nunchanged > 0 && nexcept > 0); - if (Cache.log.isDebugEnabled()) + if (Console.isDebugEnabled()) { - System.out.println("Job Execution file for job: " + jalview.bin.Console.outPrintln("Job Execution file for job: " + msjob.getJobId() + " on server " + WsUrl); - System.out.println(msjob.getStatus()); - System.out.println("*** End of status"); + jalview.bin.Console.outPrintln(msjob.getStatus()); + jalview.bin.Console.outPrintln("*** End of status"); } try @@ -850,7 +850,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI { // job has failed for some reason - probably due to invalid // parameters - Cache.log.debug( + Console.debug( "Results not available for finished job - marking as broken job.", e); msjob.jobProgress.append( @@ -859,7 +859,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI msjob.setjobStatus(JobStatus.FAILED); } catch (Exception e) { - Cache.log.error("Couldn't get Alignment for job.", e); + Console.error("Couldn't get Alignment for job.", e); // TODO: Increment count and retry ? msjob.setjobStatus(JobStatus.UNDEFINED); } @@ -887,7 +887,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI } catch (Exception ex) { - Cache.log.error( + Console.error( "Unexpected exception when processing results for " + alTitle, ex); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); @@ -974,30 +974,19 @@ class MsaWSThread extends AWS2Thread implements WSClientI { al.setDataset(dataset); } + propagateDatasetMappings(al); - Alignment complement=null; - if (input.hasComplementView()) - { - Object[] newcompl = input - .getComplementView() - .getAlignmentAndHiddenColumns(getRequestingAlignFrame() - .getViewport().getCodingComplement().getGapCharacter()); - complement = new Alignment((SequenceI[])newcompl[0]); - complement.setHiddenColumns((HiddenColumns) newcompl[1]); - complement.setDataset(dataset); - complement.alignAs(al); - } // JBNote- TODO: warn user if a block is input rather than aligned data ? if (newFrame) { - displayInNewFrame(al, alorders, hidden, complement); + displayInNewFrame(al, alorders, hidden); } else { // TODO 2.9.x feature - System.out.println("MERGE WITH OLD FRAME"); + jalview.bin.Console.outPrintln("MERGE WITH OLD FRAME"); // TODO: modify alignment in original frame, replacing old for new // alignment using the commands.EditCommand model to ensure the update can // be undone @@ -1009,11 +998,10 @@ class MsaWSThread extends AWS2Thread implements WSClientI * * @param al * @param alorders - * @param complement2 * @param columnselection */ protected void displayInNewFrame(AlignmentI al, - List alorders, HiddenColumns hidden, AlignmentI complement) + List alorders, HiddenColumns hidden) { AlignFrame af = new AlignFrame(al, hidden, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); @@ -1033,18 +1021,26 @@ class MsaWSThread extends AWS2Thread implements WSClientI * SplitFrame with the other pane similarly aligned. */ AlignFrame requestedBy = getRequestingAlignFrame(); - if (complement!=null && requestedBy != null && requestedBy.getSplitViewContainer() != null + if (requestedBy != null && requestedBy.getSplitViewContainer() != null && requestedBy.getSplitViewContainer() .getComplement(requestedBy) != null) { + AlignmentI complement = requestedBy.getSplitViewContainer() + .getComplement(requestedBy); String complementTitle = requestedBy.getSplitViewContainer() .getComplementTitle(requestedBy); // becomes null if the alignment window was closed before the alignment // job finished. - if (complement.getHeight() > 0) + AlignmentI copyComplement = new Alignment(complement); + // todo should this be done by copy constructor? + copyComplement.setGapCharacter(complement.getGapCharacter()); + // share the same dataset (and the mappings it holds) + copyComplement.setDataset(complement.getDataset()); + copyComplement.alignAs(al); + if (copyComplement.getHeight() > 0) { af.setTitle(alTitle); - AlignFrame af2 = new AlignFrame(complement, + AlignFrame af2 = new AlignFrame(copyComplement, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); af2.setTitle(complementTitle); String linkedTitle = MessageManager