From c932f0e85a8852824cdd8ce790af68682732c85c Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 10 Aug 2023 16:31:15 +0100 Subject: [PATCH] JAL-629 Change all stdout and stderr output to use Console.outPrintln and Console.errPrintln. Fix command line tests. Add test for STDOUT output file. --- src/jalview/analysis/AAFrequency.java | 6 +- src/jalview/analysis/AlignSeq.java | 8 +- src/jalview/analysis/AlignmentSorter.java | 8 +- src/jalview/analysis/AlignmentUtils.java | 14 +- src/jalview/analysis/Conservation.java | 6 +- src/jalview/analysis/CrossRef.java | 12 +- src/jalview/analysis/Dna.java | 2 +- src/jalview/analysis/GeneticCodes.java | 8 +- src/jalview/analysis/Grouping.java | 4 +- src/jalview/analysis/ParseProperties.java | 2 +- src/jalview/analysis/Rna.java | 6 +- src/jalview/analysis/SeqsetUtils.java | 6 +- src/jalview/analysis/StructureFrequency.java | 2 +- src/jalview/analysis/TreeEngine.java | 2 +- src/jalview/analysis/TreeModel.java | 14 +- .../analysis/scoremodels/FeatureDistanceModel.java | 2 +- src/jalview/analysis/scoremodels/ScoreMatrix.java | 4 +- src/jalview/analysis/scoremodels/ScoreModels.java | 4 +- src/jalview/appletgui/APopupMenu.java | 4 +- src/jalview/appletgui/AlignFrame.java | 32 ++--- src/jalview/appletgui/AlignViewport.java | 8 +- src/jalview/appletgui/AlignmentPanel.java | 12 +- src/jalview/appletgui/AppletJmol.java | 10 +- src/jalview/appletgui/ExtJmol.java | 2 +- src/jalview/appletgui/PCAPanel.java | 2 +- src/jalview/appletgui/PairwiseAlignPanel.java | 6 +- src/jalview/appletgui/RedundancyPanel.java | 2 +- src/jalview/appletgui/RotatableCanvas.java | 6 +- src/jalview/appletgui/SeqPanel.java | 6 +- src/jalview/appletgui/TreePanel.java | 2 +- src/jalview/bin/Cache.java | 45 ++++--- src/jalview/bin/Console.java | 119 ++++++++++++---- src/jalview/bin/GetMemory.java | 2 +- src/jalview/bin/HiDPISetting.java | 10 +- src/jalview/bin/Jalview.java | 142 ++++++++++---------- src/jalview/bin/JalviewLite.java | 126 ++++++++--------- src/jalview/bin/JalviewLiteURLRetrieve.java | 20 +-- src/jalview/bin/JalviewTaskbar.java | 2 +- src/jalview/bin/Launcher.java | 8 +- src/jalview/bin/MemorySetting.java | 4 +- src/jalview/bin/argparser/BootstrapArgs.java | 7 +- src/jalview/commands/EditCommand.java | 6 +- src/jalview/datamodel/AlignedCodonFrame.java | 2 +- src/jalview/datamodel/AlignmentAnnotation.java | 16 +-- src/jalview/datamodel/AlignmentView.java | 34 ++--- src/jalview/datamodel/HiddenSequences.java | 4 +- src/jalview/datamodel/SearchResults.java | 2 +- src/jalview/datamodel/Sequence.java | 4 +- src/jalview/datamodel/SequenceGroup.java | 2 +- src/jalview/datamodel/features/FeatureMatcher.java | 8 +- .../datamodel/features/FeatureMatcherSet.java | 10 +- src/jalview/datamodel/features/FeatureStore.java | 4 +- .../datamodel/features/SequenceFeatures.java | 2 +- src/jalview/ext/ensembl/EnsemblGene.java | 2 +- src/jalview/ext/ensembl/EnsemblLookup.java | 2 +- src/jalview/ext/ensembl/EnsemblMap.java | 8 +- src/jalview/ext/ensembl/EnsemblRestClient.java | 18 +-- src/jalview/ext/ensembl/EnsemblSeqProxy.java | 18 +-- src/jalview/ext/htsjdk/HtsContigDb.java | 2 +- src/jalview/ext/jmol/JalviewJmolBinding.java | 22 +-- src/jalview/ext/jmol/JmolParser.java | 4 +- src/jalview/ext/paradise/Annotate3D.java | 2 +- src/jalview/ext/pymol/PymolManager.java | 2 +- src/jalview/ext/rbvi/chimera/ChimeraListener.java | 6 +- .../ext/rbvi/chimera/JalviewChimeraBinding.java | 6 +- src/jalview/fts/core/FTSDataColumnPreferences.java | 4 +- .../fts/service/alphafold/AlphafoldRestClient.java | 2 +- src/jalview/fts/service/pdb/PDBFTSRestClient.java | 10 +- .../service/threedbeacons/TDBeaconsFTSPanel.java | 2 +- .../threedbeacons/TDBeaconsFTSRestClient.java | 6 +- .../fts/service/uniprot/UniProtFTSRestClient.java | 6 +- src/jalview/gui/AlignFrame.java | 26 ++-- src/jalview/gui/AlignmentPanel.java | 2 +- src/jalview/gui/AnnotationLabels.java | 4 +- src/jalview/gui/AnnotationPanel.java | 4 +- src/jalview/gui/AppJmol.java | 6 +- src/jalview/gui/AppVarna.java | 2 +- src/jalview/gui/AppVarnaBinding.java | 2 +- src/jalview/gui/BlogReader.java | 2 +- src/jalview/gui/ChimeraViewFrame.java | 2 +- src/jalview/gui/ColourMenuHelper.java | 2 +- src/jalview/gui/Console.java | 8 +- src/jalview/gui/CrossRefAction.java | 4 +- src/jalview/gui/Desktop.java | 10 +- src/jalview/gui/FeatureSettings.java | 4 +- src/jalview/gui/FeatureTypeSettings.java | 2 +- src/jalview/gui/Help.java | 2 +- src/jalview/gui/JDatabaseTree.java | 4 +- src/jalview/gui/JvOptionPane.java | 2 +- src/jalview/gui/OptsAndParamsPage.java | 4 +- src/jalview/gui/PaintRefresher.java | 2 +- src/jalview/gui/PairwiseAlignPanel.java | 10 +- src/jalview/gui/PopupMenu.java | 2 +- src/jalview/gui/ProgressBar.java | 2 +- src/jalview/gui/PymolBindingModel.java | 2 +- src/jalview/gui/RedundancyPanel.java | 2 +- src/jalview/gui/RestInputParamEditDialog.java | 6 +- src/jalview/gui/RestServiceEditorPane.java | 6 +- src/jalview/gui/SeqCanvas.java | 8 +- src/jalview/gui/SeqCanvas.java.broken | 2 +- src/jalview/gui/SeqPanel.java | 8 +- src/jalview/gui/SequenceFetcher.java | 2 +- src/jalview/gui/SplashScreen.java | 4 +- src/jalview/gui/StructureChooser.java | 2 +- src/jalview/gui/StructureViewerBase.java | 2 +- src/jalview/gui/TreePanel.java | 6 +- src/jalview/gui/VamsasApplication.java | 4 +- src/jalview/gui/WebserviceInfo.java | 2 +- src/jalview/gui/WsJobParameters.java | 44 +++--- .../PDBStructureChooserQuerySource.java | 4 +- .../StructureChooserQuerySource.java | 2 +- .../gui/structurechooser/TDBResultAnalyser.java | 2 +- .../ThreeDBStructureChooserQuerySource.java | 2 +- src/jalview/httpserver/AbstractRequestHandler.java | 14 +- src/jalview/httpserver/HttpServer.java | 16 +-- src/jalview/io/AnnotationFile.java | 18 +-- src/jalview/io/AppletFormatAdapter.java | 48 +++---- src/jalview/io/BackupFilenameFilter.java | 2 +- src/jalview/io/BioJsHTMLOutput.java | 4 +- src/jalview/io/ClustalFile.java | 4 +- src/jalview/io/FeaturesFile.java | 18 +-- src/jalview/io/FileFormats.java | 2 +- src/jalview/io/FileLoader.java | 14 +- src/jalview/io/FileParse.java | 4 +- src/jalview/io/HTMLOutput.java | 2 +- src/jalview/io/HtmlSvgOutput.java | 2 +- src/jalview/io/JPredFile.java | 12 +- src/jalview/io/JSONFile.java | 2 +- src/jalview/io/JalviewFileChooser.java | 6 +- src/jalview/io/JalviewFileView.java | 2 +- src/jalview/io/MSFfile.java | 6 +- src/jalview/io/NewickFile.java | 40 +++--- src/jalview/io/PIRFile.java | 2 +- src/jalview/io/PfamFile.java | 2 +- src/jalview/io/PhylipFile.java | 2 +- src/jalview/io/RnamlFile.java | 4 +- src/jalview/io/SequenceAnnotationReport.java | 4 +- src/jalview/io/SimpleBlastFile.java | 4 +- src/jalview/io/StockholmFile.java | 22 +-- src/jalview/io/StructureFile.java | 6 +- src/jalview/io/TCoffeeScoreFile.java | 2 +- src/jalview/io/VamsasAppDatastore.java | 16 +-- src/jalview/io/WSWUBlastClient.java | 8 +- src/jalview/io/cache/JvCacheableInputBox.java | 2 +- src/jalview/io/gff/ExonerateHelper.java | 10 +- src/jalview/io/gff/Gff3Helper.java | 8 +- src/jalview/io/gff/GffHelperBase.java | 12 +- src/jalview/io/gff/SequenceOntologyLite.java | 2 +- src/jalview/io/packed/JalviewDataset.java | 2 +- src/jalview/io/packed/ParsePackedSet.java | 12 +- src/jalview/io/vamsas/Sequencemapping.java | 2 +- src/jalview/io/vamsas/Tree.java | 4 +- src/jalview/io/vcf/VCFLoader.java | 6 +- src/jalview/javascript/JSFunctionExec.java | 8 +- src/jalview/javascript/JsSelectionSender.java | 8 +- src/jalview/javascript/MouseOverListener.java | 4 +- .../javascript/MouseOverStructureListener.java | 10 +- src/jalview/jbgui/GAlignFrame.java | 2 +- src/jalview/jbgui/GDesktop.java | 6 +- src/jalview/jbgui/GStructureChooser.java | 12 +- src/jalview/log/JLogger.java | 4 +- src/jalview/math/Matrix.java | 4 +- src/jalview/math/RotatableMatrix.java | 2 +- src/jalview/project/Jalview2XML.java | 76 +++++------ src/jalview/renderer/AnnotationRenderer.java | 20 +-- src/jalview/rest/RestHandler.java | 2 +- src/jalview/schemes/ColourSchemeLoader.java | 2 +- src/jalview/schemes/ColourSchemes.java | 4 +- src/jalview/schemes/Consensus.java | 6 +- src/jalview/schemes/CovariationColourScheme.java | 12 +- src/jalview/schemes/FeatureColour.java | 10 +- src/jalview/schemes/RNAHelicesColour.java | 4 +- src/jalview/schemes/ResidueProperties.java | 8 +- src/jalview/schemes/UserColourScheme.java | 4 +- .../structure/StructureSelectionManager.java | 16 +-- .../structures/models/AAStructureBindingModel.java | 2 +- src/jalview/urls/IdentifiersUrlProvider.java | 4 +- src/jalview/urls/UrlProvider.java | 2 +- src/jalview/util/AWTConsole.java | 8 +- src/jalview/util/ChannelProperties.java | 14 +- src/jalview/util/DBRefUtils.java | 2 +- src/jalview/util/GroupUrlLink.java | 40 +++--- src/jalview/util/HttpUtils.java | 2 +- src/jalview/util/LaunchUtils.java | 17 ++- src/jalview/util/Log4j.java | 2 +- src/jalview/util/Platform.java | 14 +- src/jalview/util/StringUtils.java | 10 +- src/jalview/util/UrlLink.java | 2 +- src/jalview/viewmodel/AlignmentViewport.java | 8 +- src/jalview/viewmodel/ViewportRanges.java | 4 +- src/jalview/workers/AlignCalcManager.java | 8 +- .../workers/AlignmentAnnotationFactory.java | 4 +- src/jalview/workers/ConsensusThread.java | 2 +- src/jalview/ws/AWSThread.java | 2 +- src/jalview/ws/DBRefFetcher.java | 14 +- src/jalview/ws/JobStateSummary.java | 2 +- src/jalview/ws/dbsources/EBIAlfaFold.java | 2 +- .../ws/dbsources/EbiFileRetrievedProxy.java | 2 +- src/jalview/ws/dbsources/EmblXmlSource.java | 16 +-- src/jalview/ws/dbsources/Pdb.java | 2 +- src/jalview/ws/ebi/EBIFetchClient.java | 10 +- src/jalview/ws/jws1/Annotate3D.java | 46 +++---- src/jalview/ws/jws1/Discoverer.java | 4 +- src/jalview/ws/jws1/JPredThread.java | 2 +- src/jalview/ws/jws1/MsaWSThread.java | 10 +- src/jalview/ws/jws1/SeqSearchWSThread.java | 18 +-- src/jalview/ws/jws2/AbstractJabaCalcWorker.java | 12 +- src/jalview/ws/jws2/JabaParamStore.java | 2 +- src/jalview/ws/jws2/JabaWsServerQuery.java | 16 +-- src/jalview/ws/jws2/JabawsCalcWorker.java | 2 +- .../ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java | 2 +- src/jalview/ws/jws2/Jws2Discoverer.java | 8 +- src/jalview/ws/jws2/MsaWSThread.java | 14 +- src/jalview/ws/jws2/ParameterUtils.java | 4 +- src/jalview/ws/jws2/jabaws2/Jws2Instance.java | 6 +- src/jalview/ws/rest/InputType.java | 2 +- src/jalview/ws/rest/RestClient.java | 4 +- src/jalview/ws/rest/RestJobThread.java | 6 +- src/jalview/ws/seqfetcher/ASequenceFetcher.java | 20 +-- src/jalview/ws/sifts/SiftsClient.java | 26 ++-- src/jalview/ws/utils/UrlDownloadClient.java | 6 +- test/jalview/bin/CommandLineOperations.java | 20 ++- test/jalview/bin/CommandLineOperationsNG.java | 55 ++++++++ test/jalview/bin/CommandsTest.java | 59 ++++---- test/jalview/bin/uniref50-output.fa | 60 +++++++++ 225 files changed, 1245 insertions(+), 1047 deletions(-) create mode 100644 test/jalview/bin/uniref50-output.fa diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index b1505d6..6967885 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -147,7 +147,7 @@ public class AAFrequency { if (sequences[row] == null) { - System.err.println( + jalview.bin.Console.errPrintln( "WARNING: Consensus skipping null sequence - possible race condition."); continue; } @@ -188,7 +188,7 @@ public class AAFrequency } return new Profiles(result); // long elapsed = System.currentTimeMillis() - now; - // System.out.println(elapsed); + // jalview.bin.Console.outPrintln(elapsed); } /** @@ -285,7 +285,7 @@ public class AAFrequency ' ', value); } // long elapsed = System.currentTimeMillis() - now; - // System.out.println(-elapsed); + // jalview.bin.Console.outPrintln(-elapsed); } /** diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 02b3f41..e1d5669 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -826,7 +826,7 @@ public class AlignSeq } } - System.out.println(max + " " + min); + jalview.bin.Console.outPrintln(max + " " + min); for (int i = 0; i < n; i++) { @@ -835,12 +835,12 @@ public class AlignSeq int x = psize * i; int y = psize * j; - // System.out.println(mat[i][j]); + // jalview.bin.Console.outPrintln(mat[i][j]); float score = (float) (mat[i][j] - min) / (float) (max - min); g.setColor(new Color(score, 0, 0)); g.fillRect(x, y, psize, psize); - // System.out.println(x + " " + y + " " + score); + // jalview.bin.Console.outPrintln(x + " " + y + " " + score); } } } @@ -983,7 +983,7 @@ public class AlignSeq bestm = msq; } } - // System.out.println("Best Score for " + (matches.size() + 1) + " :" + // jalview.bin.Console.outPrintln("Best Score for " + (matches.size() + 1) + " :" // + bestscore); matches.add(bestm); aligns.add(bestaseq); diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index b02d49c..b037336 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -453,7 +453,7 @@ public class AlignmentSorter if (tmp.size() != nSeq) { - System.err.println("WARNING: tmp.size()=" + tmp.size() + " != nseq=" + jalview.bin.Console.errPrintln("WARNING: tmp.size()=" + tmp.size() + " != nseq=" + nSeq + " in getOrderByTree - tree contains sequences not in alignment"); } @@ -714,7 +714,7 @@ public class AlignmentSorter String msg = String.format( "Implementation Error - sortByFeature method must be either '%s' or '%s'", FEATURE_SCORE, FEATURE_DENSITY); - System.err.println(msg); + jalview.bin.Console.errPrintln(msg); return; } @@ -832,7 +832,7 @@ public class AlignmentSorter { // int nf = (feats[i] == null) ? 0 // : ((SequenceFeature[]) feats[i]).length; - // // System.err.println("Sorting on Score: seq " + + // // jalview.bin.Console.errPrintln("Sorting on Score: seq " + // seqs[i].getName() // + " Feats: " + nf + " Score : " + scores[i]); } @@ -847,7 +847,7 @@ public class AlignmentSorter int featureCount = feats[i] == null ? 0 : ((SequenceFeature[]) feats[i]).length; scores[i] = featureCount; - // System.err.println("Sorting on Density: seq "+seqs[i].getName()+ + // jalview.bin.Console.errPrintln("Sorting on Density: seq "+seqs[i].getName()+ // " Feats: "+featureCount+" Score : "+scores[i]); } QuickSort.sortByDouble(scores, seqs, sortByFeatureAscending); diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 6ab49b2..f470dc6 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -547,7 +547,7 @@ public class AlignmentUtils if (translated == null || !(aaRes == translated.charAt(0))) { // debug - // System.out.println(("Mismatch at " + i + "/" + aaResidue + ": " + // jalview.bin.Console.outPrintln(("Mismatch at " + i + "/" + aaResidue + ": " // + codon + "(" + translated + ") != " + aaRes)); return false; } @@ -698,7 +698,7 @@ public class AlignmentUtils * unmapped position; treat like a gap */ sourceGapMappedLength += ratio; - // System.err.println("Can't align: no codon mapping to residue " + // jalview.bin.Console.errPrintln("Can't align: no codon mapping to residue " // + sourceDsPos + "(" + sourceChar + ")"); // return; continue; @@ -883,7 +883,7 @@ public class AlignmentUtils { if (protein.isNucleotide() || !dna.isNucleotide()) { - System.err.println("Wrong alignment type in alignProteinAsDna"); + jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna"); return 0; } List unmappedProtein = new ArrayList<>(); @@ -908,7 +908,7 @@ public class AlignmentUtils { if (protein.isNucleotide() || !dna.isNucleotide()) { - System.err.println("Wrong alignment type in alignProteinAsDna"); + jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna"); return 0; } // todo: implement this @@ -988,7 +988,7 @@ public class AlignmentUtils .getLength() == mappedFromLength - 1); if (cdsLength != mappedToLength && !addStopCodon) { - System.err.println(String.format( + jalview.bin.Console.errPrintln(String.format( "Can't align cds as protein (length mismatch %d/%d): %s", cdsLength, mappedToLength, cdsSeq.getName())); } @@ -1162,7 +1162,7 @@ public class AlignmentUtils AlignedCodon codon = sequenceCodon.getValue(); if (codon.peptideCol > 1) { - System.err.println( + jalview.bin.Console.errPrintln( "Problem mapping protein with >1 unmapped start positions: " + seq.getName()); } @@ -2770,7 +2770,7 @@ public class AlignmentUtils fromRange[i + 1]); if (range == null) { - System.err.println("Error in mapping " + seqMap + " from " + jalview.bin.Console.errPrintln("Error in mapping " + seqMap + " from " + fromSeq.getName()); return false; } diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index cbc4dca..5bb0b09 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -243,13 +243,13 @@ public class Conservation } else { - System.out.println("SEQUENCE HAS BEEN DELETED!!!"); + jalview.bin.Console.outPrintln("SEQUENCE HAS BEEN DELETED!!!"); } } else { // JBPNote INFO level debug - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: calcSeqNum called with out of range sequence index for Alignment\n"); } } @@ -711,7 +711,7 @@ public class Conservation // tmp = ((max - tmp) * (size - cons2[j][23])) / size; tmp = ((max - tmp) * (size - cons2GapCounts[j])) / size; - // System.out.println(tmp+ " " + j); + // jalview.bin.Console.outPrintln(tmp+ " " + j); quality.setElementAt(Double.valueOf(tmp), j); if (tmp > newmax) diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 9b90ca5..41582b4 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -293,7 +293,7 @@ public class CrossRef if (matchInDataset != null && xref.getMap().getTo() != null && matchInDataset != xref.getMap().getTo()) { - System.err.println( + jalview.bin.Console.errPrintln( "Implementation problem (reopen JAL-2154): CrossRef.findInDataset seems to have recovered a different sequence than the one explicitly mapped for xref." + "Found:" + matchInDataset + "\nExpected:" + xref.getMap().getTo() + "\nFor xref:" @@ -424,7 +424,7 @@ public class CrossRef retrieved = sftch.getSequences(sourceRefs, !fromDna); } catch (Exception e) { - System.err.println( + jalview.bin.Console.errPrintln( "Problem whilst retrieving cross references for Sequence : " + seq.getName()); e.printStackTrace(); @@ -607,7 +607,7 @@ public class CrossRef String msg = "Mapping updated from " + ms.getName() + " to retrieved crossreference " + matched.getName(); - System.out.println(msg); + jalview.bin.Console.outPrintln(msg); List toRefs = map.getTo().getDBRefs(); if (toRefs != null) @@ -662,7 +662,7 @@ public class CrossRef cf.addMap(retrievedSequence, map.getTo(), map.getMap()); } catch (Exception e) { - System.err.println( + jalview.bin.Console.errPrintln( "Exception when consolidating Mapped sequence set..."); e.printStackTrace(System.err); } @@ -1029,7 +1029,7 @@ public class CrossRef } if (dataset.getSequences() == null) { - System.err.println("Empty dataset sequence set - NO VECTOR"); + jalview.bin.Console.errPrintln("Empty dataset sequence set - NO VECTOR"); return false; } List ds = dataset.getSequences(); @@ -1041,7 +1041,7 @@ public class CrossRef { if (nxt.getDatasetSequence() != null) { - System.err.println( + jalview.bin.Console.errPrintln( "Implementation warning: CrossRef initialised with a dataset alignment with non-dataset sequences in it! (" + nxt.getDisplayId(true) + " has ds reference " + nxt.getDatasetSequence().getDisplayId(true) diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 5dcf212..aa71eb7 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -653,7 +653,7 @@ public class Dna if (rf != 0) { final String errMsg = "trimming contigs for incomplete terminal codon."; - System.err.println(errMsg); + jalview.bin.Console.errPrintln(errMsg); // map and trim contigs to ORF region vc = scontigs.length - 1; lastnpos = vismapping.shift(lastnpos); // place npos in context of diff --git a/src/jalview/analysis/GeneticCodes.java b/src/jalview/analysis/GeneticCodes.java index 133cb3a..4c826b2 100644 --- a/src/jalview/analysis/GeneticCodes.java +++ b/src/jalview/analysis/GeneticCodes.java @@ -140,7 +140,7 @@ public final class GeneticCodes InputStream is = getClass().getResourceAsStream(fileName); if (is == null) { - System.err.println("Resource file not found: " + fileName); + jalview.bin.Console.errPrintln("Resource file not found: " + fileName); return; } BufferedReader dataIn = new BufferedReader(new InputStreamReader(is)); @@ -166,7 +166,7 @@ public final class GeneticCodes } if (codeTables.isEmpty()) { - System.err.println( + jalview.bin.Console.errPrintln( "No genetic code tables loaded, check format of file " + fileName); } @@ -190,7 +190,7 @@ public final class GeneticCodes InputStream is = getClass().getResourceAsStream(fileName); if (is == null) { - System.err.println("Resource file not found: " + fileName); + jalview.bin.Console.errPrintln("Resource file not found: " + fileName); return; } BufferedReader dataIn = new BufferedReader(new InputStreamReader(is)); @@ -208,7 +208,7 @@ public final class GeneticCodes } else { - System.err.println( + jalview.bin.Console.errPrintln( "Unexpected data in " + fileName + ": " + line); } } diff --git a/src/jalview/analysis/Grouping.java b/src/jalview/analysis/Grouping.java index 066814e..def5d5a 100644 --- a/src/jalview/analysis/Grouping.java +++ b/src/jalview/analysis/Grouping.java @@ -269,7 +269,7 @@ public class Grouping * seqs.length) { for (int i = 0; i < seqs.length; i++) { if (!hasScore[i]) * { scores[i] = (max + i); } else { int nf=(feats[i]==null) ? 0 * :((SequenceFeature[]) feats[i]).length; - * System.err.println("Sorting on Score: seq "+seqs[i].getName()+ + * jalview.bin.Console.errPrintln("Sorting on Score: seq "+seqs[i].getName()+ * " Feats: "+nf+" Score : "+scores[i]); } } } * * jalview.util.QuickSort.sort(scores, seqs); } else if @@ -280,7 +280,7 @@ public class Grouping * (int i=0;i 0) ? "_" + reps : ""), ScoreDescriptions[cols], null); an.setScore(score); - System.out.println(seqs[i].getName() + " score: '" + jalview.bin.Console.outPrintln(seqs[i].getName() + " score: '" + ScoreNames[cols] + "' = " + score); // DEBUG an.setSequenceRef(seqs[i]); seqs[i].addAlignmentAnnotation(an); diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 9649240..911ee04 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -421,8 +421,8 @@ public class Rna final int open = basePair.getBP5(); final int close = basePair.getBP3(); - // System.out.println("open " + open + " close " + close); - // System.out.println("lastclose " + lastclose + " lastopen " + lastopen); + // jalview.bin.Console.outPrintln("open " + open + " close " + close); + // jalview.bin.Console.outPrintln("lastclose " + lastclose + " lastopen " + lastopen); // we're moving from right to left based on closing pair /* @@ -441,7 +441,7 @@ public class Rna { int popen = bps.get(j).getBP5(); - // System.out.println("j " + j + " popen " + popen + " lastopen " + // jalview.bin.Console.outPrintln("j " + j + " popen " + popen + " lastopen " // +lastopen + " open " + open); if ((popen < lastopen) && (popen > open)) { diff --git a/src/jalview/analysis/SeqsetUtils.java b/src/jalview/analysis/SeqsetUtils.java index fdca89d..837462f 100755 --- a/src/jalview/analysis/SeqsetUtils.java +++ b/src/jalview/analysis/SeqsetUtils.java @@ -129,7 +129,7 @@ public class SeqsetUtils { if (sfeatures != null) { - System.err.println( + jalview.bin.Console.errPrintln( "Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible."); } sq.setDatasetSequence(seqds); @@ -244,7 +244,7 @@ public class SeqsetUtils { if (!quiet) { - System.err.println("Can't find '" + ((String) key) + jalview.bin.Console.errPrintln("Can't find '" + ((String) key) + "' in uniquified alignment"); } } @@ -252,7 +252,7 @@ public class SeqsetUtils } if (unmatched.size() > 0 && !quiet) { - System.err.println("Did not find matches for :"); + jalview.bin.Console.errPrintln("Did not find matches for :"); for (Enumeration i = unmatched.elements(); i .hasMoreElements(); System.out .println(((SequenceI) i.nextElement()).getName())) diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index c04df6c..3f5099b 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -148,7 +148,7 @@ public class StructureFrequency { if (sequences[j] == null) { - System.err.println( + jalview.bin.Console.errPrintln( "WARNING: Consensus skipping null sequence - possible race condition."); continue; } diff --git a/src/jalview/analysis/TreeEngine.java b/src/jalview/analysis/TreeEngine.java index daf7836..a7cbc25 100644 --- a/src/jalview/analysis/TreeEngine.java +++ b/src/jalview/analysis/TreeEngine.java @@ -214,7 +214,7 @@ public abstract class TreeEngine { // if (_lycount<_lylimit) // { - // System.err.println("Warning: depth of _recount greater than number of + // jalview.bin.Console.errPrintln("Warning: depth of _recount greater than number of // nodes."); // } if (nd == null) diff --git a/src/jalview/analysis/TreeModel.java b/src/jalview/analysis/TreeModel.java index 0e57a58..90fe089 100644 --- a/src/jalview/analysis/TreeModel.java +++ b/src/jalview/analysis/TreeModel.java @@ -353,13 +353,13 @@ public class TreeModel if ((nd.left() == null) && (nd.right() == null)) { - System.out.println("Leaf = " + ((SequenceI) nd.element()).getName()); - System.out.println("Dist " + nd.dist); - System.out.println("Boot " + nd.getBootstrap()); + jalview.bin.Console.outPrintln("Leaf = " + ((SequenceI) nd.element()).getName()); + jalview.bin.Console.outPrintln("Dist " + nd.dist); + jalview.bin.Console.outPrintln("Boot " + nd.getBootstrap()); } else { - System.out.println("Dist " + nd.dist); + jalview.bin.Console.outPrintln("Dist " + nd.dist); printNode((BinaryNode) nd.left()); printNode((BinaryNode) nd.right()); } @@ -480,10 +480,10 @@ public class TreeModel } else { - System.out.println(" name = " + ((SequenceI) nd.element()).getName()); + jalview.bin.Console.outPrintln(" name = " + ((SequenceI) nd.element()).getName()); } - System.out.println( + jalview.bin.Console.outPrintln( " dist = " + nd.dist + " " + nd.count + " " + nd.height); } @@ -513,7 +513,7 @@ public class TreeModel { // if (_lycount<_lylimit) // { - // System.err.println("Warning: depth of _recount greater than number of + // jalview.bin.Console.errPrintln("Warning: depth of _recount greater than number of // nodes."); // } if (nd == null) diff --git a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java index 9c2f6d1..bcc0855 100644 --- a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java +++ b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java @@ -63,7 +63,7 @@ public class FeatureDistanceModel extends DistanceScoreModel return instance; } catch (InstantiationException | IllegalAccessException e) { - System.err.println("Error in " + getClass().getName() + jalview.bin.Console.errPrintln("Error in " + getClass().getName() + ".getInstance(): " + e.getMessage()); return null; } catch (ReflectiveOperationException roe) diff --git a/src/jalview/analysis/scoremodels/ScoreMatrix.java b/src/jalview/analysis/scoremodels/ScoreMatrix.java index b206339..aa841ac 100644 --- a/src/jalview/analysis/scoremodels/ScoreMatrix.java +++ b/src/jalview/analysis/scoremodels/ScoreMatrix.java @@ -331,12 +331,12 @@ public class ScoreMatrix extends SimilarityScoreModel { if (c >= symbolIndex.length) { - System.err.println(String.format(BAD_ASCII_ERROR, c)); + jalview.bin.Console.errPrintln(String.format(BAD_ASCII_ERROR, c)); return 0; } if (d >= symbolIndex.length) { - System.err.println(String.format(BAD_ASCII_ERROR, d)); + jalview.bin.Console.errPrintln(String.format(BAD_ASCII_ERROR, d)); return 0; } diff --git a/src/jalview/analysis/scoremodels/ScoreModels.java b/src/jalview/analysis/scoremodels/ScoreModels.java index ebc9a26..d0f21bd 100644 --- a/src/jalview/analysis/scoremodels/ScoreModels.java +++ b/src/jalview/analysis/scoremodels/ScoreModels.java @@ -105,7 +105,7 @@ public class ScoreModels return sm; } catch (IOException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Error reading " + resourcePath + ": " + e.getMessage()); } return null; @@ -143,7 +143,7 @@ public class ScoreModels ScoreModelI sm2 = models.get(sm.getName()); if (sm2 != null) { - System.err.println("Warning: replacing score model " + sm2.getName()); + jalview.bin.Console.errPrintln("Warning: replacing score model " + sm2.getName()); } models.put(sm.getName(), sm); } diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index b860a36..413b0d4 100644 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -393,14 +393,14 @@ public class APopupMenu extends java.awt.PopupMenu urlLink = new UrlLink(link); } catch (Exception foo) { - System.err.println("Exception for URLLink '" + link + "': " + jalview.bin.Console.errPrintln("Exception for URLLink '" + link + "': " + foo.getMessage()); continue; } if (!urlLink.isValid()) { - System.err.println(urlLink.getInvalidMessage()); + jalview.bin.Console.errPrintln(urlLink.getInvalidMessage()); continue; } diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 0159bc7..4b858e1 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1577,7 +1577,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, /* * When we finally deprecate 1.1 compatibility, we can start to use * URLEncoder.encode(url,"UTF-8") and then we'll need this catch: catch - * (UnsupportedEncodingException ex) { System.err.println("WARNING - + * (UnsupportedEncodingException ex) { jalview.bin.Console.errPrintln("WARNING - * IMPLEMENTATION ERROR - UNSUPPORTED ENCODING EXCEPTION FOR "+url); * ex.printStackTrace(); } */ @@ -1586,7 +1586,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, url = viewport.applet.getCodeBase() + url; } catch (UnsupportedEncodingException ex) { - System.err.println( + jalview.bin.Console.errPrintln( "WARNING = IMPLEMENTATION ERROR - UNSUPPORTED ENCODING EXCEPTION FOR " + url); ex.printStackTrace(); @@ -2975,7 +2975,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray(); if (viewport.applet.debug) { - System.err.println("Sorting " + alorder.getOrder().size() + jalview.bin.Console.errPrintln("Sorting " + alorder.getOrder().size() + " in alignment '" + getTitle() + "'"); } AlignmentSorter.sortBy(viewport.getAlignment(), alorder); @@ -3061,7 +3061,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { if (viewport.applet == null) { - System.out.println("Not running as applet - no browser available."); + jalview.bin.Console.outPrintln("Not running as applet - no browser available."); } else { @@ -3977,12 +3977,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, viewer = (Viewer) jmolviewer; } catch (ClassCastException ex) { - System.err.println( + jalview.bin.Console.errPrintln( "Unsupported viewer object :" + jmolviewer.getClass()); } if (viewer == null) { - System.err.println("Can't use this object as a structure viewer:" + jalview.bin.Console.errPrintln("Can't use this object as a structure viewer:" + jmolviewer.getClass()); return null; } @@ -4127,7 +4127,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, chains = (String[]) sqch[1]; if (seqs == null || seqs.length == 0) { - System.err.println( + jalview.bin.Console.errPrintln( "JalviewLite.AlignFrame:newStructureView: No sequence to bind structure to."); } if (protocol == null) @@ -4142,7 +4142,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (protocol == null) { - System.err.println("Couldn't work out protocol to open structure: " + jalview.bin.Console.errPrintln("Couldn't work out protocol to open structure: " + pdb.getId()); return; } @@ -4154,7 +4154,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, .setMapping(seqs, chains, pdb.getFile(), protocol, null) == null) { - System.err.println("Failed to map " + pdb.getFile() + " (" + jalview.bin.Console.errPrintln("Failed to map " + pdb.getFile() + " (" + protocol + ") to any sequences"); } return; @@ -4176,7 +4176,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (ajm != null) { - System.err.println( + jalview.bin.Console.errPrintln( "Incremental adding and aligning structure to existing Jmol view not yet implemented."); // try and add the pdb structure // ajm.addS @@ -4201,7 +4201,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, SequenceI[][] seqs, String[][] chains, String[] protocols) { // TODO Auto-generated method stub - System.err.println("Aligned Structure View: Not yet implemented."); + jalview.bin.Console.errPrintln("Aligned Structure View: Not yet implemented."); } /** @@ -4258,9 +4258,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (!file.isValid()) { // TODO: raise dialog for gui - System.err.println("Problems parsing T-Coffee scores: " + jalview.bin.Console.errPrintln("Problems parsing T-Coffee scores: " + file.getWarningMessage()); - System.err.println("Origin was:\n" + source); + jalview.bin.Console.errPrintln("Origin was:\n" + source); return false; } @@ -4273,7 +4273,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, || aln.getWidth() != file.getWidth())) { // TODO: raise a dialog box here rather than bomb out. - System.err.println( + jalview.bin.Console.errPrintln( "The scores matrix does not match the alignment dimensions"); } @@ -4289,10 +4289,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } else { - System.err.println("Problems resolving T-Coffee scores:"); + jalview.bin.Console.errPrintln("Problems resolving T-Coffee scores:"); if (file.getWarningMessage() != null) { - System.err.println(file.getWarningMessage()); + jalview.bin.Console.errPrintln(file.getWarningMessage()); } } return false; diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index d64cd75..c1de259 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -77,14 +77,14 @@ public class AlignViewport extends AlignmentViewport } if (widthScale <= 1.0) { - System.err.println( + jalview.bin.Console.errPrintln( "Invalid alignment character width scaling factor (" + widthScale + "). Ignoring."); widthScale = 1; } if (JalviewLite.debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Alignment character width scaling factor is now " + widthScale); } @@ -100,14 +100,14 @@ public class AlignViewport extends AlignmentViewport } if (heightScale <= 1.0) { - System.err.println( + jalview.bin.Console.errPrintln( "Invalid alignment character height scaling factor (" + heightScale + "). Ignoring."); heightScale = 1; } if (JalviewLite.debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Alignment character height scaling factor is now " + heightScale); } diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index fd75296..71ddcef 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -363,7 +363,7 @@ public class AlignmentPanel extends Panel { if (JalviewLite.debug) {// DEBUG - System.out.println( + jalview.bin.Console.outPrintln( "DEBUG: scroll didn't happen - results not within alignment : " + seq.getStart() + "," + seq.getEnd()); } @@ -373,7 +373,7 @@ public class AlignmentPanel extends Panel { // DEBUG /* - * System.out.println("DEBUG: scroll: start=" + r[0] + + * jalview.bin.Console.outPrintln("DEBUG: scroll: start=" + r[0] + * " av.getStartRes()=" + av.getStartRes() + " end=" + r[1] + * " seq.end=" + seq.getEnd() + " av.getEndRes()=" + av.getEndRes() + * " hextent=" + hextent); @@ -555,7 +555,7 @@ public class AlignmentPanel extends Panel // this is called after loading new annotation onto alignment if (alignFrame.getSize().height == 0) { - System.out.println( + jalview.bin.Console.outPrintln( "adjustAnnotationHeight frame size zero NEEDS FIXING"); } fontChanged(); @@ -693,7 +693,7 @@ public class AlignmentPanel extends Panel if ((hextent + x) > width) { - System.err.println("hextent was " + hextent + " and x was " + x); + jalview.bin.Console.errPrintln("hextent was " + hextent + " and x was " + x); x = width - hextent; } @@ -710,7 +710,7 @@ public class AlignmentPanel extends Panel if (x < 0) { - System.err.println("x was " + x); + jalview.bin.Console.errPrintln("x was " + x); x = 0; } @@ -1111,7 +1111,7 @@ public class AlignmentPanel extends Panel public void raiseOOMWarning(String string, OutOfMemoryError error) { // TODO: JAL-960 - System.err.println("Out of memory whilst '" + string + "'"); + jalview.bin.Console.errPrintln("Out of memory whilst '" + string + "'"); error.printStackTrace(); } diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index b0722c0..cca9aff 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -275,7 +275,7 @@ public class AppletJmol extends EmbmenuFrame implements "-applet", scriptWindow, null); } catch (Exception e) { - System.err.println( + jalview.bin.Console.errPrintln( "Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase=" + ap.av.applet.getDocumentBase() + "\nCodebase=" + ap.av.applet.getCodeBase()); @@ -320,7 +320,7 @@ public class AppletJmol extends EmbmenuFrame implements { if (jalview.bin.JalviewLite.debug) { - System.err.println( + jalview.bin.Console.errPrintln( "AppletJmol:Trying to reuse existing PDBfile IO parser."); } // re-use the one we opened earlier @@ -330,7 +330,7 @@ public class AppletJmol extends EmbmenuFrame implements { if (jalview.bin.JalviewLite.debug) { - System.err.println( + jalview.bin.Console.errPrintln( "AppletJmol:Creating new PDBfile IO parser."); } FileParse fp = new FileParse(pdbentry.getFile(), protocol); @@ -355,7 +355,7 @@ public class AppletJmol extends EmbmenuFrame implements } catch (Exception e) { // give up! - System.err.println("Couldn't access pdbentry id=" + jalview.bin.Console.errPrintln("Couldn't access pdbentry id=" + pdbentry.getId() + " and file=" + pdbentry.getFile() + " using protocol=" + protocol); e.printStackTrace(); @@ -433,7 +433,7 @@ public class AppletJmol extends EmbmenuFrame implements } catch (OutOfMemoryError ex) { frame.dispose(); - System.err.println( + jalview.bin.Console.errPrintln( "Out of memory when trying to create dialog box with sequence-structure mapping."); return; } diff --git a/src/jalview/appletgui/ExtJmol.java b/src/jalview/appletgui/ExtJmol.java index 47f9df0..e2b8f23 100644 --- a/src/jalview/appletgui/ExtJmol.java +++ b/src/jalview/appletgui/ExtJmol.java @@ -154,7 +154,7 @@ public class ExtJmol extends JalviewJmolBinding { // This never gets called because we haven't overriden the associated Jmol's // console - System.err.println( + jalview.bin.Console.errPrintln( "WARNING: unexpected call to ExtJmol's showConsole method. (showConsole=" + show); } diff --git a/src/jalview/appletgui/PCAPanel.java b/src/jalview/appletgui/PCAPanel.java index 7c0dfa9..7730210 100644 --- a/src/jalview/appletgui/PCAPanel.java +++ b/src/jalview/appletgui/PCAPanel.java @@ -145,7 +145,7 @@ public class PCAPanel extends EmbmenuFrame top = pcaModel.getTop(); } catch (OutOfMemoryError x) { - System.err.println("Out of memory when calculating PCA."); + jalview.bin.Console.errPrintln("Out of memory when calculating PCA."); return; } calcSettings.setEnabled(true); diff --git a/src/jalview/appletgui/PairwiseAlignPanel.java b/src/jalview/appletgui/PairwiseAlignPanel.java index bc775c6..566aad9 100644 --- a/src/jalview/appletgui/PairwiseAlignPanel.java +++ b/src/jalview/appletgui/PairwiseAlignPanel.java @@ -102,7 +102,7 @@ public class PairwiseAlignPanel extends Panel implements ActionListener if (count > 2) { - System.out.println( + jalview.bin.Console.outPrintln( "Pairwise alignment scaled similarity score matrix\n"); for (int i = 0; i < count; i++) @@ -111,7 +111,7 @@ public class PairwiseAlignPanel extends Panel implements ActionListener ("" + i) + " " + seqs[i].getName()); } - System.out.println("\n"); + jalview.bin.Console.outPrintln("\n"); for (int i = 0; i < count; i++) { @@ -122,7 +122,7 @@ public class PairwiseAlignPanel extends Panel implements ActionListener } } - System.out.println("\n"); + jalview.bin.Console.outPrintln("\n"); } } diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index bd36b0d..a5b652f 100644 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -148,7 +148,7 @@ public class RedundancyPanel extends SliderPanel validate(); sliderValueChanged(); - // System.out.println("blob done "+ (System.currentTimeMillis()-start)); + // jalview.bin.Console.outPrintln("blob done "+ (System.currentTimeMillis()-start)); } void sliderValueChanged() diff --git a/src/jalview/appletgui/RotatableCanvas.java b/src/jalview/appletgui/RotatableCanvas.java index a870ca4..87266b4 100755 --- a/src/jalview/appletgui/RotatableCanvas.java +++ b/src/jalview/appletgui/RotatableCanvas.java @@ -145,7 +145,7 @@ public class RotatableCanvas extends Panel implements MouseListener, scale = findScale(); - // System.out.println("Scale factor = " + scale); + // jalview.bin.Console.outPrintln("Scale factor = " + scale); addMouseListener(this); addKeyListener(this); @@ -301,7 +301,7 @@ public class RotatableCanvas extends Panel implements MouseListener, scale = findScale(); - // System.out.println("New scale = " + scale); + // jalview.bin.Console.outPrintln("New scale = " + scale); img = createImage(getSize().width, getSize().height); ig = img.getGraphics(); @@ -427,7 +427,7 @@ public class RotatableCanvas extends Panel implements MouseListener, } else if (evt.getKeyChar() == 's') { - System.err.println("DEBUG: Rectangle selection"); // log.debug + jalview.bin.Console.errPrintln("DEBUG: Rectangle selection"); // log.debug if (rectx2 != -1 && recty2 != -1) { rectSelect(rectx1, recty1, rectx2, recty2); diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 70366e4..c573612 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -772,7 +772,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, @Override public void updateColours(SequenceI seq, int index) { - System.out.println("update the seqPanel colours"); + jalview.bin.Console.outPrintln("update the seqPanel colours"); // repaint(); } @@ -1817,7 +1817,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (av.getAlignment() == null) { - System.out.println("Selection message: alignviewport av SeqSetId=" + jalview.bin.Console.outPrintln("Selection message: alignviewport av SeqSetId=" + av.getSequenceSetId() + " ViewId=" + av.getViewId() + " 's alignment is NULL! returning immediatly."); return; @@ -1869,7 +1869,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (copycolsel && av.hasHiddenColumns() && (av.getColumnSelection() == null)) { - System.err.println("Bad things"); + jalview.bin.Console.errPrintln("Bad things"); } if (repaint) { diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index 671fee1..0316e0b 100644 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -166,7 +166,7 @@ public class TreePanel extends EmbmenuFrame } else { - System.out.println("Original Tree Data not available"); + jalview.bin.Console.outPrintln("Original Tree Data not available"); } } diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 5741908..3750d9d 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -407,9 +407,9 @@ public class Cache fis = new URL(propertiesFile).openStream(); if (!Jalview.quiet()) { - System.out.println( + jalview.bin.Console.outPrintln( "Loading jalview properties from : " + propertiesFile); - System.out.println( + jalview.bin.Console.outPrintln( "Disabling Jalview writing to user's local properties file."); } propsAreReadOnly = true; @@ -440,7 +440,8 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println("Error reading properties file: " + ex); + jalview.bin.Console + .outPrintln("Error reading properties file: " + ex); } } @@ -497,7 +498,8 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println("Error reading author details: " + ex); + jalview.bin.Console + .outPrintln("Error reading author details: " + ex); authorDetails = null; } if (authorDetails == null) @@ -583,10 +585,10 @@ public class Cache { if (!Jalview.quiet()) { - System.out.println( + jalview.bin.Console.outPrintln( "Non-fatal exception when checking version at " + remoteBuildPropertiesUrl + ":"); - System.out.println(ex); + jalview.bin.Console.printStackTrace(ex); } remoteVersion = getProperty("VERSION"); } @@ -636,7 +638,7 @@ public class Cache url = Cache.class.getResource(resourcePath).toString(); } catch (Exception ex) { - System.err.println("Failed to resolve resource " + resourcePath + jalview.bin.Console.errPrintln("Failed to resolve resource " + resourcePath + ": " + ex.getMessage()); } } @@ -687,7 +689,8 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println("Error reading build details: " + ex); + jalview.bin.Console + .outPrintln("Error reading build details: " + ex); applicationProperties.remove("VERSION"); } String codeVersion = getProperty("VERSION"); @@ -707,8 +710,9 @@ public class Cache new BuildDetails(codeVersion, null, codeInstallation); if (printVersion && reportVersion) { - System.out.println(ChannelProperties.getProperty("app_name") - + " version: " + codeVersion + codeInstallation); + jalview.bin.Console + .outPrintln(ChannelProperties.getProperty("app_name") + + " version: " + codeVersion + codeInstallation); } } @@ -784,8 +788,8 @@ public class Cache } catch (NumberFormatException e) { if (!Jalview.quiet()) - System.out.println("Error parsing int property '" + property - + "' with value '" + string + "'"); + jalview.bin.Console.outPrintln("Error parsing int property '" + + property + "' with value '" + string + "'"); } } @@ -835,7 +839,7 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println( + jalview.bin.Console.outPrintln( "Error setting property: " + key + " " + obj + "\n" + ex); } return oldValue; @@ -867,7 +871,7 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println("Error saving properties: " + ex); + jalview.bin.Console.outPrintln("Error saving properties: " + ex); } } } @@ -1057,7 +1061,7 @@ public class Cache return date_format.parse(val); } catch (Exception ex) { - System.err.println("Invalid or corrupt date in property '" + jalview.bin.Console.errPrintln("Invalid or corrupt date in property '" + propertyName + "' : value was '" + val + "'"); } } @@ -1081,7 +1085,7 @@ public class Cache return Integer.valueOf(val); } catch (NumberFormatException x) { - System.err.println("Invalid integer in property '" + property + jalview.bin.Console.errPrintln("Invalid integer in property '" + property + "' (value was '" + val + "')"); } } @@ -1146,7 +1150,8 @@ public class Cache } catch (Exception ex) { if (!Jalview.quiet()) - System.out.println("Error loading User ColourFile\n" + ex); + jalview.bin.Console + .outPrintln("Error loading User ColourFile\n" + ex); } } if (!files.equals(coloursFound.toString())) @@ -1652,7 +1657,7 @@ public class Cache return null; if (!file.exists()) { - System.err.println("Could not load bootstrap preferences file '" + jalview.bin.Console.errPrintln("Could not load bootstrap preferences file '" + filename + "'"); return null; } @@ -1669,11 +1674,11 @@ public class Cache } } catch (FileNotFoundException e) { - System.err.println("Could not find bootstrap preferences file '" + jalview.bin.Console.errPrintln("Could not find bootstrap preferences file '" + file.getAbsolutePath() + "'"); } catch (IOException e) { - System.err.println( + jalview.bin.Console.errPrintln( "IOException when loading bootstrap preferences file '" + file.getAbsolutePath() + "'"); } diff --git a/src/jalview/bin/Console.java b/src/jalview/bin/Console.java index a280e88..c42d519 100644 --- a/src/jalview/bin/Console.java +++ b/src/jalview/bin/Console.java @@ -20,6 +20,7 @@ */ package jalview.bin; +import java.io.PrintStream; import java.util.Locale; import jalview.log.JLogger; @@ -43,8 +44,8 @@ public class Console } else { - outputMessage(message); - t.printStackTrace(); + outPrintln(message); + Console.printStackTrace(t); } } @@ -57,7 +58,7 @@ public class Console } else { - outputMessage(message); + outPrintln(message); } } @@ -70,8 +71,8 @@ public class Console } else { - outputMessage(message); - t.printStackTrace(); + outPrintln(message); + Console.printStackTrace(t); } } @@ -83,7 +84,7 @@ public class Console } else { - outputMessage(message); + outPrintln(message); } } @@ -96,8 +97,8 @@ public class Console } else { - outputMessage(message); - t.printStackTrace(); + outPrintln(message); + Console.printStackTrace(t); } } @@ -110,7 +111,7 @@ public class Console } else { - outputMessage(message); + outPrintln(message); } } @@ -123,7 +124,7 @@ public class Console } else { - outputMessage(message); + outPrintln(message); } } @@ -135,8 +136,8 @@ public class Console } else { - outputMessage(message); - t.printStackTrace(); + outPrintln(message); + Console.printStackTrace(t); } } @@ -149,7 +150,7 @@ public class Console } else { - System.err.println(message); + jalview.bin.Console.errPrintln(message); } } @@ -162,8 +163,8 @@ public class Console } else { - System.err.println(message); - t.printStackTrace(System.err); + jalview.bin.Console.errPrintln(message); + Console.printStackTrace(t); } } @@ -176,7 +177,7 @@ public class Console } else { - System.err.println(message); + jalview.bin.Console.errPrintln(message); } } @@ -189,8 +190,8 @@ public class Console } else { - System.err.println(message); - t.printStackTrace(System.err); + jalview.bin.Console.errPrintln(message); + Console.printStackTrace(t); } } @@ -253,7 +254,7 @@ public class Console { if (!Jalview.quiet()) { - System.err.println( + jalview.bin.Console.errPrintln( "Setting initial log level to " + logLevel.name()); } Log4j.init(logLevel); @@ -267,8 +268,9 @@ public class Console log = JLoggerLog4j.getLogger(Cache.JALVIEW_LOGGER_NAME, logLevel); } catch (NoClassDefFoundError e) { - System.err.println("Could not initialise the logger framework"); - e.printStackTrace(); + jalview.bin.Console + .errPrintln("Could not initialise the logger framework"); + Console.printStackTrace(e); } // Test message @@ -306,27 +308,86 @@ public class Console } } - public static void outputMessage(String message) + public static void outPrint() { - // send message to stderr if output to stdout is expected - if (Jalview.getInstance() != null + outPrint(""); + } + + public static void outPrintln() + { + outPrintln(""); + } + + public static void outPrint(Object message) + { + outPrintMessage(message, false, false); + } + + public static void outPrint(Object message, boolean forceStdout) + { + outPrintMessage(message, false, forceStdout); + } + + public static void outPrintln(Object message) + { + outPrintMessage(message, true, false); + } + + public static PrintStream outputStream(boolean forceStdout) + { + // send message to stderr if an output file to stdout is expected + if (!forceStdout && Jalview.getInstance() != null && Jalview.getInstance().bootstrapArgs != null && Jalview.getInstance().bootstrapArgs.outputToStdout()) { - System.err.println(message); + return System.err; + } + else + { + return System.out; + } + } + + public static void outPrintMessage(Object message, boolean newline, + boolean forceStdout) + { + PrintStream ps = outputStream(forceStdout); + if (newline) + { + ps.println(message); } else { - System.out.println(message); + ps.print(message); } } - public static void printStackTrace(Exception e) + public static void errPrint() + { + errPrint(""); + } + + public static void errPrintln() + { + errPrintln(""); + } + + public static void errPrint(Object message) + { + System.err.print(message); + } + + public static void errPrintln(Object message) + { + System.err.println(message); + } + + public static void printStackTrace(Throwable t) { // send message to stderr if output to stdout is expected - e.printStackTrace(System.err); + t.printStackTrace(System.err); } public final static String LOGGING_TEST_MESSAGE = "Logging to STDERR"; -} +} \ No newline at end of file diff --git a/src/jalview/bin/GetMemory.java b/src/jalview/bin/GetMemory.java index b01dfb8..5332704 100644 --- a/src/jalview/bin/GetMemory.java +++ b/src/jalview/bin/GetMemory.java @@ -61,7 +61,7 @@ class GetMemory } catch (NoClassDefFoundError e) { // com.sun.management.OperatingSystemMXBean doesn't exist in this JVM - System.err.println( + jalview.bin.Console.errPrintln( "No com.sun.management.OperatingSystemMXBean: cannot get total physical memory size"); } diff --git a/src/jalview/bin/HiDPISetting.java b/src/jalview/bin/HiDPISetting.java index 2bce673..3f57aed 100644 --- a/src/jalview/bin/HiDPISetting.java +++ b/src/jalview/bin/HiDPISetting.java @@ -117,7 +117,7 @@ public class HiDPISetting } } catch (NumberFormatException e) { - System.err.println(setHiDPIScalePropertyName + " property give (" + jalview.bin.Console.errPrintln(setHiDPIScalePropertyName + " property give (" + setHiDPIScaleProperty + ") but not parseable as integer"); } } @@ -135,7 +135,7 @@ public class HiDPISetting try { int existingPropertyVal = Integer.parseInt(existingProperty); - System.out.println("Existing " + scalePropertyName + " is " + jalview.bin.Console.outPrintln("Existing " + scalePropertyName + " is " + existingPropertyVal); if (existingPropertyVal > 1) { @@ -144,7 +144,7 @@ public class HiDPISetting } } catch (NumberFormatException e) { - System.out.println("Could not convert property " + scalePropertyName + jalview.bin.Console.outPrintln("Could not convert property " + scalePropertyName + " vale '" + existingProperty + "' to number"); } } @@ -159,7 +159,7 @@ public class HiDPISetting dpi = screenInfo.getScreenResolution(); } catch (HeadlessException e) { - System.err.println("Cannot get screen resolution: " + e.getMessage()); + jalview.bin.Console.errPrintln("Cannot get screen resolution: " + e.getMessage()); } // try and get screen size height and width @@ -171,7 +171,7 @@ public class HiDPISetting mindimension = Math.min(height, width); } catch (HeadlessException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Cannot get screen size height and width:" + e.getMessage()); } diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index e2b5bfb..e229079 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -274,7 +274,7 @@ public class Jalview * */ { - Console.outputMessage("not in js"); + Console.outPrintln("not in js"); } // BH - for event debugging in JavaScript (Java mode only) @@ -386,28 +386,27 @@ public class Jalview if (!quiet() || !bootstrapArgs.outputToStdout() || bootstrapArgs.contains(Arg.VERSION)) { - Console.outputMessage( + Console.outPrintln( "Java version: " + System.getProperty("java.version")); - Console.outputMessage( - "Java home: " + System.getProperty("java.home")); - Console.outputMessage("Java arch: " + System.getProperty("os.arch") - + " " + System.getProperty("os.name") + " " + Console.outPrintln("Java home: " + System.getProperty("java.home")); + Console.outPrintln("Java arch: " + System.getProperty("os.arch") + " " + + System.getProperty("os.name") + " " + System.getProperty("os.version")); String val = System.getProperty("sys.install4jVersion"); if (val != null) { - Console.outputMessage("Install4j version: " + val); + Console.outPrintln("Install4j version: " + val); } val = System.getProperty("installer_template_version"); if (val != null) { - Console.outputMessage("Install4j template version: " + val); + Console.outPrintln("Install4j template version: " + val); } val = System.getProperty("launcher_version"); if (val != null) { - Console.outputMessage("Launcher version: " + val); + Console.outPrintln("Launcher version: " + val); } } @@ -512,7 +511,7 @@ public class Jalview Cache.loadProperties(usrPropsFile); if (usrPropsFile != null) { - Console.outputMessage( + Console.outPrintln( "CMD [-props " + usrPropsFile + "] executed successfully!"); testoutput(bootstrapArgs, Arg.PROPS, "test/jalview/bin/testProps.jvprops", usrPropsFile); @@ -544,8 +543,8 @@ public class Jalview { List> helpArgs = bootstrapArgs .getList(Arg.HELP); - Console.outputMessage(Arg.usage(helpArgs.stream() - .map(e -> e.getKey()).collect(Collectors.toList()))); + Console.outPrintln(Arg.usage(helpArgs.stream().map(e -> e.getKey()) + .collect(Collectors.toList()))); Jalview.exit(null, 0); } if (aparser.contains("help") || aparser.contains("h")) @@ -554,7 +553,7 @@ public class Jalview * Now using new usage statement. showUsage(); */ - Console.outputMessage(Arg.usage()); + Console.outPrintln(Arg.usage()); Jalview.exit(null, 0); } @@ -584,13 +583,13 @@ public class Jalview try { Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl); - Console.outputMessage( + Console.outPrintln( "CMD [-jabaws " + jabawsUrl + "] executed successfully!"); testoutput(bootstrapArgs, Arg.JABAWS, "http://www.compbio.dundee.ac.uk/jabaws", jabawsUrl); } catch (MalformedURLException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Invalid jabaws parameter: " + jabawsUrl + " ignored"); } } @@ -620,7 +619,8 @@ public class Jalview } else { - System.err.println("Executing setprop argument: " + setprop); + jalview.bin.Console + .errPrintln("Executing setprop argument: " + setprop); if (Platform.isJS()) { Cache.setProperty(setprop.substring(0, p), @@ -752,8 +752,7 @@ public class Jalview } else { - Console.outputMessage( - "CMD [-nousagestats] executed successfully!"); + Console.outPrintln("CMD [-nousagestats] executed successfully!"); testoutput(argparser, Arg.NOUSAGESTATS); } @@ -769,7 +768,7 @@ public class Jalview // questionnaire Console.debug("Starting questionnaire url at " + url); desktop.checkForQuestionnaire(url); - Console.outputMessage("CMD questionnaire[-" + url + Console.outPrintln("CMD questionnaire[-" + url + "] executed successfully!"); } else @@ -790,7 +789,7 @@ public class Jalview } else { - Console.outputMessage( + Console.outPrintln( "CMD [-noquestionnaire] executed successfully!"); testoutput(argparser, Arg.QUESTIONNAIRE); } @@ -881,8 +880,7 @@ public class Jalview .getString("status.processing_commandline_args"), progress = System.currentTimeMillis()); } - Console.outputMessage( - "CMD [-open " + file + "] executed successfully!"); + Console.outPrintln("CMD [-open " + file + "] executed successfully!"); if (!Platform.isJS()) /** @@ -919,7 +917,7 @@ public class Jalview format); if (af == null) { - Console.outputMessage("error"); + Console.outPrintln("error"); } else { @@ -934,7 +932,7 @@ public class Jalview if (cs != null) { - Console.outputMessage( + Console.outPrintln( "CMD [-colour " + data + "] executed successfully!"); } af.changeColour(cs); @@ -946,8 +944,8 @@ public class Jalview { af.parseFeaturesFile(data, AppletFormatAdapter.checkProtocol(data)); - // Console.outputMessage("Added " + data); - Console.outputMessage( + // Console.outPrintln("Added " + data); + Console.outPrintln( "CMD groups[-" + data + "] executed successfully!"); } data = aparser.getValue("features", true); @@ -955,8 +953,8 @@ public class Jalview { af.parseFeaturesFile(data, AppletFormatAdapter.checkProtocol(data)); - // Console.outputMessage("Added " + data); - Console.outputMessage( + // Console.outPrintln("Added " + data); + Console.outPrintln( "CMD [-features " + data + "] executed successfully!"); } @@ -964,8 +962,8 @@ public class Jalview if (data != null) { af.loadJalviewDataFile(data, null, null, null); - // Console.outputMessage("Added " + data); - Console.outputMessage( + // Console.outPrintln("Added " + data); + Console.outPrintln( "CMD [-annotations " + data + "] executed successfully!"); } // set or clear the sortbytree flag. @@ -974,8 +972,7 @@ public class Jalview af.getViewport().setSortByTree(true); if (af.getViewport().getSortByTree()) { - Console.outputMessage( - "CMD [-sortbytree] executed successfully!"); + Console.outPrintln("CMD [-sortbytree] executed successfully!"); } } if (aparser.contains("no-annotation")) @@ -983,8 +980,7 @@ public class Jalview af.getViewport().setShowAnnotation(false); if (!af.getViewport().isShowAnnotation()) { - Console.outputMessage( - "CMD no-annotation executed successfully!"); + Console.outPrintln("CMD no-annotation executed successfully!"); } } if (aparser.contains("nosortbytree")) @@ -992,7 +988,7 @@ public class Jalview af.getViewport().setSortByTree(false); if (!af.getViewport().getSortByTree()) { - Console.outputMessage( + Console.outPrintln( "CMD [-nosortbytree] executed successfully!"); } } @@ -1001,7 +997,7 @@ public class Jalview { try { - Console.outputMessage( + Console.outPrintln( "CMD [-tree " + data + "] executed successfully!"); NewickFile nf = new NewickFile(data, AppletFormatAdapter.checkProtocol(data)); @@ -1009,7 +1005,7 @@ public class Jalview .setCurrentTree(af.showNewickTree(nf, data).getTree()); } catch (IOException ex) { - System.err.println("Couldn't add tree " + data); + jalview.bin.Console.errPrintln("Couldn't add tree " + data); ex.printStackTrace(System.err); } } @@ -1018,9 +1014,9 @@ public class Jalview { // Execute the groovy script after we've done all the rendering stuff // and before any images or figures are generated. - Console.outputMessage("Executing script " + groovyscript); + Console.outPrintln("Executing script " + groovyscript); executeGroovyScript(groovyscript, af); - Console.outputMessage("CMD groovy[" + groovyscript + Console.outPrintln("CMD groovy[" + groovyscript + "] executed successfully!"); groovyscript = null; } @@ -1034,14 +1030,14 @@ public class Jalview if (outputFormat.equalsIgnoreCase("png")) { - Console.outputMessage("Creating PNG image: " + file); + Console.outPrintln("Creating PNG image: " + file); af.createPNG(new File(file)); imageName = (new File(file)).getName(); continue; } else if (outputFormat.equalsIgnoreCase("svg")) { - Console.outputMessage("Creating SVG image: " + file); + Console.outPrintln("Creating SVG image: " + file); File imageFile = new File(file); imageName = imageFile.getName(); af.createSVG(imageFile); @@ -1053,7 +1049,7 @@ public class Jalview imageName = imageFile.getName(); HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel); - Console.outputMessage("Creating HTML image: " + file); + Console.outPrintln("Creating HTML image: " + file); htmlSVG.exportHTML(file); continue; } @@ -1061,7 +1057,8 @@ public class Jalview { if (file == null) { - System.err.println("The output html file must not be null"); + jalview.bin.Console.errPrintln( + "The output html file must not be null"); return; } try @@ -1073,21 +1070,21 @@ public class Jalview e.printStackTrace(); } BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel); - Console.outputMessage( + Console.outPrintln( "Creating BioJS MSA Viwer HTML file: " + file); bjs.exportHTML(file); continue; } else if (outputFormat.equalsIgnoreCase("imgMap")) { - Console.outputMessage("Creating image map: " + file); + Console.outPrintln("Creating image map: " + file); af.createImageMap(new File(file), imageName); continue; } else if (outputFormat.equalsIgnoreCase("eps")) { File outputFile = new File(file); - Console.outputMessage( + Console.outPrintln( "Creating EPS file: " + outputFile.getAbsolutePath()); af.createEPS(outputFile); continue; @@ -1099,14 +1096,14 @@ public class Jalview outFormat = FileFormats.getInstance().forName(outputFormat); } catch (Exception formatP) { - Console.outputMessage("Couldn't parse " + outFormat + Console.outPrintln("Couldn't parse " + outFormat + " as a valid Jalview format string."); } if (outFormat != null) { if (!outFormat.isWritable()) { - Console.outputMessage( + Console.outPrintln( "This version of Jalview does not support alignment export as " + outputFormat); } @@ -1115,19 +1112,19 @@ public class Jalview af.saveAlignment(file, outFormat); if (af.isSaveAlignmentSuccessful()) { - Console.outputMessage("Written alignment in " + Console.outPrintln("Written alignment in " + outFormat.getName() + " format to " + file); } else { - Console.outputMessage("Error writing file " + file - + " in " + outFormat.getName() + " format!!"); + Console.outPrintln("Error writing file " + file + " in " + + outFormat.getName() + " format!!"); } } } } catch (ImageOutputException ioexc) { - Console.outputMessage( + Console.outPrintln( "Unexpected error whilst exporting image to " + file); ioexc.printStackTrace(); } @@ -1136,7 +1133,7 @@ public class Jalview while (aparser.getSize() > 0) { - Console.outputMessage("Unknown arg: " + aparser.nextValue()); + Console.outPrintln("Unknown arg: " + aparser.nextValue()); } } } @@ -1204,12 +1201,12 @@ public class Jalview { if (Cache.groovyJarsPresent()) { - Console.outputMessage("Executing script " + groovyscript); + Console.outPrintln("Executing script " + groovyscript); executeGroovyScript(groovyscript, startUpAlframe); } else { - System.err.println( + jalview.bin.Console.errPrintln( "Sorry. Groovy Support is not available, so ignoring the provided groovy script " + groovyscript); } @@ -1554,7 +1551,7 @@ public class Jalview /* private static void showUsage() { - System.out.println( + jalview.bin.Console.outPrintln( "Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n" + "-nodisplay\tRun Jalview without User Interface.\n" + "-props FILE\tUse the given Jalview properties file instead of users default.\n" @@ -1665,9 +1662,10 @@ public class Jalview } catch (Exception ex) { - System.err.println("Failed to read from STDIN into tempfile " - + ((tfile == null) ? "(tempfile wasn't created)" - : tfile.toString())); + jalview.bin.Console + .errPrintln("Failed to read from STDIN into tempfile " + + ((tfile == null) ? "(tempfile wasn't created)" + : tfile.toString())); ex.printStackTrace(); return; } @@ -1676,7 +1674,7 @@ public class Jalview sfile = tfile.toURI().toURL(); } catch (Exception x) { - System.err.println( + jalview.bin.Console.errPrintln( "Unexpected Malformed URL Exception for temporary file created from STDIN: " + tfile.toURI()); x.printStackTrace(); @@ -1693,17 +1691,20 @@ public class Jalview tfile = new File(groovyscript); if (!tfile.exists()) { - System.err.println("File '" + groovyscript + "' does not exist."); + jalview.bin.Console.errPrintln( + "File '" + groovyscript + "' does not exist."); return; } if (!tfile.canRead()) { - System.err.println("File '" + groovyscript + "' cannot be read."); + jalview.bin.Console.errPrintln( + "File '" + groovyscript + "' cannot be read."); return; } if (tfile.length() < 1) { - System.err.println("File '" + groovyscript + "' is empty."); + jalview.bin.Console + .errPrintln("File '" + groovyscript + "' is empty."); return; } try @@ -1711,7 +1712,7 @@ public class Jalview sfile = tfile.getAbsoluteFile().toURI().toURL(); } catch (Exception ex) { - System.err.println("Failed to create a file URL for " + jalview.bin.Console.errPrintln("Failed to create a file URL for " + tfile.getAbsoluteFile()); return; } @@ -1736,8 +1737,9 @@ public class Jalview } } catch (Exception e) { - System.err.println("Exception Whilst trying to execute file " + sfile - + " as a groovy script."); + jalview.bin.Console + .errPrintln("Exception Whilst trying to execute file " + sfile + + " as a groovy script."); e.printStackTrace(System.err); } @@ -1793,11 +1795,11 @@ public class Jalview { if (exitcode == 0) { - Console.outputMessage(message); + Console.outPrintln(message); } else { - System.err.println(message); + jalview.bin.Console.errPrintln(message); } } } @@ -1889,7 +1891,7 @@ public class Jalview if (yes && ((s1 == null && s2 == null) || (s1 != null && s1.equals(s2)))) { - Console.outputMessage("[TESTOUTPUT] arg " + a.argString() + "='" + s1 + Console.outPrintln("[TESTOUTPUT] arg " + a.argString() + "='" + s1 + "' was set"); } } @@ -1947,6 +1949,6 @@ public class Jalview { message = a.argString() + (yes ? " was set" : " was not set"); } - Console.outputMessage("[TESTOUTPUT] arg " + message); + Console.outPrintln("[TESTOUTPUT] arg " + message); } } diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 7d66f6d..e8be95f 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -292,7 +292,7 @@ public class JalviewLite extends Applet { if (debug) { - System.err.println("Selecting region using separator string '" + jalview.bin.Console.errPrintln("Selecting region using separator string '" + separator + "'"); } } @@ -344,7 +344,7 @@ public class JalviewLite extends Applet from--; } catch (NumberFormatException ex) { - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: Couldn't parse first integer in range element column selection string '" + cl + "' - format is 'from-to'"); return; @@ -355,7 +355,7 @@ public class JalviewLite extends Applet to--; } catch (NumberFormatException ex) { - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: Couldn't parse second integer in range element column selection string '" + cl + "' - format is 'from-to'"); return; @@ -396,13 +396,13 @@ public class JalviewLite extends Applet } if (debug) { - System.err.println("Range '" + cl + "' deparsed as [" + from + jalview.bin.Console.errPrintln("Range '" + cl + "' deparsed as [" + from + "," + to + "]"); } } else { - System.err.println("ERROR: Invalid Range '" + cl + jalview.bin.Console.errPrintln("ERROR: Invalid Range '" + cl + "' deparsed as [" + from + "," + to + "]"); } } @@ -422,7 +422,7 @@ public class JalviewLite extends Applet } else { - System.err.println( + jalview.bin.Console.errPrintln( "ERROR: Couldn't parse integer from point selection element of column selection string '" + cl + "'"); return; @@ -451,13 +451,13 @@ public class JalviewLite extends Applet csel.addElement(r); if (debug) { - System.err.println("Point selection '" + cl + jalview.bin.Console.errPrintln("Point selection '" + cl + "' deparsed as [" + r + "]"); } } else { - System.err.println("ERROR: Invalid Point selection '" + cl + jalview.bin.Console.errPrintln("ERROR: Invalid Point selection '" + cl + "' deparsed as [" + r + "]"); } } @@ -940,7 +940,7 @@ public class JalviewLite extends Applet listener = listener.trim(); if (listener.length() == 0) { - System.err.println( + jalview.bin.Console.errPrintln( "jalview Javascript error: Ignoring empty function for mouseover listener."); return; } @@ -952,11 +952,11 @@ public class JalviewLite extends Applet .addStructureViewerListener(mol); if (debug) { - System.err.println("Added a mouseover listener for " + jalview.bin.Console.errPrintln("Added a mouseover listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport().getSequenceSetId())); - System.err.println("There are now " + javascriptListeners.size() + jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() + " listeners in total."); } } @@ -987,7 +987,7 @@ public class JalviewLite extends Applet listener = listener.trim(); if (listener.length() == 0) { - System.err.println( + jalview.bin.Console.errPrintln( "jalview Javascript error: Ignoring empty function for selection listener."); return; } @@ -999,11 +999,11 @@ public class JalviewLite extends Applet .addSelectionListener(mol); if (debug) { - System.err.println("Added a selection listener for " + jalview.bin.Console.errPrintln("Added a selection listener for " + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport().getSequenceSetId())); - System.err.println("There are now " + javascriptListeners.size() + jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() + " listeners in total."); } } @@ -1027,7 +1027,7 @@ public class JalviewLite extends Applet listener = listener.trim(); if (listener.length() == 0) { - System.err.println( + jalview.bin.Console.errPrintln( "jalview Javascript error: Ignoring empty function for selection listener."); return; } @@ -1039,9 +1039,9 @@ public class JalviewLite extends Applet .addStructureViewerListener(mol); if (debug) { - System.err.println("Added a javascript structure viewer listener '" + jalview.bin.Console.errPrintln("Added a javascript structure viewer listener '" + listener + "'"); - System.err.println("There are now " + javascriptListeners.size() + jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() + " listeners in total."); } } @@ -1087,7 +1087,7 @@ public class JalviewLite extends Applet rprt = debug; if (debug) { - System.err.println("Removed listener '" + listener + "'"); + jalview.bin.Console.errPrintln("Removed listener '" + listener + "'"); } } else @@ -1097,7 +1097,7 @@ public class JalviewLite extends Applet } if (rprt) { - System.err.println("There are now " + javascriptListeners.size() + jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() + " listeners in total."); } } @@ -1105,14 +1105,14 @@ public class JalviewLite extends Applet @Override public void stop() { - System.err.println("Applet " + getName() + " stop()."); + jalview.bin.Console.errPrintln("Applet " + getName() + " stop()."); tidyUp(); } @Override public void destroy() { - System.err.println("Applet " + getName() + " destroy()."); + jalview.bin.Console.errPrintln("Applet " + getName() + " destroy()."); tidyUp(); } @@ -1189,7 +1189,7 @@ public class JalviewLite extends Applet } } catch (NumberFormatException e) { - System.err.println("Ignoring invalid residue number string '" + jalview.bin.Console.errPrintln("Ignoring invalid residue number string '" + pdbResNum + "'"); } @@ -1220,7 +1220,7 @@ public class JalviewLite extends Applet } catch (Exception ex) { - System.err.println("Couldn't parse integer arguments (topRow='" + jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='" + topRow + "' and leftHandColumn='" + leftHandColumn + "')"); ex.printStackTrace(); @@ -1251,7 +1251,7 @@ public class JalviewLite extends Applet } catch (Exception ex) { - System.err.println("Couldn't parse integer arguments (topRow='" + jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='" + topRow + "')"); ex.printStackTrace(); } @@ -1283,7 +1283,7 @@ public class JalviewLite extends Applet } catch (Exception ex) { - System.err.println( + jalview.bin.Console.errPrintln( "Couldn't parse integer arguments (leftHandColumn='" + leftHandColumn + "')"); ex.printStackTrace(); @@ -1415,18 +1415,18 @@ public class JalviewLite extends Applet { if (debug) { - System.err.println("Applet context is '" + jalview.bin.Console.errPrintln("Applet context is '" + getAppletContext().getClass().toString() + "'"); } JSObject scriptObject = JSObject.getWindow(this); if (debug && scriptObject != null) { - System.err.println("Applet has Javascript callback support."); + jalview.bin.Console.errPrintln("Applet has Javascript callback support."); } } catch (Exception ex) { - System.err.println( + jalview.bin.Console.errPrintln( "Warning: No JalviewLite javascript callbacks available."); if (debug) { @@ -1436,9 +1436,9 @@ public class JalviewLite extends Applet if (debug) { - System.err.println("JalviewLite Version " + getVersion()); - System.err.println("Build Date : " + getBuildDate()); - System.err.println("Installation : " + getInstallation()); + jalview.bin.Console.errPrintln("JalviewLite Version " + getVersion()); + jalview.bin.Console.errPrintln("Build Date : " + getBuildDate()); + jalview.bin.Console.errPrintln("Installation : " + getInstallation()); } String externalsviewer = getParameter("externalstructureviewer"); if (externalsviewer != null) @@ -1465,7 +1465,7 @@ public class JalviewLite extends Applet separator = sep; if (debug) { - System.err.println("Separator set to '" + separator + "'"); + jalview.bin.Console.errPrintln("Separator set to '" + separator + "'"); } } else @@ -1573,7 +1573,7 @@ public class JalviewLite extends Applet { if (tries > 0) { - System.err.println("LiveConnect request thread going to sleep."); + jalview.bin.Console.errPrintln("LiveConnect request thread going to sleep."); } try { @@ -1584,7 +1584,7 @@ public class JalviewLite extends Applet ; if (tries++ > 0) { - System.err.println("LiveConnect request thread woken up."); + jalview.bin.Console.errPrintln("LiveConnect request thread woken up."); } try { @@ -1595,7 +1595,7 @@ public class JalviewLite extends Applet } } catch (Exception jsex) { - System.err.println("Attempt " + tries + jalview.bin.Console.errPrintln("Attempt " + tries + " to access LiveConnect javascript failed."); } } @@ -1632,14 +1632,14 @@ public class JalviewLite extends Applet "Calling oninit callback '" + initjscallback + "'."); } catch (Exception e) { - System.err.println("Exception when executing _oninit callback '" + jalview.bin.Console.errPrintln("Exception when executing _oninit callback '" + initjscallback + "'."); e.printStackTrace(); } } else { - System.err.println("Not executing _oninit callback '" + jalview.bin.Console.errPrintln("Not executing _oninit callback '" + initjscallback + "' - no scripting allowed."); } } @@ -1700,7 +1700,7 @@ public class JalviewLite extends Applet ((AlignFrame) frame).viewport.applet.currentAlignFrame = (AlignFrame) frame; if (debug) { - System.err.println("Activated window " + frame); + jalview.bin.Console.errPrintln("Activated window " + frame); } } // be good. @@ -1715,7 +1715,7 @@ public class JalviewLite extends Applet * * public void windowDeactivated(WindowEvent e) { if (currentAlignFrame == * frame) { currentAlignFrame = null; if (debug) { - * System.err.println("Deactivated window "+frame); } } + * jalview.bin.Console.errPrintln("Deactivated window "+frame); } } * super.windowDeactivated(e); } */ }); @@ -1801,7 +1801,7 @@ public class JalviewLite extends Applet } if (!jmolAvailable) { - System.out.println( + jalview.bin.Console.outPrintln( "Jmol not available - Using mc_view for structures"); } } catch (java.lang.ClassNotFoundException ex) @@ -1813,7 +1813,7 @@ public class JalviewLite extends Applet jmolAvailable = false; if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Skipping Jmol check. Will use mc_view (probably)"); } } @@ -1844,7 +1844,7 @@ public class JalviewLite extends Applet { if (JalviewLite.debug) { - System.err.println(msg); + jalview.bin.Console.errPrintln(msg); } } @@ -1884,7 +1884,7 @@ public class JalviewLite extends Applet { if (debug) { - System.err.println("Prepended document base '" + documentBase + jalview.bin.Console.errPrintln("Prepended document base '" + documentBase + "' to make: '" + withDocBase + "'"); } protocol = DataSourceType.URL; @@ -1903,7 +1903,7 @@ public class JalviewLite extends Applet protocol = DataSourceType.URL; if (debug) { - System.err.println("Prepended codebase '" + codeBase + jalview.bin.Console.errPrintln("Prepended codebase '" + codeBase + "' to make: '" + withCodeBase + "'"); } return withCodeBase; @@ -2010,7 +2010,7 @@ public class JalviewLite extends Applet + " as " + (al1.isNucleotide() ? "protein product" : "cDNA") + " for " + af.getTitle(); - System.err.println(msg); + jalview.bin.Console.errPrintln(msg); } } @@ -2084,7 +2084,7 @@ public class JalviewLite extends Applet dbgMsg(">>>Dump finished."); } catch (Exception e) { - System.err.println( + jalview.bin.Console.errPrintln( "Exception when trying to dump the content of the file parameter."); e.printStackTrace(); } @@ -2214,7 +2214,7 @@ public class JalviewLite extends Applet { // this may not really be a problem but we give a warning // anyway - System.err.println( + jalview.bin.Console.errPrintln( "Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence " + i + ")"); } @@ -2320,7 +2320,7 @@ public class JalviewLite extends Applet } else { - System.err.println( + jalview.bin.Console.errPrintln( "Annotations were not added from annotation file '" + param + "'"); } @@ -2392,13 +2392,13 @@ public class JalviewLite extends Applet { if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Attempting to load T-COFFEE score file from the scoreFile parameter"); } result = alignFrame.loadScoreFile(sScoreFile); if (!result) { - System.err.println( + jalview.bin.Console.errPrintln( "Failed to parse T-COFFEE parameter as a valid score file ('" + sScoreFile + "')"); } @@ -2469,13 +2469,13 @@ public class JalviewLite extends Applet boolean rtn = (getClass().getResourceAsStream("/" + f) != null); if (debug) { - System.err.println("Resource '" + f + "' was " + jalview.bin.Console.errPrintln("Resource '" + f + "' was " + (rtn ? "" : "not ") + "located by classloader."); } return rtn; } catch (Exception ex) { - System.out.println("Exception checking resources: " + f + " " + ex); + jalview.bin.Console.outPrintln("Exception checking resources: " + f + " " + ex); return false; } } @@ -2496,7 +2496,7 @@ public class JalviewLite extends Applet { return initialAlignFrame; } - System.err.println( + jalview.bin.Console.errPrintln( "Implementation error: Jalview Applet API cannot work out which AlignFrame to use."); return null; } @@ -2564,18 +2564,18 @@ public class JalviewLite extends Applet jv.removeAllElements(); if (debug) { - System.err.println("Array from '" + separator + jalview.bin.Console.errPrintln("Array from '" + separator + "' separated List:\n" + v.length); for (int i = 0; i < v.length; i++) { - System.err.println("item " + i + " '" + v[i] + "'"); + jalview.bin.Console.errPrintln("item " + i + " '" + v[i] + "'"); } } return v; } if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Empty Array from '" + separator + "' separated List"); } return null; @@ -2620,13 +2620,13 @@ public class JalviewLite extends Applet { System.err .println("Returning '" + separator + "' separated List:\n"); - System.err.println(v); + jalview.bin.Console.errPrintln(v); } return v.toString(); } if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "Returning empty '" + separator + "' separated List\n"); } return "" + separator; @@ -2745,7 +2745,7 @@ public class JalviewLite extends Applet this.separator = separator; if (debug) { - System.err.println("Default Separator now: '" + separator + "'"); + jalview.bin.Console.errPrintln("Default Separator now: '" + separator + "'"); } } @@ -2901,7 +2901,7 @@ public class JalviewLite extends Applet Color col = ColorUtils.parseColourString(colprop); if (col == null) { - System.err.println("Couldn't parse '" + colprop + "' as a colour for " + jalview.bin.Console.errPrintln("Couldn't parse '" + colprop + "' as a colour for " + colparam); } return (col == null) ? defcolour : col; @@ -2971,7 +2971,7 @@ public class JalviewLite extends Applet } if (debug) { - System.err.println( + jalview.bin.Console.errPrintln( "resolveUrlForLocalOrAbsolute returning " + resolvedPath); } return resolvedPath; @@ -3000,7 +3000,7 @@ public class JalviewLite extends Applet : getDocumentBase()); if (debug) { - System.err.println("Show url (prepended " + prepend + jalview.bin.Console.errPrintln("Show url (prepended " + prepend + " - toggle resolvetocodebase if code/docbase resolution is wrong): " + url); } @@ -3009,7 +3009,7 @@ public class JalviewLite extends Applet { if (debug) { - System.err.println("Show url: " + url); + jalview.bin.Console.errPrintln("Show url: " + url); } } if (url.indexOf("javascript:") == 0) diff --git a/src/jalview/bin/JalviewLiteURLRetrieve.java b/src/jalview/bin/JalviewLiteURLRetrieve.java index f2ffda5..d38892a 100644 --- a/src/jalview/bin/JalviewLiteURLRetrieve.java +++ b/src/jalview/bin/JalviewLiteURLRetrieve.java @@ -64,7 +64,7 @@ public class JalviewLiteURLRetrieve extends Applet DataSourceType protocol = null; try { - System.out.println("Loading thread started with:\n>>file\n" + file + jalview.bin.Console.outPrintln("Loading thread started with:\n>>file\n" + file + ">>endfile"); // This might throw a security exception in certain browsers // Netscape Communicator for instance. @@ -77,7 +77,7 @@ public class JalviewLiteURLRetrieve extends Applet rtn = true; is.close(); } - System.err.println("Resource '" + file + "' was " + jalview.bin.Console.errPrintln("Resource '" + file + "' was " + (rtn ? "" : "not") + " located by classloader."); if (rtn) { @@ -86,7 +86,7 @@ public class JalviewLiteURLRetrieve extends Applet } catch (Exception ex) { - System.out.println( + jalview.bin.Console.outPrintln( "Exception checking resources: " + file + " " + ex); } if (file.indexOf("://") > -1) @@ -99,7 +99,7 @@ public class JalviewLiteURLRetrieve extends Applet protocol = DataSourceType.FILE; } - System.out.println("Trying to get contents of resource:"); + jalview.bin.Console.outPrintln("Trying to get contents of resource:"); FileParse fp = new FileParse(file, protocol); if (fp.isValid()) { @@ -112,7 +112,7 @@ public class JalviewLiteURLRetrieve extends Applet } else { - System.out.println("Resource at " + file + jalview.bin.Console.outPrintln("Resource at " + file + " cannot be read with protocol==" + protocol); return; } @@ -121,11 +121,11 @@ public class JalviewLiteURLRetrieve extends Applet if (format == null) { format = new IdentifyFile().identify(file, protocol); - System.out.println("Format is " + format); + jalview.bin.Console.outPrintln("Format is " + format); } else { - System.out.println("User specified Format is " + format); + jalview.bin.Console.outPrintln("User specified Format is " + format); } AlignmentI al = null; try @@ -133,17 +133,17 @@ public class JalviewLiteURLRetrieve extends Applet al = new AppletFormatAdapter().readFile(file, protocol, format); } catch (java.io.IOException ex) { - System.err.println("Failed to open the file."); + jalview.bin.Console.errPrintln("Failed to open the file."); ex.printStackTrace(); } if (al != null) { - System.out.println(new AppletFormatAdapter() + jalview.bin.Console.outPrintln(new AppletFormatAdapter() .formatSequences(FileFormat.Fasta, al, false)); } } catch (Exception e) { - System.err.println("bailing out : Unexpected exception:"); + jalview.bin.Console.errPrintln("bailing out : Unexpected exception:"); e.printStackTrace(); } } diff --git a/src/jalview/bin/JalviewTaskbar.java b/src/jalview/bin/JalviewTaskbar.java index c7ababa..e04c04f 100644 --- a/src/jalview/bin/JalviewTaskbar.java +++ b/src/jalview/bin/JalviewTaskbar.java @@ -46,7 +46,7 @@ public class JalviewTaskbar } else { - System.out.println("Unable to setIconImage()"); + Console.outPrintln("Unable to setIconImage()"); } } } diff --git a/src/jalview/bin/Launcher.java b/src/jalview/bin/Launcher.java index 6e820fd..77992f5 100644 --- a/src/jalview/bin/Launcher.java +++ b/src/jalview/bin/Launcher.java @@ -85,7 +85,7 @@ public class Launcher { if (!LaunchUtils.checkJavaVersion()) { - System.err.println("WARNING - The Java version being used (Java " + jalview.bin.Console.errPrintln("WARNING - The Java version being used (Java " + LaunchUtils.getJavaVersion() + ") may lead to problems. This installation of Jalview should be used with Java " + LaunchUtils.getJavaCompileVersion() + "."); @@ -337,7 +337,7 @@ public class Launcher { if (e.getMessage().toLowerCase(Locale.ROOT).contains("memory")) { - System.err.println("Caught a memory exception: " + e.getMessage()); + jalview.bin.Console.errPrintln("Caught a memory exception: " + e.getMessage()); // Probably the "Cannot allocate memory" error, try without the memory // setting ArrayList commandNoMem = new ArrayList<>(); @@ -350,7 +350,7 @@ public class Launcher } final ProcessBuilder builderNoMem = new ProcessBuilder( commandNoMem); - System.err.println("Command without memory setting: " + jalview.bin.Console.errPrintln("Command without memory setting: " + String.join(" ", builderNoMem.command())); try { @@ -376,7 +376,7 @@ public class Launcher { if (debug && !quiet) { - System.err.println("LAUNCHERDEBUG - " + message); + jalview.bin.Console.errPrintln("LAUNCHERDEBUG - " + message); } } diff --git a/src/jalview/bin/MemorySetting.java b/src/jalview/bin/MemorySetting.java index bb545cb..7458d55 100644 --- a/src/jalview/bin/MemorySetting.java +++ b/src/jalview/bin/MemorySetting.java @@ -354,7 +354,7 @@ public class MemorySetting else { // number too big for a Long. Limit to Long.MAX_VALUE - System.out.println("Memory parsing of '" + memString + jalview.bin.Console.outPrintln("Memory parsing of '" + memString + "' produces number too big. Limiting to Long.MAX_VALUE=" + Long.MAX_VALUE); return Long.MAX_VALUE; @@ -395,7 +395,7 @@ public class MemorySetting ADJUSTMENT_MESSAGE = reason; if (!quiet) { - System.out.println(reason); + jalview.bin.Console.outPrintln(reason); } } diff --git a/src/jalview/bin/argparser/BootstrapArgs.java b/src/jalview/bin/argparser/BootstrapArgs.java index a29f7b8..32eb91a 100644 --- a/src/jalview/bin/argparser/BootstrapArgs.java +++ b/src/jalview/bin/argparser/BootstrapArgs.java @@ -55,7 +55,7 @@ public class BootstrapArgs { if (argFiles.contains(inArgFile)) { - System.err.println( + jalview.bin.Console.errPrintln( "Looped argfiles detected: '" + inArgFile.getPath() + "'"); return; } @@ -154,16 +154,11 @@ public class BootstrapArgs // make a check for an output going to stdout if (a != null && a.hasOption(Opt.OUTPUTFILE)) { - System.err.println("###### Found an output"); - System.err.println("###### val='" + val + "'"); - System.err - .println("###### next arg='" + args.get(i + 1) + "'"); if ((val == null && i + 1 < args.size() && ArgParser.STDOUTFILENAME.equals(args.get(i + 1))) || ArgParser.STDOUTFILENAME.equals(val)) { this.outputToStdout = true; - System.err.println("###### Expecting output to stdout"); } } diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 62ef660..c15bbf8 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -473,7 +473,7 @@ public class EditCommand implements CommandI { command.seqs[s].insertCharAt(command.position, command.number, command.gapChar); - // System.out.println("pos: "+command.position+" number: + // jalview.bin.Console.outPrintln("pos: "+command.position+" number: // "+command.number); } @@ -486,7 +486,7 @@ public class EditCommand implements CommandI // // for (int s = 0; s < command.seqs.length; s++) // { - // System.out.println("pos: "+command.position+" number: "+command.number); + // jalview.bin.Console.outPrintln("pos: "+command.position+" number: "+command.number); // command.seqs[s].insertCharAt(command.position, command.number,'A'); // } // @@ -1433,7 +1433,7 @@ public class EditCommand implements CommandI } else { - System.err.println("Can't undo edit action " + action); + jalview.bin.Console.errPrintln("Can't undo edit action " + action); // throw new IllegalStateException("Can't undo edit action " + // action); } diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index f5154ec..cb74a66 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -707,7 +707,7 @@ public class AlignedCodonFrame ds.setSequenceFeatures(dna.getSequenceFeatures()); // dnaSeqs[i] = ds; ssm.fromSeq = ds; - System.out.println("Realised mapped sequence " + ds.getName()); + jalview.bin.Console.outPrintln("Realised mapped sequence " + ds.getName()); } } } diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index de98c64..7e6b904 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -126,7 +126,7 @@ public class AlignmentAnnotation invalidrnastruc = -1; } catch (WUSSParseException px) { - // DEBUG System.out.println(px); + // DEBUG jalview.bin.Console.outPrintln(px); invalidrnastruc = px.getProblemPos(); } if (invalidrnastruc > -1) @@ -142,7 +142,7 @@ public class AlignmentAnnotation scaleColLabel = true; _markRnaHelices(); } - // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup()); + // jalview.bin.Console.outPrintln("featuregroup " + _rnasecstr[0].getFeatureGroup()); } @@ -156,10 +156,10 @@ public class AlignmentAnnotation { /* - * System.out.println(this.annotation._rnasecstr[x] + " Begin" + + * jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x] + " Begin" + * this.annotation._rnasecstr[x].getBegin()); */ - // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup()); + // jalview.bin.Console.outPrintln(this.annotation._rnasecstr[x].getFeatureGroup()); int val = 0; try { @@ -386,7 +386,7 @@ public class AlignmentAnnotation char firstChar = 0; for (int i = 0; i < annotations.length; i++) { - // DEBUG System.out.println(i + ": " + annotations[i]); + // DEBUG jalview.bin.Console.outPrintln(i + ": " + annotations[i]); if (annotations[i] == null) { continue; @@ -394,14 +394,14 @@ public class AlignmentAnnotation if (annotations[i].secondaryStructure == 'H' || annotations[i].secondaryStructure == 'E') { - // DEBUG System.out.println( "/H|E/ '" + + // DEBUG jalview.bin.Console.outPrintln( "/H|E/ '" + // annotations[i].secondaryStructure + "'"); hasIcons |= true; } else // Check for RNA secondary structure { - // DEBUG System.out.println( "/else/ '" + + // DEBUG jalview.bin.Console.outPrintln( "/else/ '" + // annotations[i].secondaryStructure + "'"); // TODO: 2.8.2 should this ss symbol validation check be a function in // RNA/ResidueProperties ? @@ -446,7 +446,7 @@ public class AlignmentAnnotation } } - // System.out.println("displaychar " + annotations[i].displayCharacter); + // jalview.bin.Console.outPrintln("displaychar " + annotations[i].displayCharacter); if (annotations[i].displayCharacter == null || annotations[i].displayCharacter.length() == 0) diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index e6604d1..6ab71c7 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -1128,11 +1128,11 @@ public class AlignmentView public static void testSelectionViews(AlignmentI alignment, HiddenColumns hidden, SequenceGroup selection) { - System.out.println("Testing standard view creation:\n"); + jalview.bin.Console.outPrintln("Testing standard view creation:\n"); AlignmentView view = null; try { - System.out.println( + jalview.bin.Console.outPrintln( "View with no hidden columns, no limit to selection, no groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, false, false, false); @@ -1141,12 +1141,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View with no hidden columns, no limit to selection, and all groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, false, false, true); @@ -1154,12 +1154,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection marked but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View with no hidden columns, limited to selection and no groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, false, true, false); @@ -1167,12 +1167,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection restricted but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View with no hidden columns, limited to selection, and all groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, false, true, true); @@ -1180,12 +1180,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection restricted and groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View *with* hidden columns, no limit to selection, no groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, true, false, false); @@ -1193,12 +1193,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View *with* hidden columns, no limit to selection, and all groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, true, false, true); @@ -1206,12 +1206,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection marked but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View *with* hidden columns, limited to selection and no groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, true, true, false); @@ -1219,12 +1219,12 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection restricted but no groups marked."); } try { - System.out.println( + jalview.bin.Console.outPrintln( "View *with* hidden columns, limited to selection, and all groups to be collected:"); view = new AlignmentView(alignment, hidden, selection, true, true, true); @@ -1232,7 +1232,7 @@ public class AlignmentView } catch (Exception e) { e.printStackTrace(); - System.err.println( + jalview.bin.Console.errPrintln( "Failed to generate alignment with selection restricted and groups marked."); } diff --git a/src/jalview/datamodel/HiddenSequences.java b/src/jalview/datamodel/HiddenSequences.java index b5efeb4..e2ef318 100755 --- a/src/jalview/datamodel/HiddenSequences.java +++ b/src/jalview/datamodel/HiddenSequences.java @@ -159,7 +159,7 @@ public class HiddenSequences if (alignmentIndex < 0 || hiddenSequences[alignmentIndex] != null) { - System.out.println("ERROR!!!!!!!!!!!"); + jalview.bin.Console.outPrintln("ERROR!!!!!!!!!!!"); return; } @@ -239,7 +239,7 @@ public class HiddenSequences } else { - System.out.println( + jalview.bin.Console.outPrintln( seq.getName() + " has been deleted whilst hidden"); } } diff --git a/src/jalview/datamodel/SearchResults.java b/src/jalview/datamodel/SearchResults.java index 909a0fe..8d6cbb1 100755 --- a/src/jalview/datamodel/SearchResults.java +++ b/src/jalview/datamodel/SearchResults.java @@ -269,7 +269,7 @@ public class SearchResults implements SearchResultsI else { // debug - // System.err.println("Outwith bounds!" + matchStart+">"+end +" or " + // jalview.bin.Console.errPrintln("Outwith bounds!" + matchStart+">"+end +" or " // + matchEnd+"<"+start); } } diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 5bb55e5..7a5d5bc 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -174,7 +174,7 @@ public class Sequence extends ASequence implements SequenceI { if (name == null) { - System.err.println( + jalview.bin.Console.errPrintln( "POSSIBLE IMPLEMENTATION ERROR: null sequence name passed to constructor."); name = ""; } @@ -387,7 +387,7 @@ public class Sequence extends ASequence implements SequenceI { if (sf.getType() == null) { - System.err.println( + jalview.bin.Console.errPrintln( "SequenceFeature type may not be null: " + sf.toString()); return false; } diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 326793d..9837104 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -644,7 +644,7 @@ public class SequenceGroup implements AnnotatedCollectionI } catch (java.lang.OutOfMemoryError err) { // TODO: catch OOM - System.out.println("Out of memory loading groups: " + err); + jalview.bin.Console.outPrintln("Out of memory loading groups: " + err); } return upd; } diff --git a/src/jalview/datamodel/features/FeatureMatcher.java b/src/jalview/datamodel/features/FeatureMatcher.java index 65cba0d..124909c 100644 --- a/src/jalview/datamodel/features/FeatureMatcher.java +++ b/src/jalview/datamodel/features/FeatureMatcher.java @@ -147,7 +147,7 @@ public class FeatureMatcher implements FeatureMatcherI int nextQuotePos = descriptor.indexOf(QUOTE, 1); if (nextQuotePos == -1) { - System.err.println(invalidFormat); + jalview.bin.Console.errPrintln(invalidFormat); return null; } firstField = descriptor.substring(1, nextQuotePos); @@ -159,7 +159,7 @@ public class FeatureMatcher implements FeatureMatcherI int nextSpacePos = descriptor.indexOf(SPACE); if (nextSpacePos == -1) { - System.err.println(invalidFormat); + jalview.bin.Console.errPrintln(invalidFormat); return null; } firstField = descriptor.substring(0, nextSpacePos); @@ -193,7 +193,7 @@ public class FeatureMatcher implements FeatureMatcherI cond = Condition.fromString(leftToParse); if (cond == null || cond.needsAPattern()) { - System.err.println(invalidFormat); + jalview.bin.Console.errPrintln(invalidFormat); return null; } } @@ -214,7 +214,7 @@ public class FeatureMatcher implements FeatureMatcherI else { // unbalanced quote - System.err.println(invalidFormat); + jalview.bin.Console.errPrintln(invalidFormat); return null; } } diff --git a/src/jalview/datamodel/features/FeatureMatcherSet.java b/src/jalview/datamodel/features/FeatureMatcherSet.java index a5efe5d..eae3664 100644 --- a/src/jalview/datamodel/features/FeatureMatcherSet.java +++ b/src/jalview/datamodel/features/FeatureMatcherSet.java @@ -93,7 +93,7 @@ public class FeatureMatcherSet implements FeatureMatcherSetI if (spacePos == -1) { // trailing junk after a match condition - System.err.println(invalid); + jalview.bin.Console.errPrintln(invalid); return null; } String conjunction = leftToParse.substring(0, spacePos); @@ -109,7 +109,7 @@ public class FeatureMatcherSet implements FeatureMatcherSetI else { // not an AND or an OR - invalid - System.err.println(invalid); + jalview.bin.Console.errPrintln(invalid); return null; } } @@ -123,7 +123,7 @@ public class FeatureMatcherSet implements FeatureMatcherSetI int closePos = leftToParse.indexOf(CLOSE_BRACKET); if (closePos == -1) { - System.err.println(invalid); + jalview.bin.Console.errPrintln(invalid); return null; } nextCondition = leftToParse.substring(1, closePos); @@ -137,7 +137,7 @@ public class FeatureMatcherSet implements FeatureMatcherSetI FeatureMatcher fm = FeatureMatcher.fromString(nextCondition); if (fm == null) { - System.err.println(invalid); + jalview.bin.Console.errPrintln(invalid); return null; } try @@ -154,7 +154,7 @@ public class FeatureMatcherSet implements FeatureMatcherSetI } catch (IllegalStateException e) { // thrown if OR and AND are mixed - System.err.println(invalid); + jalview.bin.Console.errPrintln(invalid); return null; } diff --git a/src/jalview/datamodel/features/FeatureStore.java b/src/jalview/datamodel/features/FeatureStore.java index eb5688c..c19d782 100644 --- a/src/jalview/datamodel/features/FeatureStore.java +++ b/src/jalview/datamodel/features/FeatureStore.java @@ -401,7 +401,7 @@ public class FeatureStore SequenceFeature sf = contactFeatureEnds.get(index); if (!sf.isContactFeature()) { - System.err.println("Error! non-contact feature type " + sf.getType() + jalview.bin.Console.errPrintln("Error! non-contact feature type " + sf.getType() + " in contact features list"); index++; continue; @@ -454,7 +454,7 @@ public class FeatureStore SequenceFeature sf = contactFeatureStarts.get(index); if (!sf.isContactFeature()) { - System.err.println("Error! non-contact feature " + sf.toString() + jalview.bin.Console.errPrintln("Error! non-contact feature " + sf.toString() + " in contact features list"); index++; continue; diff --git a/src/jalview/datamodel/features/SequenceFeatures.java b/src/jalview/datamodel/features/SequenceFeatures.java index 905fd8b..ed4474e 100644 --- a/src/jalview/datamodel/features/SequenceFeatures.java +++ b/src/jalview/datamodel/features/SequenceFeatures.java @@ -88,7 +88,7 @@ public class SequenceFeatures implements SequenceFeaturesI String type = sf.getType(); if (type == null) { - System.err.println("Feature type may not be null: " + sf.toString()); + jalview.bin.Console.errPrintln("Feature type may not be null: " + sf.toString()); return false; } diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java index 75a7154..391fd6f 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -226,7 +226,7 @@ public class EnsemblGene extends EnsemblSeqProxy return true; } catch (NumberFormatException e) { - System.err.println("Bad integers in description " + description); + jalview.bin.Console.errPrintln("Bad integers in description " + description); } } return false; diff --git a/src/jalview/ext/ensembl/EnsemblLookup.java b/src/jalview/ext/ensembl/EnsemblLookup.java index 0813ba8..e188986 100644 --- a/src/jalview/ext/ensembl/EnsemblLookup.java +++ b/src/jalview/ext/ensembl/EnsemblLookup.java @@ -222,7 +222,7 @@ public class EnsemblLookup extends EnsemblRestClient ids, -1, MODE_MAP, null); } catch (IOException | ParseException e) { - System.err.println("Error parsing " + identifier + " lookup response " + jalview.bin.Console.errPrintln("Error parsing " + identifier + " lookup response " + e.getMessage()); return null; } diff --git a/src/jalview/ext/ensembl/EnsemblMap.java b/src/jalview/ext/ensembl/EnsemblMap.java index f2ab195..1fd9a23 100644 --- a/src/jalview/ext/ensembl/EnsemblMap.java +++ b/src/jalview/ext/ensembl/EnsemblMap.java @@ -157,7 +157,7 @@ public class EnsemblMap extends EnsemblRestClient return (parseAssemblyMappingResponse(url)); } catch (Throwable t) { - System.out.println("Error calling " + url + ": " + t.getMessage()); + jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage()); return null; } } @@ -265,7 +265,7 @@ public class EnsemblMap extends EnsemblRestClient return null; } catch (Throwable t) { - System.out.println("Error calling " + url + ": " + t.getMessage()); + jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage()); return null; } } @@ -342,7 +342,7 @@ public class EnsemblMap extends EnsemblRestClient String ass = mapped.get("assembly_name").toString(); if (assembly != null && !assembly.equals(ass)) { - System.err.println( + jalview.bin.Console.errPrintln( "EnsemblMap found multiple assemblies - can't resolve"); return null; } @@ -350,7 +350,7 @@ public class EnsemblMap extends EnsemblRestClient String chr = mapped.get("seq_region_name").toString(); if (chromosome != null && !chromosome.equals(chr)) { - System.err.println( + jalview.bin.Console.errPrintln( "EnsemblMap found multiple chromosomes - can't resolve"); return null; } diff --git a/src/jalview/ext/ensembl/EnsemblRestClient.java b/src/jalview/ext/ensembl/EnsemblRestClient.java index 4a5544e..540fc98 100644 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@ -211,7 +211,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher return pingString != null; } catch (Throwable t) { - System.err.println( + jalview.bin.Console.errPrintln( "Error connecting to " + pingUrl + ": " + t.getMessage()); } finally { @@ -313,7 +313,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher * note: a GET request for an invalid id returns an error code e.g. 415 * but POST request returns 200 and an empty Fasta response */ - System.err.println("Response code " + responseCode);// + " for " + url); + jalview.bin.Console.errPrintln("Response code " + responseCode);// + " for " + url); return null; } @@ -338,7 +338,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher protected HttpURLConnection tryConnection(URL url, List ids, int readTimeout) throws IOException, ProtocolException { - // System.out.println(System.currentTimeMillis() + " " + url); + // jalview.bin.Console.outPrintln(System.currentTimeMillis() + " " + url); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); @@ -387,14 +387,14 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher int retrySecs = Integer.valueOf(retryDelay); if (retrySecs > 0 && retrySecs < 10) { - System.err.println( + jalview.bin.Console.errPrintln( "Ensembl REST service rate limit exceeded, waiting " + retryDelay + " seconds before retrying"); Thread.sleep(1000 * retrySecs); } } catch (NumberFormatException | InterruptedException e) { - System.err.println("Error handling Retry-After: " + e.getMessage()); + jalview.bin.Console.errPrintln("Error handling Retry-After: " + e.getMessage()); } } } @@ -566,7 +566,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher } } catch (NumberFormatException e) { - System.err.println("Error in REST version: " + e.toString()); + jalview.bin.Console.errPrintln("Error in REST version: " + e.toString()); } /* @@ -578,14 +578,14 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher expected) == 1; if (laterVersion) { - System.err.println(String.format( + jalview.bin.Console.errPrintln(String.format( "EnsemblRestClient expected %s REST version %s but found %s, see %s", getDbSource(), expected, version, REST_CHANGE_LOG)); } info.restVersion = version; } catch (Throwable t) { - System.err.println( + jalview.bin.Console.errPrintln( "Error checking Ensembl REST version: " + t.getMessage()); } } @@ -617,7 +617,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher domainData.get(getDomain()).dataVersion = versions.get(0).toString(); } catch (Throwable e) {// could be IOException | ParseException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Error checking Ensembl data version: " + e.getMessage()); } } diff --git a/src/jalview/ext/ensembl/EnsemblSeqProxy.java b/src/jalview/ext/ensembl/EnsemblSeqProxy.java index 56eda5e..949c52e 100644 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@ -155,7 +155,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient String msg = "Aborting ID retrieval after " + v + " chunks. Unexpected problem (" + r.getLocalizedMessage() + ")"; - System.err.println(msg); + jalview.bin.Console.errPrintln(msg); r.printStackTrace(); break; } @@ -240,7 +240,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient } } catch (IOException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Error transferring Ensembl features: " + e.getMessage()); } // Platform.timeCheck("ESP.addfeat done", Platform.TIME_MARK); @@ -265,12 +265,12 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient String accId = querySeq.getName(); try { - System.out.println("Adding protein product for " + accId); + jalview.bin.Console.outPrintln("Adding protein product for " + accId); AlignmentI protein = new EnsemblProtein(getDomain()) .getSequenceRecords(accId); if (protein == null || protein.getHeight() == 0) { - System.out.println("No protein product found for " + accId); + jalview.bin.Console.outPrintln("No protein product found for " + accId); return; } SequenceI proteinSeq = protein.getSequenceAt(0); @@ -382,7 +382,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient seq.addDBRef(xrefs.get(i)); } - // System.out.println("primaries are " + seq.getPrimaryDBRefs().toString()); + // jalview.bin.Console.outPrintln("primaries are " + seq.getPrimaryDBRefs().toString()); /* * and add a reference to itself */ @@ -430,7 +430,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient if (seqs.size() != ids.size()) { - System.out.println(String.format( + jalview.bin.Console.outPrintln(String.format( "Only retrieved %d sequences for %d query strings", seqs.size(), ids.size())); } @@ -508,7 +508,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient result.add(sequence); } catch (ParseException | IOException e) { - System.err.println("Error processing JSON response: " + e.toString()); + jalview.bin.Console.errPrintln("Error processing JSON response: " + e.toString()); // ignore } // Platform.timeCheck("ENS seqproxy2", Platform.TIME_MARK); @@ -659,7 +659,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient if (regions.isEmpty()) { - System.out.println("Failed to identify target sequence for " + accId + jalview.bin.Console.outPrintln("Failed to identify target sequence for " + accId + " from genomic features"); return null; } @@ -829,7 +829,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient boolean result = transferFeatures(sfs, targetSequence, mapping, accessionId); - // System.out.println("transferFeatures (" + (sfs.size()) + " --> " + // jalview.bin.Console.outPrintln("transferFeatures (" + (sfs.size()) + " --> " // + targetSequence.getFeatures().getFeatureCount(true) + ") to " // + targetSequence.getName() + " took " // + (System.currentTimeMillis() - start) + "ms"); diff --git a/src/jalview/ext/htsjdk/HtsContigDb.java b/src/jalview/ext/htsjdk/HtsContigDb.java index 9a985b6..8cce87a 100644 --- a/src/jalview/ext/htsjdk/HtsContigDb.java +++ b/src/jalview/ext/htsjdk/HtsContigDb.java @@ -261,7 +261,7 @@ public class HtsContigDb { if (!isValid() || !refFile.isIndexed()) { - System.err.println( + jalview.bin.Console.errPrintln( "Cannot read contig as file is invalid or not indexed"); return null; } diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 21a19ae..870db65 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -163,21 +163,21 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void createImage(String file, String type, int quality) { - System.out.println("JMOL CREATE IMAGE"); + jalview.bin.Console.outPrintln("JMOL CREATE IMAGE"); } @Override public String createImage(String fileName, String type, Object textOrBytes, int quality) { - System.out.println("JMOL CREATE IMAGE"); + jalview.bin.Console.outPrintln("JMOL CREATE IMAGE"); return null; } @Override public String eval(String strEval) { - // System.out.println(strEval); + // jalview.bin.Console.outPrintln(strEval); // "# 'eval' is implemented only for the applet."; return null; } @@ -476,7 +476,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel lastMessage = strInfo; if (data != null) { - System.err.println("Ignoring additional hover info: " + data + jalview.bin.Console.errPrintln("Ignoring additional hover info: " + data + " (other info: '" + strInfo + "' pos " + atomIndex + ")"); } mouseOverStructure(atomIndex, strInfo); @@ -497,7 +497,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ if (strData != null) { - System.err.println("Ignoring additional pick data string " + strData); + jalview.bin.Console.errPrintln("Ignoring additional pick data string " + strData); } int chainSeparator = strInfo.indexOf(":"); int p = 0; @@ -599,7 +599,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel (data == null) ? ((String) null) : (String) data[1]); break; case ERROR: - // System.err.println("Ignoring error callback."); + // jalview.bin.Console.errPrintln("Ignoring error callback."); break; case SYNC: case RESIZE: @@ -609,13 +609,13 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel case CLICK: default: - System.err.println( + jalview.bin.Console.errPrintln( "Unhandled callback " + type + " " + data[1].toString()); break; } } catch (Exception e) { - System.err.println("Squashed Jmol callback handler error:"); + jalview.bin.Console.errPrintln("Squashed Jmol callback handler error:"); e.printStackTrace(); } } @@ -864,7 +864,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void setCallbackFunction(String callbackType, String callbackFunction) { - System.err.println("Ignoring set-callback request to associate " + jalview.bin.Console.errPrintln("Ignoring set-callback request to associate " + callbackType + " with function " + callbackFunction); } @@ -938,7 +938,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel String buttonsToShow) { - System.err.println("Allocating Jmol Viewer: " + commandOptions); + jalview.bin.Console.errPrintln("Allocating Jmol Viewer: " + commandOptions); if (commandOptions == null) { @@ -956,7 +956,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel console = createJmolConsole(consolePanel, buttonsToShow); } catch (Throwable e) { - System.err.println("Could not create Jmol application console. " + jalview.bin.Console.errPrintln("Could not create Jmol application console. " + e.getMessage()); e.printStackTrace(); } diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 57b406e..0ca2ba8 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -338,7 +338,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener } } catch (OutOfMemoryError er) { - System.out.println( + jalview.bin.Console.outPrintln( "OUT OF MEMORY LOADING TRANSFORMING JMOL MODEL TO JALVIEW MODEL"); throw new IOException(MessageManager .getString("exception.outofmemory_loading_mmcif_file")); @@ -391,7 +391,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener org.jmol.modelset.Atom prevAtom, HashMap chainTerMap) { - // System.out.println("Atom: " + curAtom.getAtomNumber() + // jalview.bin.Console.outPrintln("Atom: " + curAtom.getAtomNumber() // + " Last atom index " + curAtom.group.lastAtomIndex); if (chainTerMap == null || prevAtom == null) { diff --git a/src/jalview/ext/paradise/Annotate3D.java b/src/jalview/ext/paradise/Annotate3D.java index de1d90c..3817ee9 100644 --- a/src/jalview/ext/paradise/Annotate3D.java +++ b/src/jalview/ext/paradise/Annotate3D.java @@ -229,7 +229,7 @@ class RvalsIterator implements Iterator, AutoCloseable if (sval == null) { - System.err.println( + jalview.bin.Console.errPrintln( "DEVELOPER WARNING: Annotate3d didn't return a '2D' tag in its response. Consider checking output of server. Response was :" + val.toString()); diff --git a/src/jalview/ext/pymol/PymolManager.java b/src/jalview/ext/pymol/PymolManager.java index 7dfdb0c..ddc8d84 100644 --- a/src/jalview/ext/pymol/PymolManager.java +++ b/src/jalview/ext/pymol/PymolManager.java @@ -158,7 +158,7 @@ public class PymolManager boolean getReply) { String postBody = getPostRequest(command); - // System.out.println(postBody);// debug + // jalview.bin.Console.outPrintln(postBody);// debug String rpcUrl = "http://127.0.0.1:" + this.pymolXmlRpcPort; PrintWriter out = null; BufferedReader in = null; diff --git a/src/jalview/ext/rbvi/chimera/ChimeraListener.java b/src/jalview/ext/rbvi/chimera/ChimeraListener.java index 40b0ff0..af31b78 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraListener.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraListener.java @@ -126,12 +126,12 @@ public class ChimeraListener extends AbstractRequestHandler } else if (message.startsWith(MODEL_CHANGED)) { - System.err.println(message); + jalview.bin.Console.errPrintln(message); processModelChanged(message.substring(MODEL_CHANGED.length())); } else { - System.err.println("Unexpected chimeraNotification: " + message); + jalview.bin.Console.errPrintln("Unexpected chimeraNotification: " + message); } } } @@ -143,7 +143,7 @@ public class ChimeraListener extends AbstractRequestHandler */ protected void processModelChanged(String message) { - // System.out.println(message + " (not implemented in Jalview)"); + // jalview.bin.Console.outPrintln(message + " (not implemented in Jalview)"); } /** diff --git a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java index aebfede..a292e88 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -207,7 +207,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel startListening(chimeraListener.getUri()); } catch (BindException e) { - System.err.println( + jalview.bin.Console.errPrintln( "Failed to start Chimera listener: " + e.getMessage()); } } @@ -568,7 +568,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel private void log(String message) { - System.err.println("## Chimera log: " + message); + jalview.bin.Console.errPrintln("## Chimera log: " + message); } /** @@ -627,7 +627,7 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel executeCommand(false, null, command); } catch (IOException e) { - System.err.println("Sending commands to Chimera via file failed with " + jalview.bin.Console.errPrintln("Sending commands to Chimera via file failed with " + e.getMessage()); } } diff --git a/src/jalview/fts/core/FTSDataColumnPreferences.java b/src/jalview/fts/core/FTSDataColumnPreferences.java index 0971235..86b8c7d 100644 --- a/src/jalview/fts/core/FTSDataColumnPreferences.java +++ b/src/jalview/fts/core/FTSDataColumnPreferences.java @@ -94,7 +94,7 @@ public class FTSDataColumnPreferences extends JScrollPane int x = 0; for (FTSDataColumnI field : allFTSDataColumns) { - // System.out.println("allFTSDataColumns==" + allFTSDataColumns); + // jalview.bin.Console.outPrintln("allFTSDataColumns==" + allFTSDataColumns); if (field.getName().equalsIgnoreCase("all")) { continue; @@ -106,7 +106,7 @@ public class FTSDataColumnPreferences extends JScrollPane data[x++] = new Object[] { ftsRestClient .getAllDefaultDisplayedFTSDataColumns().contains(field), field.getName(), field.getGroup() }; - // System.out.println(" PUIS " + field.getName() + " ET AUSSI " + + // jalview.bin.Console.outPrintln(" PUIS " + field.getName() + " ET AUSSI " + // field.getGroup() + "X = " + x); break; case STRUCTURE_CHOOSER: diff --git a/src/jalview/fts/service/alphafold/AlphafoldRestClient.java b/src/jalview/fts/service/alphafold/AlphafoldRestClient.java index 7e95dd2..a631902 100644 --- a/src/jalview/fts/service/alphafold/AlphafoldRestClient.java +++ b/src/jalview/fts/service/alphafold/AlphafoldRestClient.java @@ -118,7 +118,7 @@ public class AlphafoldRestClient } catch (Exception e) { e.printStackTrace(); - System.out.println("offending value:" + fieldData); + jalview.bin.Console.outPrintln("offending value:" + fieldData); } } } diff --git a/src/jalview/fts/service/pdb/PDBFTSRestClient.java b/src/jalview/fts/service/pdb/PDBFTSRestClient.java index 796bc0e..5619075 100644 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@ -175,7 +175,7 @@ public class PDBFTSRestClient extends FTSRestClient URI uri = webResource.getURI(); - System.out.println(uri); + jalview.bin.Console.outPrintln(uri); ClientResponse clientResponse = null; int responseStatus = -1; // Get the JSON string from the response object or directly from the @@ -183,7 +183,7 @@ public class PDBFTSRestClient extends FTSRestClient Map jsonObj = null; String responseString = null; - System.out.println("query >>>>>>> " + pdbRestRequest.toString()); + jalview.bin.Console.outPrintln("query >>>>>>> " + pdbRestRequest.toString()); if (!isMocked()) { @@ -413,10 +413,10 @@ public class PDBFTSRestClient extends FTSRestClient for (FTSDataColumnI field : diplayFields) { - // System.out.println("Field " + field); + // jalview.bin.Console.outPrintln("Field " + field); String fieldData = (pdbJsonDoc.get(field.getCode()) == null) ? "" : pdbJsonDoc.get(field.getCode()).toString(); - // System.out.println("Field Data : " + fieldData); + // jalview.bin.Console.outPrintln("Field Data : " + fieldData); if (field.isPrimaryKeyColumn()) { primaryKey = fieldData; @@ -440,7 +440,7 @@ public class PDBFTSRestClient extends FTSRestClient } catch (Exception e) { e.printStackTrace(); - System.out.println("offending value:" + fieldData); + jalview.bin.Console.outPrintln("offending value:" + fieldData); } } } diff --git a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSPanel.java b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSPanel.java index 253de42..dfb39cb 100644 --- a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSPanel.java +++ b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSPanel.java @@ -277,7 +277,7 @@ public class TDBeaconsFTSPanel extends GFTSPanel @Override protected void showHelp() { - System.out.println("No help implemented yet."); + jalview.bin.Console.outPrintln("No help implemented yet."); } diff --git a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java index d7f534e..c275bda 100644 --- a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java +++ b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java @@ -101,7 +101,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient webResource = client.resource(DEFAULT_THREEDBEACONS_DOMAIN + query); URI uri = webResource.getURI(); - System.out.println(uri.toString()); + jalview.bin.Console.outPrintln(uri.toString()); // Execute the REST request ClientResponse clientResponse; @@ -269,7 +269,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient String fieldData = (tdbJsonStructure.get(field.getCode()) == null) ? " " : tdbJsonStructure.get(field.getCode()).toString(); - // System.out.println("Field : " + field + " Data : " + fieldData); + // jalview.bin.Console.outPrintln("Field : " + field + " Data : " + fieldData); if (field.isPrimaryKeyColumn()) { primaryKey = fieldData; @@ -293,7 +293,7 @@ public class TDBeaconsFTSRestClient extends FTSRestClient } catch (Exception e) { // e.printStackTrace(); - System.out.println("offending value:" + fieldData + fieldData); + jalview.bin.Console.outPrintln("offending value:" + fieldData + fieldData); } } } diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 1827293..df48c0d 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -219,7 +219,7 @@ public class UniProtFTSRestClient extends FTSRestClient .getEntity(String.class); // Make redundant objects eligible for garbage collection to conserve // memory - // System.out.println(">>>>> response : " + // jalview.bin.Console.outPrintln(">>>>> response : " // + uniProtTabDelimittedResponseString); if (clientResponse.getStatus() != 200) { @@ -307,7 +307,7 @@ public class UniProtFTSRestClient extends FTSRestClient firstRow = false; continue; } - // System.out.println(dataRow); + // jalview.bin.Console.outPrintln(dataRow); result.add(getFTSData(dataRow, uniprotRestRequest)); } searchResult.setNumberOfItemsFound(xTotalResults); @@ -389,7 +389,7 @@ public class UniProtFTSRestClient extends FTSRestClient } catch (Exception e) { e.printStackTrace(); - System.out.println("offending value:" + fieldData); + jalview.bin.Console.outPrintln("offending value:" + fieldData); } } } catch (Exception e) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 711d224..99881e6 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -624,12 +624,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // if (viewport.cursorMode) // { // alignPanel.seqPanel.insertNucAtCursor(false,"A"); - // //System.out.println("A"); + // //jalview.bin.Console.outPrintln("A"); // } // break; /* * case KeyEvent.VK_CLOSE_BRACKET: if (viewport.cursorMode) { - * System.out.println("closing bracket"); } break; + * jalview.bin.Console.outPrintln("closing bracket"); } break; */ case KeyEvent.VK_DELETE: case KeyEvent.VK_BACK_SPACE: @@ -830,7 +830,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void propertyChange(PropertyChangeEvent evt) { - // // System.out.println("Discoverer property change."); + // // jalview.bin.Console.outPrintln("Discoverer property change."); // if (evt.getPropertyName().equals("services")) { SwingUtilities.invokeLater(new Runnable() @@ -839,7 +839,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, @Override public void run() { - System.err.println( + jalview.bin.Console.errPrintln( "Rebuild WS Menu for service change"); BuildWebServiceMenu(); } @@ -854,7 +854,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public void internalFrameClosed( javax.swing.event.InternalFrameEvent evt) { - // System.out.println("deregistering discoverer listener"); + // jalview.bin.Console.outPrintln("deregistering discoverer listener"); Desktop.instance.removeJalviewPropertyChangeListener("services", thisListener); closeMenuItem_actionPerformed(true); @@ -2495,7 +2495,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } catch (Exception ex) { ex.printStackTrace(); - System.out.println("Exception whilst pasting: " + ex); + jalview.bin.Console.outPrintln("Exception whilst pasting: " + ex); // could be anything being pasted in here } @@ -2543,7 +2543,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } catch (Exception ex) { ex.printStackTrace(); - System.out.println("Exception whilst pasting: " + ex); + jalview.bin.Console.outPrintln("Exception whilst pasting: " + ex); // could be anything being pasted in here } catch (OutOfMemoryError oom) { @@ -4343,7 +4343,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { try { - System.err.println("Waiting for building menu to finish."); + jalview.bin.Console.errPrintln("Waiting for building menu to finish."); Thread.sleep(10); } catch (Exception e) { @@ -4359,7 +4359,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, final List legacyItems = new ArrayList<>(); try { - // System.err.println("Building ws menu again " + // jalview.bin.Console.errPrintln("Building ws menu again " // + Thread.currentThread()); // TODO: add support for context dependent disabling of services based // on @@ -4897,7 +4897,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, Desktop.instance); if (pe != null) { - System.err.println("Associated file : " + jalview.bin.Console.errPrintln("Associated file : " + (fm[0].toString()) + " with " + toassoc.getDisplayId(true)); assocfiles++; @@ -5930,7 +5930,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, viewport.getAlignment())); } catch (Exception ex) { - System.err.println(ex.getMessage()); + jalview.bin.Console.errPrintln(ex.getMessage()); return; } } @@ -5952,7 +5952,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, console.runScript(); } catch (Exception ex) { - System.err.println((ex.toString())); + jalview.bin.Console.errPrintln((ex.toString())); JvOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.getString("label.couldnt_run_groovy_script"), MessageManager.getString("label.groovy_support_failed"), @@ -5961,7 +5961,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } else { - System.err.println("Can't run Groovy script as console not found"); + jalview.bin.Console.errPrintln("Can't run Groovy script as console not found"); } } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 3dfb510..3de02bc 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -543,7 +543,7 @@ public class AlignmentPanel extends GAlignmentPanel implements // this is called after loading new annotation onto alignment if (alignFrame.getHeight() == 0) { - System.out.println("NEEDS FIXING"); + jalview.bin.Console.outPrintln("NEEDS FIXING"); } validateAnnotationDimensions(true); addNotify(); diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 28065c3..d26ba89 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1237,7 +1237,7 @@ public class AnnotationLabels extends JPanel { if (debugRedraw) { - System.out.println("before vis: " + i); + jalview.bin.Console.outPrintln("before vis: " + i); } before = true; } @@ -1251,7 +1251,7 @@ public class AnnotationLabels extends JPanel { if (debugRedraw) { - System.out.println( + jalview.bin.Console.outPrintln( "Scroll offset: " + sOffset + " after vis: " + i); } after = true; diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 8321741..8a957bc 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -1507,7 +1507,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, tried = true; } catch (IllegalArgumentException exc) { - System.err.println( + jalview.bin.Console.errPrintln( "Serious issue with viewport geometry imgWidth requested was " + imgWidth); return; @@ -1650,7 +1650,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, && (fadedImage == null || fadedImage.getWidth() != imgWidth || fadedImage.getHeight() != image.getHeight())) { - // System.err.println("redraw faded image ("+(fadedImage==null ? + // jalview.bin.Console.errPrintln("redraw faded image ("+(fadedImage==null ? // "null image" : "") + " lastGood="+lastImageGood+")"); fadedImage = new BufferedImage(imgWidth, image.getHeight(), BufferedImage.TYPE_INT_RGB); diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 49eae98..950f129 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -371,9 +371,9 @@ public class AppJmol extends StructureViewerBase } if (waitTotal > waitMax) { - System.err.println("Timed out waiting for Jmol to load files after " + jalview.bin.Console.errPrintln("Timed out waiting for Jmol to load files after " + waitTotal + "ms"); - // System.err.println("finished: " + jmb.isFinishedInit() + // jalview.bin.Console.errPrintln("finished: " + jmb.isFinishedInit() // + "; loaded: " + Arrays.toString(jmb.getPdbFile()) // + "; files: " + files.toString()); jmb.getStructureFiles(); @@ -532,7 +532,7 @@ public class AppJmol extends StructureViewerBase .openURL("http://wiki.jmol.org");// http://jmol.sourceforge.net/docs/JmolUserGuide/"); } catch (Exception ex) { - System.err.println("Show Jmol help failed with: " + ex.getMessage()); + jalview.bin.Console.errPrintln("Show Jmol help failed with: " + ex.getMessage()); } } diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index 6fac8fc..eb2368d 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -476,7 +476,7 @@ public class AppVarna extends JInternalFrame if (shift != null) { int i = shift.shift(newBase.getIndex()); - // System.err.println("shifted "+(arg1.getIndex())+" to "+i); + // jalview.bin.Console.errPrintln("shifted "+(arg1.getIndex())+" to "+i); ssm.mouseOverVamsasSequence(seq, i, this); } else diff --git a/src/jalview/gui/AppVarnaBinding.java b/src/jalview/gui/AppVarnaBinding.java index 5cfe72a..8951df0 100644 --- a/src/jalview/gui/AppVarnaBinding.java +++ b/src/jalview/gui/AppVarnaBinding.java @@ -574,7 +574,7 @@ public class AppVarnaBinding extends JalviewVarnaBinding } catch (ExceptionNAViewAlgorithm e) { // only throwable for draw mode = 3 NAView - System.err.println("Error drawing RNA: " + e.getMessage()); + jalview.bin.Console.errPrintln("Error drawing RNA: " + e.getMessage()); } } } diff --git a/src/jalview/gui/BlogReader.java b/src/jalview/gui/BlogReader.java index af59ca7..c120a1b 100644 --- a/src/jalview/gui/BlogReader.java +++ b/src/jalview/gui/BlogReader.java @@ -772,7 +772,7 @@ public class BlogReader extends JPanel String formattedDate = Cache.setDateProperty( "JALVIEW_NEWS_RSS_LASTMODIFIED", lastread.getTime()); BlogReader me = new BlogReader(); - System.out.println("Set last date to " + formattedDate); + jalview.bin.Console.outPrintln("Set last date to " + formattedDate); if (me.isNewsNew()) { Console.debug("There is news to read."); diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index cc6a785..f13e151 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -343,7 +343,7 @@ public class ChimeraViewFrame extends StructureViewerBase boolean opened = jmb.openSession(chimeraSessionFile); if (!opened) { - System.err.println("An error occurred opening Chimera session file " + jalview.bin.Console.errPrintln("An error occurred opening Chimera session file " + chimeraSessionFile); } } diff --git a/src/jalview/gui/ColourMenuHelper.java b/src/jalview/gui/ColourMenuHelper.java index c1c75f1..574ba28 100644 --- a/src/jalview/gui/ColourMenuHelper.java +++ b/src/jalview/gui/ColourMenuHelper.java @@ -304,7 +304,7 @@ public class ColourMenuHelper } } catch (Exception ex) { - System.out.println("Error loading User ColourFile\n" + ex); + jalview.bin.Console.outPrintln("Error loading User ColourFile\n" + ex); } } diff --git a/src/jalview/gui/Console.java b/src/jalview/gui/Console.java index 5a23048..6a6cb56 100644 --- a/src/jalview/gui/Console.java +++ b/src/jalview/gui/Console.java @@ -433,20 +433,20 @@ public class Console extends WindowAdapter // you may omit this part for your application // - System.out.println("Hello World 2"); - System.out.println("All fonts available to Graphic2D:\n"); + jalview.bin.Console.outPrintln("Hello World 2"); + jalview.bin.Console.outPrintln("All fonts available to Graphic2D:\n"); GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); String[] fontNames = ge.getAvailableFontFamilyNames(); for (int n = 0; n < fontNames.length; n++) { - System.out.println(fontNames[n]); + jalview.bin.Console.outPrintln(fontNames[n]); } // Testing part: simple an error thrown anywhere in this JVM will be printed // on the Console // We do it with a seperate Thread becasue we don't wan't to break a Thread // used by the Console. - System.out.println("\nLets throw an error on this console"); + jalview.bin.Console.outPrintln("\nLets throw an error on this console"); errorThrower = new Thread(this); errorThrower.setDaemon(true); errorThrower.start(); diff --git a/src/jalview/gui/CrossRefAction.java b/src/jalview/gui/CrossRefAction.java index c15cf2d..6cb59c3 100644 --- a/src/jalview/gui/CrossRefAction.java +++ b/src/jalview/gui/CrossRefAction.java @@ -432,7 +432,7 @@ public class CrossRefAction implements Runnable MessageManager.getString("label.cant_map_cds"), MessageManager.getString("label.operation_failed"), JvOptionPane.OK_OPTION); - System.err.println("Failed to make CDS alignment"); + jalview.bin.Console.errPrintln("Failed to make CDS alignment"); return null; } @@ -466,7 +466,7 @@ public class CrossRefAction implements Runnable if (copyAlignment.getHeight() <= 0) { - System.err.println("No Sequences generated for xRef type " + source); + jalview.bin.Console.errPrintln("No Sequences generated for xRef type " + source); return null; } diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 12ff20b..efefa21 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -439,7 +439,7 @@ public class Desktop extends jalview.jbgui.GDesktop * Send this message to stderr as the warning that follows (due to * reflection) also goes to stderr. */ - System.err.println( + jalview.bin.Console.errPrintln( "Linux platform only! You may have the following warning next: \"WARNING: An illegal reflective access operation has occurred\"\nThis is expected and cannot be avoided, sorry about that."); } final String awtAppClassName = "awtAppClassName"; @@ -873,7 +873,7 @@ public class Desktop extends jalview.jbgui.GDesktop } } catch (Exception ex) { - System.out.println( + jalview.bin.Console.outPrintln( "Unable to paste alignment from system clipboard:\n" + ex); } } @@ -1630,7 +1630,7 @@ public class Desktop extends jalview.jbgui.GDesktop } } catch (Exception ex) { - System.err.println("Error opening help: " + ex.getMessage()); + jalview.bin.Console.errPrintln("Error opening help: " + ex.getMessage()); } } @@ -1861,7 +1861,7 @@ public class Desktop extends jalview.jbgui.GDesktop boolean autoSave = projectFile != null && !saveAs && BackupFiles.getEnabled(); - // System.out.println("autoSave="+autoSave+", projectFile='"+projectFile+"', + // jalview.bin.Console.outPrintln("autoSave="+autoSave+", projectFile='"+projectFile+"', // saveAs="+saveAs+", Backups // "+(BackupFiles.getEnabled()?"enabled":"disabled")); @@ -3410,7 +3410,7 @@ public class Desktop extends jalview.jbgui.GDesktop { if (Platform.isAMacAndNotJS()) { - System.err.println( + jalview.bin.Console.errPrintln( "Please ignore plist error - occurs due to problem with java 8 on OSX"); } } diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 2e9731d..184fdc5 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -1019,7 +1019,7 @@ public class FeatureSettings extends JPanel } } catch (Exception ex) { - System.out.println("Error loading User Colour File\n" + ex); + jalview.bin.Console.outPrintln("Error loading User Colour File\n" + ex); } } @@ -1608,7 +1608,7 @@ public class FeatureSettings extends JPanel { Color newColor = gcol.getMaxColour(); comp.setBackground(newColor); - // System.err.println("Width is " + w / 2); + // jalview.bin.Console.errPrintln("Width is " + w / 2); Icon ficon = new FeatureIcon(gcol, comp.getBackground(), w, h, thr); comp.setIcon(ficon); // tt+="RGB value: Max (" + newColor.getRed() + ", " diff --git a/src/jalview/gui/FeatureTypeSettings.java b/src/jalview/gui/FeatureTypeSettings.java index 09bb2a3..327f6ca 100644 --- a/src/jalview/gui/FeatureTypeSettings.java +++ b/src/jalview/gui/FeatureTypeSettings.java @@ -1096,7 +1096,7 @@ public class FeatureTypeSettings extends JalviewDialog { if (featureSettings != null) { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION ISSUE: overwriting action listener for FeatureColourChooser"); } featureSettings = listener; diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index 658b34f..8829be9 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -133,7 +133,7 @@ public class Help hb.setCurrentID(id.getId()); } catch (BadIDException bad) { - System.out.println("Bad help link: " + id.getId() + jalview.bin.Console.outPrintln("Bad help link: " + id.getId() + ": must match a target in help.jhm"); throw bad; } diff --git a/src/jalview/gui/JDatabaseTree.java b/src/jalview/gui/JDatabaseTree.java index 327eade..9ae764e 100644 --- a/src/jalview/gui/JDatabaseTree.java +++ b/src/jalview/gui/JDatabaseTree.java @@ -122,7 +122,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener } else { - System.err.println("dupe ig for : " + dbs[i] + " \t" + jalview.bin.Console.errPrintln("dupe ig for : " + dbs[i] + " \t" + dbp.getDbName() + " (" + dbp.getDbSource() + ")"); source.remove(tn); } @@ -552,7 +552,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener @Override public void setVisible(boolean arg0) { - System.out.println("setVisible: " + arg0); + jalview.bin.Console.outPrintln("setVisible: " + arg0); super.setVisible(arg0); } } diff --git a/src/jalview/gui/JvOptionPane.java b/src/jalview/gui/JvOptionPane.java index c0efd4a..b4c3256 100644 --- a/src/jalview/gui/JvOptionPane.java +++ b/src/jalview/gui/JvOptionPane.java @@ -717,7 +717,7 @@ public class JvOptionPane extends JOptionPane private static void outputMessage(Object message) { - System.out.println(">>> JOption Message : " + message.toString()); + jalview.bin.Console.outPrintln(">>> JOption Message : " + message.toString()); } public static Object getMockResponse() diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index e0427cc..f05110f 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -713,7 +713,7 @@ public class OptsAndParamsPage } } catch (NumberFormatException e) { - System.err.println(e.toString()); + jalview.bin.Console.errPrintln(e.toString()); } if (minValue != null || maxValue != null) { @@ -750,7 +750,7 @@ public class OptsAndParamsPage } } catch (NumberFormatException e) { - System.err.println(e.toString()); + jalview.bin.Console.errPrintln(e.toString()); } if (minValue != null && maxValue != null) { diff --git a/src/jalview/gui/PaintRefresher.java b/src/jalview/gui/PaintRefresher.java index 953fdc5..36849b0 100755 --- a/src/jalview/gui/PaintRefresher.java +++ b/src/jalview/gui/PaintRefresher.java @@ -194,7 +194,7 @@ public class PaintRefresher { // raise an implementation warning here - not sure if this situation // will ever occur - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION PROBLEM: DATASET out of sync due to an insert whilst calling PaintRefresher.validateSequences(AlignmentI, ALignmentI)"); } List alsq = comp.getSequences(); diff --git a/src/jalview/gui/PairwiseAlignPanel.java b/src/jalview/gui/PairwiseAlignPanel.java index c4b5367..b5b6ffc 100755 --- a/src/jalview/gui/PairwiseAlignPanel.java +++ b/src/jalview/gui/PairwiseAlignPanel.java @@ -104,7 +104,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel if (!first) { - System.out.println(DASHES); + jalview.bin.Console.outPrintln(DASHES); textarea.append(DASHES); } first = false; @@ -139,7 +139,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel for (int i = 0; i < seqs.length; i++) { - System.out.println( + jalview.bin.Console.outPrintln( String.format("%3d %s", i + 1, seqs[i].getDisplayId(true))); } @@ -151,7 +151,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel { System.out.print(String.format("%7d", i + 1)); } - System.out.println(); + jalview.bin.Console.outPrintln(); for (int i = 0; i < seqs.length; i++) { @@ -163,10 +163,10 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel */ System.out.print(String.format("%7.3f", scores[i][j] / totscore)); } - System.out.println(); + jalview.bin.Console.outPrintln(); } - System.out.println("\n"); + jalview.bin.Console.outPrintln("\n"); } /** diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 88c1292..7e86704 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -2189,7 +2189,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener String[] omitHidden = null; - System.out.println("PROMPT USER HERE"); // TODO: decide if a prompt happens + jalview.bin.Console.outPrintln("PROMPT USER HERE"); // TODO: decide if a prompt happens // or we simply trust the user wants // wysiwig behaviour diff --git a/src/jalview/gui/ProgressBar.java b/src/jalview/gui/ProgressBar.java index 011d810..d68d95f 100644 --- a/src/jalview/gui/ProgressBar.java +++ b/src/jalview/gui/ProgressBar.java @@ -231,7 +231,7 @@ public class ProgressBar implements IProgressIndicator final JPanel progressPanel = progressBars.get(id); if (progressPanel == null) { - System.err.println( + jalview.bin.Console.errPrintln( "call setProgressBar before registering the progress bar's handler."); return; } diff --git a/src/jalview/gui/PymolBindingModel.java b/src/jalview/gui/PymolBindingModel.java index 705102a..62dce24 100644 --- a/src/jalview/gui/PymolBindingModel.java +++ b/src/jalview/gui/PymolBindingModel.java @@ -121,7 +121,7 @@ public class PymolBindingModel extends AAStructureBindingModel protected List executeCommand(StructureCommandI command, boolean getReply) { - // System.out.println(command.toString()); // debug + // jalview.bin.Console.outPrintln(command.toString()); // debug return pymolManager.sendCommand(command, getReply); } diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index 8d66a44..f487011 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -184,7 +184,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable validate(); sliderValueChanged(); - // System.out.println((System.currentTimeMillis()-start)); + // jalview.bin.Console.outPrintln((System.currentTimeMillis()-start)); } void sliderValueChanged() diff --git a/src/jalview/gui/RestInputParamEditDialog.java b/src/jalview/gui/RestInputParamEditDialog.java index 8ae5408..9b199fd 100644 --- a/src/jalview/gui/RestInputParamEditDialog.java +++ b/src/jalview/gui/RestInputParamEditDialog.java @@ -53,7 +53,7 @@ public class RestInputParamEditDialog extends GRestInputParamEditDialog .newInstance()); } catch (Throwable x) { - System.err.println( + jalview.bin.Console.errPrintln( "Unexpected exception when instantiating rest input type."); x.printStackTrace(); } @@ -166,7 +166,7 @@ public class RestInputParamEditDialog extends GRestInputParamEditDialog updated = true; } catch (InvalidArgumentException ex) { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION ERROR: Invalid argument for type : " + typeList.getSelectedValue() + "\n"); ex.printStackTrace(); @@ -215,7 +215,7 @@ public class RestInputParamEditDialog extends GRestInputParamEditDialog types.add(jtype.getURLtokenPrefix()); } catch (Throwable x) { - System.err.println( + jalview.bin.Console.errPrintln( "Unexpected exception when instantiating rest input type."); x.printStackTrace(); } diff --git a/src/jalview/gui/RestServiceEditorPane.java b/src/jalview/gui/RestServiceEditorPane.java index cda76d9..8953626 100644 --- a/src/jalview/gui/RestServiceEditorPane.java +++ b/src/jalview/gui/RestServiceEditorPane.java @@ -363,7 +363,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane mtch.group(2) + ":" + mtch.group(3), mtch.group(1), mtch.group(2), mtch.group(3), inputTypes, warnings)) { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION PROBLEM: Cannot parse RestService input parameter string '" + its + "'" + "\n" + warnings); } @@ -389,7 +389,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane } catch (Throwable x) { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION PROBLEM: Cannot parse RestService output parameter string '" + its + "'" + "\n" + warnings); } @@ -399,7 +399,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane } else { - System.err.println( + jalview.bin.Console.errPrintln( "IMPLEMENTATION PROBLEM: Restservice generated from GUI is invalid\n" + warnings); diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index d15cdcf..4f82557 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -343,7 +343,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI } } - // System.err.println(">>> FastPaint to " + transX + " " + transY + " " + // jalview.bin.Console.errPrintln(">>> FastPaint to " + transX + " " + transY + " " // + horizontal + " " + vertical + " " + startRes + " " + endRes // + " " + startSeq + " " + endSeq); @@ -362,7 +362,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI // Call repaint on alignment panel so that repaints from other alignment // panel components can be aggregated. Otherwise performance of the // overview window and others may be adversely affected. - // System.out.println("SeqCanvas fastPaint() repaint() request..."); + // jalview.bin.Console.outPrintln("SeqCanvas fastPaint() repaint() request..."); av.getAlignPanel().repaint(); } finally { @@ -1665,7 +1665,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI public void propertyChange(PropertyChangeEvent evt) { String eventName = evt.getPropertyName(); - // System.err.println(">>SeqCanvas propertyChange " + eventName); + // jalview.bin.Console.errPrintln(">>SeqCanvas propertyChange " + eventName); if (eventName.equals(SequenceGroup.SEQ_GROUP_CHANGED)) { fastPaint = true; @@ -1675,7 +1675,7 @@ public class SeqCanvas extends JPanel implements ViewportListenerI else if (eventName.equals(ViewportRanges.MOVE_VIEWPORT)) { fastPaint = false; - // System.err.println("!!!! fastPaint false from MOVE_VIEWPORT"); + // jalview.bin.Console.errPrintln("!!!! fastPaint false from MOVE_VIEWPORT"); repaint(); return; } diff --git a/src/jalview/gui/SeqCanvas.java.broken b/src/jalview/gui/SeqCanvas.java.broken index c0a86df..3560efd 100755 --- a/src/jalview/gui/SeqCanvas.java.broken +++ b/src/jalview/gui/SeqCanvas.java.broken @@ -377,7 +377,7 @@ public class SeqCanvas extends JComponent } catch (OutOfMemoryError er) { System.gc(); - System.err.println("SeqCanvas OutOfMemory Redraw Error.\n" + er); + jalview.bin.Console.errPrintln("SeqCanvas OutOfMemory Redraw Error.\n" + er); new OOMWarning("Creating alignment image for display", er); return; diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 55f06fc..ce60be6 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -137,7 +137,7 @@ public class SeqPanel extends JPanel MousePos o = (MousePos) obj; boolean b = (column == o.column && seqIndex == o.seqIndex && annotationIndex == o.annotationIndex); - // System.out.println(obj + (b ? "= " : "!= ") + this); + // jalview.bin.Console.outPrintln(obj + (b ? "= " : "!= ") + this); return b; } @@ -881,7 +881,7 @@ public class SeqPanel extends JPanel if (lastMessage == null || !lastMessage.equals(tmp)) { - // System.err.println("mouseOver Sequence: "+tmp); + // jalview.bin.Console.errPrintln("mouseOver Sequence: "+tmp); ssm.mouseOverSequence(sequence, index, pos, av); } lastMessage = tmp; @@ -1006,7 +1006,7 @@ public class SeqPanel extends JPanel @Override public void updateColours(SequenceI seq, int index) { - System.out.println("update the seqPanel colours"); + jalview.bin.Console.outPrintln("update the seqPanel colours"); // repaint(); } @@ -2861,7 +2861,7 @@ public class SeqPanel extends JPanel if (copycolsel && av.hasHiddenColumns() && (av.getAlignment().getHiddenColumns() == null)) { - System.err.println("Bad things"); + jalview.bin.Console.errPrintln("Bad things"); } if (repaint) // always true! { diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index 6b4c74a..137655f 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -599,7 +599,7 @@ public class SequenceFetcher extends JPanel implements Runnable + ((StringPair) database.getSelectedItem()).getDisplay()); // error // +="Couldn't retrieve sequences from "+database.getSelectedItem(); - System.err.println("Retrieval failed for source ='" + jalview.bin.Console.errPrintln("Retrieval failed for source ='" + ((StringPair) database.getSelectedItem()).getDisplay() + "' and query\n'" + textArea.getText() + "'\n"); e.printStackTrace(); diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 0b7af0d..ff409e0 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -172,7 +172,7 @@ public class SplashScreen extends JPanel } if (mt.isErrorAny()) { - System.err.println("Error when loading images!"); + jalview.bin.Console.errPrintln("Error when loading images!"); } } while (!mt.checkAll()); Desktop.instance.setIconImages(ChannelProperties.getIconList()); @@ -228,7 +228,7 @@ public class SplashScreen extends JPanel protected boolean refreshText() { String newtext = Desktop.instance.getAboutMessage(); - // System.err.println("Text found: \n"+newtext+"\nEnd of newtext."); + // jalview.bin.Console.errPrintln("Text found: \n"+newtext+"\nEnd of newtext."); if (oldTextLength != newtext.length()) { iframe.setVisible(false); diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 6fce984..6221f31 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -1525,7 +1525,7 @@ public class StructureChooser extends GStructureChooser // for moment, it will work fine as is because it is self-contained String searchTerm = text.toLowerCase(Locale.ROOT); searchTerm = searchTerm.split(":")[0]; - // System.out.println(">>>>> search term : " + searchTerm); + // jalview.bin.Console.outPrintln(">>>>> search term : " + searchTerm); List wantedFields = new ArrayList<>(); FTSRestRequest pdbRequest = new FTSRestRequest(); pdbRequest.setAllowEmptySeq(false); diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 01a3c2d..b8d2cce 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -1197,7 +1197,7 @@ public abstract class StructureViewerBase extends GStructureViewer } } catch (Exception e) { - System.err.println( + jalview.bin.Console.errPrintln( "Error retrieving PDB id " + pdbid + ": " + e.getMessage()); } finally { diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index 2eff542..0a0c1b8 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -261,7 +261,7 @@ public class TreePanel extends GTreePanel { if (tree == null) { - System.out.println("tree is null"); + jalview.bin.Console.outPrintln("tree is null"); // TODO: deal with case when a change event is received whilst a // tree is still being calculated - should save reference for // processing message later. @@ -269,7 +269,7 @@ public class TreePanel extends GTreePanel } if (evt.getNewValue() == null) { - System.out.println( + jalview.bin.Console.outPrintln( "new alignment sequences vector value is null"); } @@ -896,7 +896,7 @@ public class TreePanel extends GTreePanel pg.close(); } catch (Exception ex) { - System.err.println("Error writing tree as EPS"); + jalview.bin.Console.errPrintln("Error writing tree as EPS"); ex.printStackTrace(); } } diff --git a/src/jalview/gui/VamsasApplication.java b/src/jalview/gui/VamsasApplication.java index 8a8ba8d..28f6c59 100644 --- a/src/jalview/gui/VamsasApplication.java +++ b/src/jalview/gui/VamsasApplication.java @@ -614,7 +614,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource cdoc = null; } catch (Exception ee) { - System.err.println("Exception whilst updating :"); + jalview.bin.Console.errPrintln("Exception whilst updating :"); ee.printStackTrace(System.err); // recover object map backup, since its probably corrupted with references // to Vobjects that don't exist anymore. @@ -803,7 +803,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource // we only care about AlignmentSequence selections SelectionMessage sm = (SelectionMessage) message; sm.validate(); - System.err.println("Received\n" + sm.getRawMessage()); + jalview.bin.Console.errPrintln("Received\n" + sm.getRawMessage()); Object[] jvobjs = sm.getVorbaIDs() == null ? null : new Object[sm.getVorbaIDs().length]; if (jvobjs == null) diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index 7eeee9a..961caa7 100644 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -359,7 +359,7 @@ public class WebserviceInfo extends GWebserviceInfo @Override public void internalFrameClosed(InternalFrameEvent evt) { - // System.out.println("Shutting down webservice client"); + // jalview.bin.Console.outPrintln("Shutting down webservice client"); WSClientI service = thisinfo.getthisService(); if (service != null && service.isCancellable()) { diff --git a/src/jalview/gui/WsJobParameters.java b/src/jalview/gui/WsJobParameters.java index e1613da..196eb32 100644 --- a/src/jalview/gui/WsJobParameters.java +++ b/src/jalview/gui/WsJobParameters.java @@ -493,7 +493,7 @@ public class WsJobParameters extends JPanel implements ItemListener, else { // TODO: show warning - System.err.println("Invalid name. Not saved."); + jalview.bin.Console.errPrintln("Invalid name. Not saved."); } } @@ -642,7 +642,7 @@ public class WsJobParameters extends JPanel implements ItemListener, } else { - System.err.println("Ignoring unknown service argument type " + jalview.bin.Console.errPrintln("Ignoring unknown service argument type " + myarg.getClass().getName()); } } @@ -685,7 +685,7 @@ public class WsJobParameters extends JPanel implements ItemListener, { if (arg instanceof OptionI) { - // System.out.println("Setting option " + // jalview.bin.Console.outPrintln("Setting option " // + System.identityHashCode(arg) + ":" + arg.getName() // + " with " + arg.getDefaultValue()); opanp.selectOption((OptionI) arg, arg.getValue()); @@ -874,7 +874,7 @@ public class WsJobParameters extends JPanel implements ItemListener, if (cw + 120 > panewidth) { jobOptions.add(pbox, "wrap"); - // System.out.println("Wrap on "+pbox.option.getName()); + // jalview.bin.Console.outPrintln("Wrap on "+pbox.option.getName()); cw = hgap + pbox.getSize().width; fh = true; } @@ -946,7 +946,7 @@ public class WsJobParameters extends JPanel implements ItemListener, } // TODO: waste some time trying to eliminate any unnecessary .validate calls // here - // System.out.println("Size will be : "+w+","+os); + // jalview.bin.Console.outPrintln("Size will be : "+w+","+os); // optsAndparams.setPreferredSize(null); // paramPane.getViewport().setView(optsAndparams); paramPane.getViewport().setAutoscrolls(true); @@ -976,7 +976,7 @@ public class WsJobParameters extends JPanel implements ItemListener, disc.run(); } catch (Exception e) { - System.err.println("Aborting. Problem discovering services."); + jalview.bin.Console.errPrintln("Aborting. Problem discovering services."); e.printStackTrace(); return; } @@ -1023,7 +1023,7 @@ public class WsJobParameters extends JPanel implements ItemListener, pr = en.next(); } { - System.out.println("Testing opts dupes for " + jalview.bin.Console.outPrintln("Testing opts dupes for " + lastserv.getUri() + " : " + lastserv.getActionText() + ":" + pr.getName()); List