From eb3e681d6e82ccdd5d312d1981dfb306e7f479f0 Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 3 Nov 2023 07:29:04 +0000 Subject: [PATCH] JAL-4090 JAL-1551 spotlessApply --- src/jalview/analysis/AlignSeq.java | 5 +- src/jalview/analysis/AlignmentSorter.java | 7 +- src/jalview/analysis/AlignmentUtils.java | 24 +- src/jalview/analysis/AverageDistanceEngine.java | 9 +- src/jalview/analysis/CrossRef.java | 3 +- src/jalview/analysis/GeneticCodes.java | 6 +- src/jalview/analysis/Rna.java | 6 +- src/jalview/analysis/TreeEngine.java | 3 +- src/jalview/analysis/TreeModel.java | 11 +- src/jalview/analysis/scoremodels/ScoreModels.java | 3 +- src/jalview/api/SequenceRenderer.java | 9 +- .../api/structures/JalviewStructureDisplayI.java | 6 +- src/jalview/appletgui/APopupMenu.java | 4 +- src/jalview/appletgui/AlignFrame.java | 20 +- src/jalview/appletgui/AlignmentPanel.java | 3 +- src/jalview/appletgui/RedundancyPanel.java | 3 +- src/jalview/appletgui/SeqCanvas.java | 2 +- src/jalview/appletgui/SeqPanel.java | 8 +- src/jalview/bin/Cache.java | 9 +- src/jalview/bin/JalviewLite.java | 86 +- src/jalview/bin/JalviewLiteURLRetrieve.java | 8 +- src/jalview/commands/EditCommand.java | 6 +- src/jalview/datamodel/AlignedCodonFrame.java | 3 +- src/jalview/datamodel/Alignment.java | 5 +- src/jalview/datamodel/ContactListImpl.java | 4 +- src/jalview/datamodel/ContactMapHolder.java | 3 +- src/jalview/datamodel/ContactMatrix.java | 25 +- src/jalview/datamodel/ContactMatrixI.java | 22 +- src/jalview/datamodel/DBRefSource.java | 2 +- src/jalview/datamodel/FloatContactMatrix.java | 5 +- src/jalview/datamodel/GroupSet.java | 7 +- src/jalview/datamodel/SearchResultMatchI.java | 9 +- src/jalview/datamodel/SearchResults.java | 57 +- src/jalview/datamodel/SearchResultsI.java | 1 - .../datamodel/SeqDistanceContactMatrix.java | 4 + src/jalview/datamodel/Sequence.java | 25 +- src/jalview/datamodel/SequenceGroup.java | 8 +- src/jalview/datamodel/SequenceI.java | 3 +- src/jalview/datamodel/features/FeatureStore.java | 8 +- .../datamodel/features/SequenceFeatures.java | 3 +- src/jalview/ext/ensembl/EnsemblGene.java | 3 +- src/jalview/ext/ensembl/EnsemblLookup.java | 4 +- src/jalview/ext/ensembl/EnsemblMap.java | 6 +- src/jalview/ext/ensembl/EnsemblRestClient.java | 10 +- src/jalview/ext/ensembl/EnsemblSeqProxy.java | 17 +- src/jalview/ext/jmol/JalviewJmolBinding.java | 65 +- src/jalview/ext/jmol/JmolCommands.java | 15 +- src/jalview/ext/jmol/JmolParser.java | 4 +- src/jalview/ext/rbvi/chimera/ChimeraListener.java | 6 +- .../ext/rbvi/chimera/JalviewChimeraBinding.java | 5 +- src/jalview/fts/core/FTSDataColumnPreferences.java | 6 +- src/jalview/fts/service/pdb/PDBFTSRestClient.java | 3 +- .../fts/service/threedbeacons/TDB_FTSData.java | 3 +- .../threedbeacons/TDBeaconsFTSRestClient.java | 6 +- src/jalview/gui/AlignFrame.java | 12 +- src/jalview/gui/AlignmentPanel.java | 45 +- src/jalview/gui/AnnotationColourChooser.java | 47 +- src/jalview/gui/AnnotationColumnChooser.java | 21 +- src/jalview/gui/AnnotationLabels.java | 33 +- src/jalview/gui/AnnotationPanel.java | 28 +- src/jalview/gui/AppVarna.java | 3 +- src/jalview/gui/AppVarnaBinding.java | 3 +- src/jalview/gui/ChimeraViewFrame.java | 5 +- src/jalview/gui/ColourMenuHelper.java | 3 +- src/jalview/gui/Console.java | 4 +- src/jalview/gui/CrossRefAction.java | 3 +- src/jalview/gui/FeatureEditor.java | 2 +- src/jalview/gui/FeatureSettings.java | 17 +- src/jalview/gui/FeatureTypeSettings.java | 9 +- src/jalview/gui/IdCanvas.java | 25 +- src/jalview/gui/IdwidthAdjuster.java | 6 +- src/jalview/gui/PCAPanel.java | 9 +- src/jalview/gui/PopupMenu.java | 6 +- src/jalview/gui/QuitHandler.java | 3 +- src/jalview/gui/ScalePanel.java | 22 +- src/jalview/gui/SeqCanvas.java | 4 +- src/jalview/gui/SeqPanel.java | 26 +- src/jalview/gui/StructureChooser.java | 21 +- src/jalview/gui/StructureViewerBase.java | 67 +- src/jalview/gui/TreeCanvas.java | 55 +- src/jalview/gui/TreePanel.java | 25 +- src/jalview/gui/VamsasApplication.java | 3 +- src/jalview/gui/WsJobParameters.java | 24 +- src/jalview/io/AnnotationFile.java | 14 +- src/jalview/io/AppletFormatAdapter.java | 44 +- src/jalview/io/BackupFilenameFilter.java | 4 +- src/jalview/io/BioJsHTMLOutput.java | 10 +- src/jalview/io/ClustalFile.java | 5 +- src/jalview/io/FeaturesFile.java | 21 +- src/jalview/io/FileFormat.java | 4 +- src/jalview/io/FileFormats.java | 3 +- src/jalview/io/HTMLOutput.java | 3 +- src/jalview/io/HtmlSvgOutput.java | 5 +- src/jalview/io/IdentifyFile.java | 3 +- src/jalview/io/JPredFile.java | 9 +- src/jalview/io/JSONFile.java | 3 +- src/jalview/io/JalviewFileChooser.java | 5 +- src/jalview/io/MSFfile.java | 8 +- src/jalview/io/PfamFile.java | 5 +- src/jalview/io/RnamlFile.java | 2 +- src/jalview/io/SequenceAnnotationReport.java | 2 +- src/jalview/io/StockholmFile.java | 9 +- src/jalview/io/StructureFile.java | 3 +- src/jalview/io/VamsasAppDatastore.java | 9 +- src/jalview/io/WSWUBlastClient.java | 3 +- .../io/exceptions/ImageOutputException.java | 4 +- src/jalview/io/gff/ExonerateHelper.java | 9 +- src/jalview/io/gff/Gff3Helper.java | 3 +- src/jalview/io/gff/GffHelperBase.java | 8 +- src/jalview/io/packed/ParsePackedSet.java | 8 +- src/jalview/io/vamsas/Tree.java | 11 +- src/jalview/io/vcf/VCFLoader.java | 6 +- src/jalview/javascript/JSFunctionExec.java | 3 +- src/jalview/javascript/JsSelectionSender.java | 3 +- .../javascript/MouseOverStructureListener.java | 10 +- src/jalview/jbgui/GDesktop.java | 3 +- src/jalview/math/RotatableMatrix.java | 3 +- src/jalview/project/Jalview2XML.java | 119 +- src/jalview/renderer/AnnotationRenderer.java | 6 +- src/jalview/renderer/ContactGeometry.java | 21 +- src/jalview/renderer/ContactMapRenderer.java | 37 +- src/jalview/schemes/ColourSchemeLoader.java | 4 +- src/jalview/schemes/ColourSchemes.java | 5 +- src/jalview/schemes/Consensus.java | 6 +- src/jalview/schemes/CovariationColourScheme.java | 6 +- src/jalview/schemes/FeatureColour.java | 5 +- src/jalview/schemes/ResidueProperties.java | 3 +- src/jalview/structure/StructureCommand.java | 11 +- src/jalview/structure/StructureCommandI.java | 5 +- src/jalview/structure/StructureCommandsBase.java | 2 +- src/jalview/structure/StructureCommandsI.java | 11 +- .../structure/StructureSelectionManager.java | 31 +- .../structures/models/AAStructureBindingModel.java | 17 +- src/jalview/urls/IdentifiersUrlProvider.java | 4 +- src/jalview/util/ChannelProperties.java | 7 +- src/jalview/util/ColorUtils.java | 3 +- src/jalview/util/Format.java | 6 +- src/jalview/util/GroupUrlLink.java | 23 +- src/jalview/util/LaunchUtils.java | 3 +- src/jalview/util/Log4j.java | 3 +- src/jalview/util/Platform.java | 19 +- src/jalview/util/UrlLink.java | 4 +- src/jalview/viewmodel/AlignmentViewport.java | 8 +- src/jalview/viewmodel/ViewportRanges.java | 6 +- src/jalview/workers/AlignCalcManager.java | 10 +- src/jalview/ws/DBRefFetcher.java | 10 +- src/jalview/ws/JobStateSummary.java | 3 +- .../ws/datamodel/MappableContactMatrixI.java | 7 +- .../datamodel/alphafold/MappableContactMatrix.java | 63 +- .../ws/datamodel/alphafold/PAEContactMatrix.java | 21 +- .../ws/dbsources/EbiFileRetrievedProxy.java | 3 +- src/jalview/ws/dbsources/EmblXmlSource.java | 3 +- src/jalview/ws/dbsources/Pdb.java | 3 +- src/jalview/ws/ebi/EBIFetchClient.java | 15 +- src/jalview/ws/jws1/SeqSearchWSThread.java | 3 +- src/jalview/ws/jws2/AbstractJabaCalcWorker.java | 9 +- src/jalview/ws/jws2/JabaWsServerQuery.java | 15 +- src/jalview/ws/jws2/JabawsCalcWorker.java | 6 +- .../ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java | 6 +- src/jalview/ws/jws2/Jws2Discoverer.java | 6 +- src/jalview/ws/jws2/ParameterUtils.java | 3 +- src/jalview/ws/jws2/jabaws2/Jws2Instance.java | 8 +- src/jalview/ws/rest/RestClient.java | 3 +- src/jalview/ws/sifts/SiftsClient.java | 32 +- src/jalview/ws/utils/UrlDownloadClient.java | 10 +- src/jalview/xml/binding/jalview/AlcodonFrame.java | 493 +- src/jalview/xml/binding/jalview/Annotation.java | 1461 +-- .../binding/jalview/AnnotationColourScheme.java | 458 +- .../xml/binding/jalview/AnnotationElement.java | 349 +- src/jalview/xml/binding/jalview/DoubleMatrix.java | 311 +- src/jalview/xml/binding/jalview/DoubleVector.java | 89 +- src/jalview/xml/binding/jalview/Feature.java | 594 +- .../xml/binding/jalview/FeatureMatcher.java | 243 +- .../xml/binding/jalview/FeatureMatcherSet.java | 281 +- src/jalview/xml/binding/jalview/FilterBy.java | 74 +- src/jalview/xml/binding/jalview/JalviewModel.java |12593 ++++++++++---------- .../xml/binding/jalview/JalviewUserColours.java | 1035 +- src/jalview/xml/binding/jalview/MapListType.java | 479 +- .../xml/binding/jalview/MapOnAMatrixType.java | 240 +- src/jalview/xml/binding/jalview/Mapping.java | 198 +- src/jalview/xml/binding/jalview/MatrixType.java | 565 +- src/jalview/xml/binding/jalview/NoValueColour.java | 74 +- src/jalview/xml/binding/jalview/ObjectFactory.java | 1082 +- src/jalview/xml/binding/jalview/PcaDataType.java | 188 +- src/jalview/xml/binding/jalview/Pdbentry.java | 378 +- src/jalview/xml/binding/jalview/Property.java | 121 +- src/jalview/xml/binding/jalview/Sequence.java | 542 +- src/jalview/xml/binding/jalview/SequenceSet.java | 559 +- src/jalview/xml/binding/jalview/SequenceType.java | 247 +- src/jalview/xml/binding/jalview/ThresholdType.java | 40 +- src/jalview/xml/binding/jalview/VAMSAS.java | 145 +- .../binding/jalview/WebServiceParameterSet.java | 321 +- src/jalview/xml/binding/jalview/package-info.java | 4 +- test/jalview/analysis/TestAlignSeq.java | 21 +- test/jalview/bin/CommandsTest.java | 4 +- .../datamodel/AlignmentAnnotationTests.java | 9 +- test/jalview/datamodel/PAEContactMatrixTest.java | 35 +- test/jalview/datamodel/SearchResultsTest.java | 15 +- test/jalview/datamodel/SequenceTest.java | 48 +- .../fts/service/pdb/PDBFTSRestClientTest.java | 10 +- .../threedbeacons/TDBeaconsFTSRestClientTest.java | 2 +- test/jalview/gui/AlignViewportTest.java | 27 +- test/jalview/gui/AlignmentPanelTest.java | 17 +- test/jalview/gui/FeatureSettingsTest.java | 16 +- test/jalview/gui/ScalePanelTest.java | 8 +- test/jalview/gui/SeqPanelTest.java | 8 +- .../StructureChooserQuerySourceTest.java | 43 +- test/jalview/io/RNAMLfileTest.java | 12 +- test/jalview/io/SequenceAnnotationReportTest.java | 2 +- test/jalview/io/cache/JvCacheableInputBoxTest.java | 21 +- test/jalview/project/Jalview2xmlTests.java | 169 +- test/jalview/renderer/ContactGeometryTest.java | 94 +- test/jalview/ws/sifts/SiftsClientTest.java | 18 +- 213 files changed, 13061 insertions(+), 12660 deletions(-) diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index e1d5669..36d2482 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -891,7 +891,7 @@ public class AlignSeq } // ignore case differences - if (allowmismatch || (c1 == c2) || (Math.abs(c2-c1)==('a'-'A'))) + if (allowmismatch || (c1 == c2) || (Math.abs(c2 - c1) == ('a' - 'A'))) { // extend mapping interval if (lp1 + 1 != alignpos || lp2 + 1 != pdbpos) @@ -983,7 +983,8 @@ public class AlignSeq bestm = msq; } } - // jalview.bin.Console.outPrintln("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 b037336..1801674 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -453,8 +453,8 @@ public class AlignmentSorter if (tmp.size() != nSeq) { - jalview.bin.Console.errPrintln("WARNING: tmp.size()=" + tmp.size() + " != nseq=" - + nSeq + jalview.bin.Console.errPrintln("WARNING: tmp.size()=" + tmp.size() + + " != nseq=" + nSeq + " in getOrderByTree - tree contains sequences not in alignment"); } } @@ -847,7 +847,8 @@ public class AlignmentSorter int featureCount = feats[i] == null ? 0 : ((SequenceFeature[]) feats[i]).length; scores[i] = featureCount; - // jalview.bin.Console.errPrintln("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 f470dc6..be5133f 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -547,7 +547,8 @@ public class AlignmentUtils if (translated == null || !(aaRes == translated.charAt(0))) { // debug - // jalview.bin.Console.outPrintln(("Mismatch at " + i + "/" + aaResidue + ": " + // jalview.bin.Console.outPrintln(("Mismatch at " + i + "/" + aaResidue + // + ": " // + codon + "(" + translated + ") != " + aaRes)); return false; } @@ -698,7 +699,8 @@ public class AlignmentUtils * unmapped position; treat like a gap */ sourceGapMappedLength += ratio; - // jalview.bin.Console.errPrintln("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 +885,8 @@ public class AlignmentUtils { if (protein.isNucleotide() || !dna.isNucleotide()) { - jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna"); + jalview.bin.Console + .errPrintln("Wrong alignment type in alignProteinAsDna"); return 0; } List unmappedProtein = new ArrayList<>(); @@ -908,7 +911,8 @@ public class AlignmentUtils { if (protein.isNucleotide() || !dna.isNucleotide()) { - jalview.bin.Console.errPrintln("Wrong alignment type in alignProteinAsDna"); + jalview.bin.Console + .errPrintln("Wrong alignment type in alignProteinAsDna"); return 0; } // todo: implement this @@ -1512,7 +1516,9 @@ public class AlignmentUtils * @param alignment * the alignment to add them to * @param selectionGroup - * current selection group - may be null, if provided then any added annotation will be trimmed to just those columns in the selection group + * current selection group - may be null, if provided then any added + * annotation will be trimmed to just those columns in the selection + * group */ public static void addReferenceAnnotations( Map> annotations, @@ -1536,7 +1542,9 @@ public class AlignmentUtils * @param seq * @param ann * @param selectionGroup - * current selection group - may be null, if provided then any added annotation will be trimmed to just those columns in the selection group + * current selection group - may be null, if provided then any added + * annotation will be trimmed to just those columns in the selection + * group * @return annotation added to {@code seq and {@code alignment} */ public static AlignmentAnnotation addReferenceAnnotationTo( @@ -2770,8 +2778,8 @@ public class AlignmentUtils fromRange[i + 1]); if (range == null) { - jalview.bin.Console.errPrintln("Error in mapping " + seqMap + " from " - + fromSeq.getName()); + jalview.bin.Console.errPrintln("Error in mapping " + seqMap + + " from " + fromSeq.getName()); return false; } int fromCol = fromSeq.findIndex(fromRange[i]); diff --git a/src/jalview/analysis/AverageDistanceEngine.java b/src/jalview/analysis/AverageDistanceEngine.java index d81dd44..286d589 100644 --- a/src/jalview/analysis/AverageDistanceEngine.java +++ b/src/jalview/analysis/AverageDistanceEngine.java @@ -55,8 +55,10 @@ public class AverageDistanceEngine extends TreeEngine /** * compute cosine distance matrix for a given contact matrix and create a * UPGMA tree + * * @param cm - * @param cosineOrDifference false - dot product : true - L1 + * @param cosineOrDifference + * false - dot product : true - L1 */ public AverageDistanceEngine(AlignmentViewport av, AlignmentAnnotation aa, ContactMatrixI cm, boolean cosineOrDifference) @@ -64,12 +66,11 @@ public class AverageDistanceEngine extends TreeEngine this.av = av; this.aa = aa; this.cm = cm; - mode = (cosineOrDifference) ? 1 :0; + mode = (cosineOrDifference) ? 1 : 0; calculate(cm); } - public void calculate(ContactMatrixI cm) { this.cm = cm; @@ -103,7 +104,7 @@ public class AverageDistanceEngine extends TreeEngine // compute distance matrix element ContactListI ith = cm.getContactList(i); distances.setValue(i, i, 0); - if (ith==null) + if (ith == null) { continue; } diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 41582b4..187594f 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -1029,7 +1029,8 @@ public class CrossRef } if (dataset.getSequences() == null) { - jalview.bin.Console.errPrintln("Empty dataset sequence set - NO VECTOR"); + jalview.bin.Console + .errPrintln("Empty dataset sequence set - NO VECTOR"); return false; } List ds = dataset.getSequences(); diff --git a/src/jalview/analysis/GeneticCodes.java b/src/jalview/analysis/GeneticCodes.java index 4c826b2..c91cfa2 100644 --- a/src/jalview/analysis/GeneticCodes.java +++ b/src/jalview/analysis/GeneticCodes.java @@ -140,7 +140,8 @@ public final class GeneticCodes InputStream is = getClass().getResourceAsStream(fileName); if (is == null) { - jalview.bin.Console.errPrintln("Resource file not found: " + fileName); + jalview.bin.Console + .errPrintln("Resource file not found: " + fileName); return; } BufferedReader dataIn = new BufferedReader(new InputStreamReader(is)); @@ -190,7 +191,8 @@ public final class GeneticCodes InputStream is = getClass().getResourceAsStream(fileName); if (is == null) { - jalview.bin.Console.errPrintln("Resource file not found: " + fileName); + jalview.bin.Console + .errPrintln("Resource file not found: " + fileName); return; } BufferedReader dataIn = new BufferedReader(new InputStreamReader(is)); diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 911ee04..0157b91 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -422,7 +422,8 @@ public class Rna final int close = basePair.getBP3(); // jalview.bin.Console.outPrintln("open " + open + " close " + close); - // jalview.bin.Console.outPrintln("lastclose " + lastclose + " lastopen " + lastopen); + // jalview.bin.Console.outPrintln("lastclose " + lastclose + " lastopen " + // + lastopen); // we're moving from right to left based on closing pair /* @@ -441,7 +442,8 @@ public class Rna { int popen = bps.get(j).getBP5(); - // jalview.bin.Console.outPrintln("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/TreeEngine.java b/src/jalview/analysis/TreeEngine.java index a7cbc25..fdc15e2 100644 --- a/src/jalview/analysis/TreeEngine.java +++ b/src/jalview/analysis/TreeEngine.java @@ -214,7 +214,8 @@ public abstract class TreeEngine { // if (_lycount<_lylimit) // { - // jalview.bin.Console.errPrintln("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 ce79a65..1068042 100644 --- a/src/jalview/analysis/TreeModel.java +++ b/src/jalview/analysis/TreeModel.java @@ -353,8 +353,9 @@ public class TreeModel if ((nd.left() == null) && (nd.right() == null)) { - // TODO FIX FOR COLUMN TREES - jalview.bin.Console.outPrintln("Leaf = " + ((SequenceI) nd.element()).getName()); + // TODO FIX FOR COLUMN TREES + jalview.bin.Console + .outPrintln("Leaf = " + ((SequenceI) nd.element()).getName()); jalview.bin.Console.outPrintln("Dist " + nd.dist); jalview.bin.Console.outPrintln("Boot " + nd.getBootstrap()); } @@ -481,7 +482,8 @@ public class TreeModel } else { - jalview.bin.Console.outPrintln(" name = " + ((SequenceI) nd.element()).getName()); + jalview.bin.Console.outPrintln( + " name = " + ((SequenceI) nd.element()).getName()); } jalview.bin.Console.outPrintln( @@ -514,7 +516,8 @@ public class TreeModel { // if (_lycount<_lylimit) // { - // jalview.bin.Console.errPrintln("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/ScoreModels.java b/src/jalview/analysis/scoremodels/ScoreModels.java index d0f21bd..d9648ba 100644 --- a/src/jalview/analysis/scoremodels/ScoreModels.java +++ b/src/jalview/analysis/scoremodels/ScoreModels.java @@ -143,7 +143,8 @@ public class ScoreModels ScoreModelI sm2 = models.get(sm.getName()); if (sm2 != null) { - jalview.bin.Console.errPrintln("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/api/SequenceRenderer.java b/src/jalview/api/SequenceRenderer.java index d5d07ef..99a3687 100644 --- a/src/jalview/api/SequenceRenderer.java +++ b/src/jalview/api/SequenceRenderer.java @@ -35,9 +35,12 @@ public interface SequenceRenderer /** * Configure the Graphics canvas and render options for the renderer - * @param g - the canvas to render to - * @param renderGaps - when true, gap characters will be included when rendered - * + * + * @param g + * - the canvas to render to + * @param renderGaps + * - when true, gap characters will be included when rendered + * */ void prepare(Graphics g, boolean renderGaps); diff --git a/src/jalview/api/structures/JalviewStructureDisplayI.java b/src/jalview/api/structures/JalviewStructureDisplayI.java index 77f2b6d..5365683 100644 --- a/src/jalview/api/structures/JalviewStructureDisplayI.java +++ b/src/jalview/api/structures/JalviewStructureDisplayI.java @@ -196,9 +196,11 @@ public interface JalviewStructureDisplayI /** * - * @return heteroatoms in a form suitable for display and passing to command generator to display hetatms + * @return heteroatoms in a form suitable for display and passing to command + * generator to display hetatms */ - default List getHetatms() { + default List getHetatms() + { return Collections.EMPTY_LIST; } diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 413b0d4..300167f 100644 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -393,8 +393,8 @@ public class APopupMenu extends java.awt.PopupMenu urlLink = new UrlLink(link); } catch (Exception foo) { - jalview.bin.Console.errPrintln("Exception for URLLink '" + link + "': " - + foo.getMessage()); + jalview.bin.Console.errPrintln("Exception for URLLink '" + link + + "': " + foo.getMessage()); continue; } diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 4b858e1..f502952 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -3061,7 +3061,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { if (viewport.applet == null) { - jalview.bin.Console.outPrintln("Not running as applet - no browser available."); + jalview.bin.Console + .outPrintln("Not running as applet - no browser available."); } else { @@ -3982,8 +3983,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (viewer == null) { - jalview.bin.Console.errPrintln("Can't use this object as a structure viewer:" - + jmolviewer.getClass()); + jalview.bin.Console + .errPrintln("Can't use this object as a structure viewer:" + + jmolviewer.getClass()); return null; } SequenceI[] seqs = null; @@ -4142,8 +4144,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } if (protocol == null) { - jalview.bin.Console.errPrintln("Couldn't work out protocol to open structure: " - + pdb.getId()); + jalview.bin.Console + .errPrintln("Couldn't work out protocol to open structure: " + + pdb.getId()); return; } } @@ -4154,8 +4157,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, .setMapping(seqs, chains, pdb.getFile(), protocol, null) == null) { - jalview.bin.Console.errPrintln("Failed to map " + pdb.getFile() + " (" - + protocol + ") to any sequences"); + jalview.bin.Console.errPrintln("Failed to map " + pdb.getFile() + + " (" + protocol + ") to any sequences"); } return; } @@ -4201,7 +4204,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, SequenceI[][] seqs, String[][] chains, String[] protocols) { // TODO Auto-generated method stub - jalview.bin.Console.errPrintln("Aligned Structure View: Not yet implemented."); + jalview.bin.Console + .errPrintln("Aligned Structure View: Not yet implemented."); } /** diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index 71ddcef..9bf1a66 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -693,7 +693,8 @@ public class AlignmentPanel extends Panel if ((hextent + x) > width) { - jalview.bin.Console.errPrintln("hextent was " + hextent + " and x was " + x); + jalview.bin.Console + .errPrintln("hextent was " + hextent + " and x was " + x); x = width - hextent; } diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index a5b652f..bb668a8 100644 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -148,7 +148,8 @@ public class RedundancyPanel extends SliderPanel validate(); sliderValueChanged(); - // jalview.bin.Console.outPrintln("blob done "+ (System.currentTimeMillis()-start)); + // jalview.bin.Console.outPrintln("blob done "+ + // (System.currentTimeMillis()-start)); } void sliderValueChanged() diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 735046e..e92d08e 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -646,7 +646,7 @@ public class SeqCanvas extends Panel implements ViewportListenerI { char s = nextSeq.getCharAt(cursorX); - sr.drawCursor(g,s, (cursorX - startRes) * avcharWidth, + sr.drawCursor(g, s, (cursorX - startRes) * avcharWidth, offset + ((i - startSeq) * avcharHeight)); } } diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index c573612..0087a5f 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1817,9 +1817,11 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (av.getAlignment() == null) { - jalview.bin.Console.outPrintln("Selection message: alignviewport av SeqSetId=" - + av.getSequenceSetId() + " ViewId=" + av.getViewId() - + " 's alignment is NULL! returning immediatly."); + jalview.bin.Console.outPrintln( + "Selection message: alignviewport av SeqSetId=" + + av.getSequenceSetId() + " ViewId=" + + av.getViewId() + + " 's alignment is NULL! returning immediatly."); return; } sgroup = seqsel.intersect(av.getAlignment(), diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 483b1fc..a64e869 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1451,11 +1451,10 @@ public class Cache if (customProxySet && // we have a username but no password for the scheme being // requested - (protocol.equalsIgnoreCase("http") - && (httpUser != null - && httpUser.length() > 0 - && (httpPassword == null - || httpPassword.length == 0))) + (protocol.equalsIgnoreCase("http") + && (httpUser != null && httpUser.length() > 0 + && (httpPassword == null + || httpPassword.length == 0))) || (protocol.equalsIgnoreCase("https") && (httpsUser != null && httpsUser.length() > 0 diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index e8be95f..b73fffc 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -292,8 +292,9 @@ public class JalviewLite extends Applet { if (debug) { - jalview.bin.Console.errPrintln("Selecting region using separator string '" - + separator + "'"); + jalview.bin.Console + .errPrintln("Selecting region using separator string '" + + separator + "'"); } } // deparse fields @@ -396,8 +397,8 @@ public class JalviewLite extends Applet } if (debug) { - jalview.bin.Console.errPrintln("Range '" + cl + "' deparsed as [" + from - + "," + to + "]"); + jalview.bin.Console.errPrintln("Range '" + cl + + "' deparsed as [" + from + "," + to + "]"); } } else @@ -457,8 +458,9 @@ public class JalviewLite extends Applet } else { - jalview.bin.Console.errPrintln("ERROR: Invalid Point selection '" + cl - + "' deparsed as [" + r + "]"); + jalview.bin.Console + .errPrintln("ERROR: Invalid Point selection '" + cl + + "' deparsed as [" + r + "]"); } } } @@ -956,8 +958,8 @@ public class JalviewLite extends Applet + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport().getSequenceSetId())); - jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() - + " listeners in total."); + jalview.bin.Console.errPrintln("There are now " + + javascriptListeners.size() + " listeners in total."); } } @@ -1003,8 +1005,8 @@ public class JalviewLite extends Applet + ((af == null) ? "All frames" : "Just views for " + af.getAlignViewport().getSequenceSetId())); - jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() - + " listeners in total."); + jalview.bin.Console.errPrintln("There are now " + + javascriptListeners.size() + " listeners in total."); } } @@ -1039,10 +1041,11 @@ public class JalviewLite extends Applet .addStructureViewerListener(mol); if (debug) { - jalview.bin.Console.errPrintln("Added a javascript structure viewer listener '" - + listener + "'"); - jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() - + " listeners in total."); + jalview.bin.Console + .errPrintln("Added a javascript structure viewer listener '" + + listener + "'"); + jalview.bin.Console.errPrintln("There are now " + + javascriptListeners.size() + " listeners in total."); } } @@ -1087,7 +1090,8 @@ public class JalviewLite extends Applet rprt = debug; if (debug) { - jalview.bin.Console.errPrintln("Removed listener '" + listener + "'"); + jalview.bin.Console + .errPrintln("Removed listener '" + listener + "'"); } } else @@ -1097,8 +1101,8 @@ public class JalviewLite extends Applet } if (rprt) { - jalview.bin.Console.errPrintln("There are now " + javascriptListeners.size() - + " listeners in total."); + jalview.bin.Console.errPrintln("There are now " + + javascriptListeners.size() + " listeners in total."); } } @@ -1189,8 +1193,9 @@ public class JalviewLite extends Applet } } catch (NumberFormatException e) { - jalview.bin.Console.errPrintln("Ignoring invalid residue number string '" - + pdbResNum + "'"); + jalview.bin.Console + .errPrintln("Ignoring invalid residue number string '" + + pdbResNum + "'"); } } @@ -1220,9 +1225,10 @@ public class JalviewLite extends Applet } catch (Exception ex) { - jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='" - + topRow + "' and leftHandColumn='" + leftHandColumn - + "')"); + jalview.bin.Console + .errPrintln("Couldn't parse integer arguments (topRow='" + + topRow + "' and leftHandColumn='" + + leftHandColumn + "')"); ex.printStackTrace(); } } @@ -1251,8 +1257,9 @@ public class JalviewLite extends Applet } catch (Exception ex) { - jalview.bin.Console.errPrintln("Couldn't parse integer arguments (topRow='" - + topRow + "')"); + jalview.bin.Console + .errPrintln("Couldn't parse integer arguments (topRow='" + + topRow + "')"); ex.printStackTrace(); } @@ -1421,7 +1428,8 @@ public class JalviewLite extends Applet JSObject scriptObject = JSObject.getWindow(this); if (debug && scriptObject != null) { - jalview.bin.Console.errPrintln("Applet has Javascript callback support."); + jalview.bin.Console + .errPrintln("Applet has Javascript callback support."); } } catch (Exception ex) @@ -1465,7 +1473,8 @@ public class JalviewLite extends Applet separator = sep; if (debug) { - jalview.bin.Console.errPrintln("Separator set to '" + separator + "'"); + jalview.bin.Console + .errPrintln("Separator set to '" + separator + "'"); } } else @@ -1573,7 +1582,8 @@ public class JalviewLite extends Applet { if (tries > 0) { - jalview.bin.Console.errPrintln("LiveConnect request thread going to sleep."); + jalview.bin.Console + .errPrintln("LiveConnect request thread going to sleep."); } try { @@ -1584,7 +1594,8 @@ public class JalviewLite extends Applet ; if (tries++ > 0) { - jalview.bin.Console.errPrintln("LiveConnect request thread woken up."); + jalview.bin.Console + .errPrintln("LiveConnect request thread woken up."); } try { @@ -1632,8 +1643,9 @@ public class JalviewLite extends Applet "Calling oninit callback '" + initjscallback + "'."); } catch (Exception e) { - jalview.bin.Console.errPrintln("Exception when executing _oninit callback '" - + initjscallback + "'."); + jalview.bin.Console + .errPrintln("Exception when executing _oninit callback '" + + initjscallback + "'."); e.printStackTrace(); } } @@ -1884,8 +1896,8 @@ public class JalviewLite extends Applet { if (debug) { - jalview.bin.Console.errPrintln("Prepended document base '" + documentBase - + "' to make: '" + withDocBase + "'"); + jalview.bin.Console.errPrintln("Prepended document base '" + + documentBase + "' to make: '" + withDocBase + "'"); } protocol = DataSourceType.URL; return withDocBase; @@ -2475,7 +2487,8 @@ public class JalviewLite extends Applet return rtn; } catch (Exception ex) { - jalview.bin.Console.outPrintln("Exception checking resources: " + f + " " + ex); + jalview.bin.Console.outPrintln( + "Exception checking resources: " + f + " " + ex); return false; } } @@ -2745,7 +2758,8 @@ public class JalviewLite extends Applet this.separator = separator; if (debug) { - jalview.bin.Console.errPrintln("Default Separator now: '" + separator + "'"); + jalview.bin.Console + .errPrintln("Default Separator now: '" + separator + "'"); } } @@ -2901,8 +2915,8 @@ public class JalviewLite extends Applet Color col = ColorUtils.parseColourString(colprop); if (col == null) { - jalview.bin.Console.errPrintln("Couldn't parse '" + colprop + "' as a colour for " - + colparam); + jalview.bin.Console.errPrintln("Couldn't parse '" + colprop + + "' as a colour for " + colparam); } return (col == null) ? defcolour : col; } diff --git a/src/jalview/bin/JalviewLiteURLRetrieve.java b/src/jalview/bin/JalviewLiteURLRetrieve.java index d38892a..4705f20 100644 --- a/src/jalview/bin/JalviewLiteURLRetrieve.java +++ b/src/jalview/bin/JalviewLiteURLRetrieve.java @@ -64,8 +64,9 @@ public class JalviewLiteURLRetrieve extends Applet DataSourceType protocol = null; try { - jalview.bin.Console.outPrintln("Loading thread started with:\n>>file\n" + file - + ">>endfile"); + 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. try @@ -125,7 +126,8 @@ public class JalviewLiteURLRetrieve extends Applet } else { - jalview.bin.Console.outPrintln("User specified Format is " + format); + jalview.bin.Console + .outPrintln("User specified Format is " + format); } AlignmentI al = null; try diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index c15bbf8..c46271f 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -486,7 +486,8 @@ public class EditCommand implements CommandI // // for (int s = 0; s < command.seqs.length; s++) // { - // jalview.bin.Console.outPrintln("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 +1434,8 @@ public class EditCommand implements CommandI } else { - jalview.bin.Console.errPrintln("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 cb74a66..3cca453 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -707,7 +707,8 @@ public class AlignedCodonFrame ds.setSequenceFeatures(dna.getSequenceFeatures()); // dnaSeqs[i] = ds; ssm.fromSeq = ds; - jalview.bin.Console.outPrintln("Realised mapped sequence " + ds.getName()); + jalview.bin.Console + .outPrintln("Realised mapped sequence " + ds.getName()); } } } diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 375e6b4..73ccdc5 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -2057,7 +2057,7 @@ public class Alignment implements AlignmentI, AutoCloseable if (cm == null && _aa.sequenceRef != null) { cm = _aa.sequenceRef.getContactMatrixFor(_aa); - if (cm == null && _aa.sequenceRef.getDatasetSequence()!=null) + if (cm == null && _aa.sequenceRef.getDatasetSequence() != null) { // TODO fix up this logic and unify with getContactListFor cm = _aa.sequenceRef.getDatasetSequence().getContactMatrixFor(_aa); @@ -2069,7 +2069,8 @@ public class Alignment implements AlignmentI, AutoCloseable @Override public ContactListI getContactListFor(AlignmentAnnotation _aa, int column) { - if (_aa.annotations==null || column>=_aa.annotations.length || column<0) + if (_aa.annotations == null || column >= _aa.annotations.length + || column < 0) { return null; } diff --git a/src/jalview/datamodel/ContactListImpl.java b/src/jalview/datamodel/ContactListImpl.java index 7058ac7..7cd9dc9 100644 --- a/src/jalview/datamodel/ContactListImpl.java +++ b/src/jalview/datamodel/ContactListImpl.java @@ -57,7 +57,7 @@ public class ContactListImpl implements ContactListI } if (to_column >= getContactHeight()) { - to_column = getContactHeight()-1; + to_column = getContactHeight() - 1; } ContactRange cr = new ContactRange(); cr.setFrom_column(from_column); @@ -88,7 +88,7 @@ public class ContactListImpl implements ContactListI } } } - if (tot > 0 && to_column>from_column) + if (tot > 0 && to_column > from_column) { cr.setMean(tot / (1 + to_column - from_column)); } diff --git a/src/jalview/datamodel/ContactMapHolder.java b/src/jalview/datamodel/ContactMapHolder.java index 3a64917..45c0d18 100644 --- a/src/jalview/datamodel/ContactMapHolder.java +++ b/src/jalview/datamodel/ContactMapHolder.java @@ -18,7 +18,8 @@ public class ContactMapHolder implements ContactMapHolderI { if (contactmaps != null && contactmaps.size() > 0) { - // defensive copy, and return non redundant set of ContactMatrixI instances + // defensive copy, and return non redundant set of ContactMatrixI + // instances return new HashSet(contactmaps.values()); } return Collections.EMPTY_LIST; diff --git a/src/jalview/datamodel/ContactMatrix.java b/src/jalview/datamodel/ContactMatrix.java index 2e12a91..b01dd6c 100644 --- a/src/jalview/datamodel/ContactMatrix.java +++ b/src/jalview/datamodel/ContactMatrix.java @@ -6,7 +6,8 @@ import java.util.StringTokenizer; import jalview.bin.Console; -public abstract class ContactMatrix extends GroupSetHolder implements ContactMatrixI +public abstract class ContactMatrix extends GroupSetHolder + implements ContactMatrixI { /** * are contacts reflexive ? @@ -112,9 +113,10 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat } }); } + private Float getFloatElementAt(int column, int p) { - + List clist; Float cl = null; if (symmetric) @@ -137,16 +139,18 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat } return cl; } + @Override public double getElementAt(int column, int row) { Float cl = getFloatElementAt(column, row); - if (cl!=null) + if (cl != null) { return cl; } - throw(new RuntimeException("Out of Bounds "+column+","+row)); + throw (new RuntimeException("Out of Bounds " + column + "," + row)); } + @Override public float getMin() { @@ -170,25 +174,28 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat { return "Contact Matrix"; } + public static String contactToFloatString(ContactMatrixI cm) { StringBuilder sb = new StringBuilder(); for (int c = 0; c < cm.getWidth(); c++) { ContactListI cl = cm.getContactList(c); - long lastsb=-1; + long lastsb = -1; if (cl != null) { for (int h = 0; h <= cl.getContactHeight(); h++) { if (sb.length() > 0) { - if (sb.length()-lastsb>320) + if (sb.length() - lastsb > 320) { // newline sb.append('\n'); - lastsb=sb.length(); - } else { + lastsb = sb.length(); + } + else + { sb.append('\t'); } } @@ -203,7 +210,7 @@ public abstract class ContactMatrix extends GroupSetHolder implements ContactMat int rows) { float[][] vals = new float[cols][rows]; - StringTokenizer tabsep = new StringTokenizer(values, "" + '\t'+'\n'); + StringTokenizer tabsep = new StringTokenizer(values, "" + '\t' + '\n'); int c = 0, r = 0; while (tabsep.hasMoreTokens()) { diff --git a/src/jalview/datamodel/ContactMatrixI.java b/src/jalview/datamodel/ContactMatrixI.java index 4261519..0d3bff6 100644 --- a/src/jalview/datamodel/ContactMatrixI.java +++ b/src/jalview/datamodel/ContactMatrixI.java @@ -30,7 +30,9 @@ public interface ContactMatrixI String getType(); int getWidth(); + int getHeight(); + public GroupSetI getGroupSet(); /// proxy methods to simplify use of the interface @@ -126,11 +128,12 @@ public interface ContactMatrixI void setGroupSet(GroupSet makeGroups); - default void randomlyReColourGroups() { + default void randomlyReColourGroups() + { if (hasGroupSet()) { GroupSetI groups = getGroupSet(); - for (BitSet group:groups.getGroups()) + for (BitSet group : groups.getGroups()) { groups.setColorForGroup(group, ColorUtils.getARandomColor()); } @@ -179,9 +182,10 @@ public interface ContactMatrixI } } } - + /** - * look up the colour for a column in the associated contact matrix + * look up the colour for a column in the associated contact matrix + * * @return Color.white or assigned colour */ default Color getGroupColorForPosition(int column) @@ -189,7 +193,7 @@ public interface ContactMatrixI if (hasGroupSet()) { GroupSetI groups = getGroupSet(); - for (BitSet gp:groups.getGroups()) + for (BitSet gp : groups.getGroups()) { if (gp.get(column)) { @@ -202,14 +206,14 @@ public interface ContactMatrixI /** * direct access to column and row position of matrix - - * Implementations are allowed to throw - * RunTimeExceptions if _column/i are out of bounds + * + * Implementations are allowed to throw RunTimeExceptions if _column/i are out + * of bounds * * @param column * @param row * @return */ double getElementAt(int column, int row); - + } diff --git a/src/jalview/datamodel/DBRefSource.java b/src/jalview/datamodel/DBRefSource.java index 3b1757b..cb85341 100755 --- a/src/jalview/datamodel/DBRefSource.java +++ b/src/jalview/datamodel/DBRefSource.java @@ -154,7 +154,7 @@ public class DBRefSource public static boolean isPrimaryCandidate(String ucversion) { - if (ucversion==null) + if (ucversion == null) { // Null/empty version is not a real reference ? return false; diff --git a/src/jalview/datamodel/FloatContactMatrix.java b/src/jalview/datamodel/FloatContactMatrix.java index 5fb156f..0341cf2 100644 --- a/src/jalview/datamodel/FloatContactMatrix.java +++ b/src/jalview/datamodel/FloatContactMatrix.java @@ -1,16 +1,15 @@ package jalview.datamodel; -public class FloatContactMatrix extends GroupSetHolder implements ContactMatrixI +public class FloatContactMatrix extends GroupSetHolder + implements ContactMatrixI { int maxrow = 0, maxcol = 0; - float[][] elements; float maxscore; - public FloatContactMatrix(float[][] matrix) { maxcol = 0; diff --git a/src/jalview/datamodel/GroupSet.java b/src/jalview/datamodel/GroupSet.java index db38e7b..6583fe3 100644 --- a/src/jalview/datamodel/GroupSet.java +++ b/src/jalview/datamodel/GroupSet.java @@ -149,8 +149,9 @@ public class GroupSet implements GroupSetI { return makeGroups(matrix, autoCut, 0, autoCut); } - public static GroupSet makeGroups(ContactMatrixI matrix, boolean auto, float thresh, - boolean abs) + + public static GroupSet makeGroups(ContactMatrixI matrix, boolean auto, + float thresh, boolean abs) { AverageDistanceEngine clusterer = new AverageDistanceEngine(null, null, matrix, true); @@ -197,7 +198,7 @@ public class GroupSet implements GroupSetI nodegroups.add(clusterer.getTopNode()); } } - + List groups = new ArrayList<>(); for (BinaryNode root : nodegroups) { diff --git a/src/jalview/datamodel/SearchResultMatchI.java b/src/jalview/datamodel/SearchResultMatchI.java index dedb960..5d83c84 100644 --- a/src/jalview/datamodel/SearchResultMatchI.java +++ b/src/jalview/datamodel/SearchResultMatchI.java @@ -61,9 +61,12 @@ public interface SearchResultMatchI /** * * @param seq - * @param from - first position to highlight - * @param to - last position to highlight (assumed higher than from) - * @return true iff from-to intersects or marks positions either side of start/end + * @param from + * - first position to highlight + * @param to + * - last position to highlight (assumed higher than from) + * @return true iff from-to intersects or marks positions either side of + * start/end */ boolean adjacent(SequenceI seq, int from, int to); } \ No newline at end of file diff --git a/src/jalview/datamodel/SearchResults.java b/src/jalview/datamodel/SearchResults.java index 546dd6f..9d357c8 100755 --- a/src/jalview/datamodel/SearchResults.java +++ b/src/jalview/datamodel/SearchResults.java @@ -41,7 +41,8 @@ public class SearchResults implements SearchResultsI * One match consists of a sequence reference, start and end positions. * Discontiguous ranges in a sequence require two or more Match objects. */ - public class Match implements SearchResultMatchI, Comparable + public class Match + implements SearchResultMatchI, Comparable { final SequenceI sequence; @@ -160,16 +161,19 @@ public class SearchResults implements SearchResultsI { return (sequence == seq && start <= from && end >= to); } + @Override public boolean adjacent(SequenceI seq, int from, int to) { - return (sequence == seq && ((start <= from && end >= to) || (from<=(end+1) && to >=(end+1)) || (from<=(start-1) && to>=(start-1)))); + return (sequence == seq && ((start <= from && end >= to) + || (from <= (end + 1) && to >= (end + 1)) + || (from <= (start - 1) && to >= (start - 1)))); } @Override public int compareTo(SearchResultMatchI o) { - if (start toRemove=new ArrayList<>(); - for (SearchResultMatchI thatm:matches) + + boolean appending = false; + + // we dynamically maintain an interval to add as we test each range in the + // list + + int cstart = start, cend = end; + List toRemove = new ArrayList<>(); + for (SearchResultMatchI thatm : matches) { - if (thatm.getSequence()==sequence) + if (thatm.getSequence() == sequence) { - if (thatm.contains(sequence,cstart,cend)) + if (thatm.contains(sequence, cstart, cend)) { - // found a match containing the current range. nothing else to do except report if we operated on the list + // found a match containing the current range. nothing else to do + // except report if we operated on the list return appending; } if (thatm.adjacent(sequence, cstart, cend)) @@ -253,14 +258,16 @@ public class SearchResults implements SearchResultsI start = Math.min(m.start, thatm.getStart()); end = Math.max(m.end, thatm.getEnd()); // and check if we keep or remove the old one - if (thatm.getStart()!=start || thatm.getEnd()!=end) - { + if (thatm.getStart() != start || thatm.getEnd() != end) + { toRemove.add(thatm); count--; cstart = start; cend = end; - appending=true; - } else { + appending = true; + } + else + { return false; } } @@ -268,11 +275,12 @@ public class SearchResults implements SearchResultsI } matches.removeAll(toRemove); { - matches.add(new Match(sequence,cstart,cend)); + matches.add(new Match(sequence, cstart, cend)); count++; } return appending; } + @Override public boolean involvesSequence(SequenceI sequence) { @@ -350,7 +358,8 @@ public class SearchResults implements SearchResultsI else { // debug - // jalview.bin.Console.errPrintln("Outwith bounds!" + matchStart+">"+end +" or " + // jalview.bin.Console.errPrintln("Outwith bounds!" + + // matchStart+">"+end +" or " // + matchEnd+"<"+start); } } diff --git a/src/jalview/datamodel/SearchResultsI.java b/src/jalview/datamodel/SearchResultsI.java index d682de1..ec6f5ee 100644 --- a/src/jalview/datamodel/SearchResultsI.java +++ b/src/jalview/datamodel/SearchResultsI.java @@ -51,7 +51,6 @@ public interface SearchResultsI */ void addResult(SequenceI seq, int[] positions); - /** * Adds the given start/end region to this search result. If sequence already * has a search result and the range is adjacent to already highlighted diff --git a/src/jalview/datamodel/SeqDistanceContactMatrix.java b/src/jalview/datamodel/SeqDistanceContactMatrix.java index b04ac13..3e0e796 100644 --- a/src/jalview/datamodel/SeqDistanceContactMatrix.java +++ b/src/jalview/datamodel/SeqDistanceContactMatrix.java @@ -7,6 +7,7 @@ import java.util.List; import jalview.util.MapList; import jalview.ws.datamodel.alphafold.MappableContactMatrix; + /** * Dummy contact matrix based on sequence distance * @@ -18,6 +19,7 @@ public class SeqDistanceContactMatrix implements ContactMatrixI { private static final String SEQUENCE_DISTANCE = "SEQUENCE_DISTANCE"; + private int width = 0; public SeqDistanceContactMatrix(int width) @@ -113,11 +115,13 @@ public class SeqDistanceContactMatrix { return width; } + @Override public double getElementAt(int _column, int i) { return Math.abs(_column - i); } + @Override protected SeqDistanceContactMatrix newMappableContactMatrix( SequenceI newRefSeq, MapList newFromMapList) diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 7a5d5bc..cc21f35 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -353,7 +353,7 @@ public class Sequence extends ASequence implements SequenceI // only copy the given annotation AlignmentAnnotation newann = new AlignmentAnnotation(sqann[i]); ContactMatrixI cm = seq.getContactMatrixFor(sqann[i]); - if (cm!=null) + if (cm != null) { addContactListFor(newann, cm); } @@ -1646,7 +1646,7 @@ public class Sequence extends ASequence implements SequenceI } } // all matrices should have been transferred. so we clear the local holder - _cmholder=null; + _cmholder = null; } return datasetSequence; } @@ -1756,11 +1756,12 @@ public class Sequence extends ASequence implements SequenceI } // transfer from entry to sequence // if entry has a description and sequence doesn't, then transfer - if (entry.getDescription()!=null && (description==null || description.trim().length()==0)) + if (entry.getDescription() != null + && (description == null || description.trim().length() == 0)) { description = entry.getDescription(); } - + // transfer any new features from entry onto sequence if (entry.getSequenceFeatures() != null) { @@ -2142,15 +2143,17 @@ public class Sequence extends ASequence implements SequenceI private ContactMapHolderI getContactMapHolder() { - if (datasetSequence!=null) { - return ((Sequence)datasetSequence).getContactMapHolder(); + if (datasetSequence != null) + { + return ((Sequence) datasetSequence).getContactMapHolder(); } - if (_cmholder==null) + if (_cmholder == null) { - _cmholder=new ContactMapHolder(); + _cmholder = new ContactMapHolder(); } return _cmholder; } + @Override public Collection getContactMaps() { @@ -2173,7 +2176,7 @@ public class Sequence extends ASequence implements SequenceI public AlignmentAnnotation addContactList(ContactMatrixI cm) { AlignmentAnnotation aa; - + if (datasetSequence != null) { aa = datasetSequence.addContactList(cm); @@ -2181,11 +2184,11 @@ public class Sequence extends ASequence implements SequenceI aa = new AlignmentAnnotation(aa); aa.restrict(start, end); aa.adjustForAlignment(); - getContactMapHolder().addContactListFor(aa,cm); + getContactMapHolder().addContactListFor(aa, cm); addAlignmentAnnotation(aa); return aa; } - + // construct new annotation for matrix on dataset sequence aa = getContactMapHolder().addContactList(cm); diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 9837104..7e53c46 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -303,8 +303,9 @@ public class SequenceGroup implements AnnotatedCollectionI newannot.restrict(startRes, endRes); newannot.setSequenceRef(seqs[ipos]); newannot.adjustForAlignment(); - ContactMatrixI cm = seq.getContactMatrixFor(seq.getAnnotation()[a]); - if (cm!=null) + ContactMatrixI cm = seq + .getContactMatrixFor(seq.getAnnotation()[a]); + if (cm != null) { seqs[ipos].addContactListFor(newannot, cm); } @@ -644,7 +645,8 @@ public class SequenceGroup implements AnnotatedCollectionI } catch (java.lang.OutOfMemoryError err) { // TODO: catch OOM - jalview.bin.Console.outPrintln("Out of memory loading groups: " + err); + jalview.bin.Console + .outPrintln("Out of memory loading groups: " + err); } return upd; } diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 2e1daa3..d5114e0 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -415,7 +415,8 @@ public interface SequenceI extends ASequenceI, ContactMapHolderI /** * Derive a sequence (using this one's dataset or as the dataset) * - * @return duplicate sequence and any annotation present with valid dataset sequence + * @return duplicate sequence and any annotation present with valid dataset + * sequence */ public SequenceI deriveSequence(); diff --git a/src/jalview/datamodel/features/FeatureStore.java b/src/jalview/datamodel/features/FeatureStore.java index c19d782..d8e6f82 100644 --- a/src/jalview/datamodel/features/FeatureStore.java +++ b/src/jalview/datamodel/features/FeatureStore.java @@ -401,8 +401,8 @@ public class FeatureStore SequenceFeature sf = contactFeatureEnds.get(index); if (!sf.isContactFeature()) { - jalview.bin.Console.errPrintln("Error! non-contact feature type " + sf.getType() - + " in contact features list"); + jalview.bin.Console.errPrintln("Error! non-contact feature type " + + sf.getType() + " in contact features list"); index++; continue; } @@ -454,8 +454,8 @@ public class FeatureStore SequenceFeature sf = contactFeatureStarts.get(index); if (!sf.isContactFeature()) { - jalview.bin.Console.errPrintln("Error! non-contact feature " + sf.toString() - + " in contact features list"); + 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 ed4474e..6adb93e 100644 --- a/src/jalview/datamodel/features/SequenceFeatures.java +++ b/src/jalview/datamodel/features/SequenceFeatures.java @@ -88,7 +88,8 @@ public class SequenceFeatures implements SequenceFeaturesI String type = sf.getType(); if (type == null) { - jalview.bin.Console.errPrintln("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 391fd6f..d44be1c 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -226,7 +226,8 @@ public class EnsemblGene extends EnsemblSeqProxy return true; } catch (NumberFormatException e) { - jalview.bin.Console.errPrintln("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 e188986..def9d25 100644 --- a/src/jalview/ext/ensembl/EnsemblLookup.java +++ b/src/jalview/ext/ensembl/EnsemblLookup.java @@ -222,8 +222,8 @@ public class EnsemblLookup extends EnsemblRestClient ids, -1, MODE_MAP, null); } catch (IOException | ParseException e) { - jalview.bin.Console.errPrintln("Error parsing " + identifier + " lookup response " - + e.getMessage()); + 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 1fd9a23..e1f5182 100644 --- a/src/jalview/ext/ensembl/EnsemblMap.java +++ b/src/jalview/ext/ensembl/EnsemblMap.java @@ -157,7 +157,8 @@ public class EnsemblMap extends EnsemblRestClient return (parseAssemblyMappingResponse(url)); } catch (Throwable t) { - jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage()); + jalview.bin.Console + .outPrintln("Error calling " + url + ": " + t.getMessage()); return null; } } @@ -265,7 +266,8 @@ public class EnsemblMap extends EnsemblRestClient return null; } catch (Throwable t) { - jalview.bin.Console.outPrintln("Error calling " + url + ": " + t.getMessage()); + jalview.bin.Console + .outPrintln("Error calling " + url + ": " + t.getMessage()); return null; } } diff --git a/src/jalview/ext/ensembl/EnsemblRestClient.java b/src/jalview/ext/ensembl/EnsemblRestClient.java index 540fc98..709136c 100644 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@ -313,7 +313,9 @@ 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 */ - jalview.bin.Console.errPrintln("Response code " + responseCode);// + " for " + url); + jalview.bin.Console.errPrintln("Response code " + responseCode);// + " for + // " + + // url); return null; } @@ -394,7 +396,8 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher } } catch (NumberFormatException | InterruptedException e) { - jalview.bin.Console.errPrintln("Error handling Retry-After: " + e.getMessage()); + jalview.bin.Console.errPrintln( + "Error handling Retry-After: " + e.getMessage()); } } } @@ -566,7 +569,8 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher } } catch (NumberFormatException e) { - jalview.bin.Console.errPrintln("Error in REST version: " + e.toString()); + jalview.bin.Console + .errPrintln("Error in REST version: " + e.toString()); } /* diff --git a/src/jalview/ext/ensembl/EnsemblSeqProxy.java b/src/jalview/ext/ensembl/EnsemblSeqProxy.java index 949c52e..ff394e8 100644 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@ -270,7 +270,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient .getSequenceRecords(accId); if (protein == null || protein.getHeight() == 0) { - jalview.bin.Console.outPrintln("No protein product found for " + accId); + jalview.bin.Console + .outPrintln("No protein product found for " + accId); return; } SequenceI proteinSeq = protein.getSequenceAt(0); @@ -382,7 +383,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient seq.addDBRef(xrefs.get(i)); } - // jalview.bin.Console.outPrintln("primaries are " + seq.getPrimaryDBRefs().toString()); + // jalview.bin.Console.outPrintln("primaries are " + + // seq.getPrimaryDBRefs().toString()); /* * and add a reference to itself */ @@ -508,7 +510,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient result.add(sequence); } catch (ParseException | IOException e) { - jalview.bin.Console.errPrintln("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,8 +662,9 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient if (regions.isEmpty()) { - jalview.bin.Console.outPrintln("Failed to identify target sequence for " + accId - + " from genomic features"); + jalview.bin.Console + .outPrintln("Failed to identify target sequence for " + accId + + " from genomic features"); return null; } @@ -829,7 +833,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient boolean result = transferFeatures(sfs, targetSequence, mapping, accessionId); - // jalview.bin.Console.outPrintln("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/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index f51252c..93a5633 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -156,7 +156,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel jmolHistory(false); if (lastCommand == null || !lastCommand.equals(cmd)) { - jmolScript(cmd + "\n",command.isWaitNeeded()); + jmolScript(cmd + "\n", command.isWaitNeeded()); } jmolHistory(true); lastCommand = cmd; @@ -186,19 +186,19 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // End StructureListener // ////////////////////////// - + //////////////////////////// // HETATM get // - + @Override - public Map getHetatmNames() + public Map getHetatmNames() { - HashMap hetlist=new HashMap(); - for (int mc=0;mc hetlist = new HashMap(); + for (int mc = 0; mc < jmolViewer.ms.mc; mc++) { - Map hets = jmolViewer.ms.getHeteroList(mc); - if (hets!=null) + Map hets = jmolViewer.ms.getHeteroList(mc); + if (hets != null) { hetlist.putAll(hets); } @@ -207,7 +207,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } // //////////////////////////// - + @Override public float[][] functionXY(String functionName, int x, int y) { @@ -295,21 +295,24 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel jmolScript(resetLastRes.toString()); resetLastRes.setLength(0); } - StringBuilder highlightCommands=null; + StringBuilder highlightCommands = null; for (AtomSpec atom : atoms) { - StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(), - atom.getChain(), atom.getPdbFile()); - if (thisAtom!=null) { - if (highlightCommands==null) + StringBuilder thisAtom = highlightAtom(atom.getAtomIndex(), + atom.getPdbResNum(), atom.getChain(), atom.getPdbFile()); + if (thisAtom != null) + { + if (highlightCommands == null) + { + highlightCommands = thisAtom; + } + else { - highlightCommands=thisAtom; - } else { highlightCommands.append(thisAtom); } } } - if (highlightCommands!=null) + if (highlightCommands != null) { jmolHistory(false); jmolScript(highlightCommands.toString()); @@ -343,8 +346,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } // jmol/ssm only - private StringBuilder highlightAtom(int atomIndex, int pdbResNum, String chain, - String pdbfile) + private StringBuilder highlightAtom(int atomIndex, int pdbResNum, + String chain, String pdbfile) { String modelId = getModelIdForFile(pdbfile); if (modelId.isEmpty()) @@ -510,8 +513,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel lastMessage = strInfo; if (data != null) { - jalview.bin.Console.errPrintln("Ignoring additional hover info: " + data - + " (other info: '" + strInfo + "' pos " + atomIndex + ")"); + jalview.bin.Console.errPrintln( + "Ignoring additional hover info: " + data + " (other info: '" + + strInfo + "' pos " + atomIndex + ")"); } mouseOverStructure(atomIndex, strInfo); } @@ -531,7 +535,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ if (strData != null) { - jalview.bin.Console.errPrintln("Ignoring additional pick data string " + strData); + jalview.bin.Console.errPrintln( + "Ignoring additional pick data string " + strData); } int chainSeparator = strInfo.indexOf(":"); int p = 0; @@ -649,7 +654,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } } catch (Exception e) { - jalview.bin.Console.errPrintln("Squashed Jmol callback handler error:"); + jalview.bin.Console + .errPrintln("Squashed Jmol callback handler error:"); e.printStackTrace(); } } @@ -898,8 +904,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void setCallbackFunction(String callbackType, String callbackFunction) { - jalview.bin.Console.errPrintln("Ignoring set-callback request to associate " - + callbackType + " with function " + callbackFunction); + jalview.bin.Console + .errPrintln("Ignoring set-callback request to associate " + + callbackType + " with function " + callbackFunction); } @@ -972,7 +979,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel String buttonsToShow) { - jalview.bin.Console.errPrintln("Allocating Jmol Viewer: " + commandOptions); + jalview.bin.Console + .errPrintln("Allocating Jmol Viewer: " + commandOptions); if (commandOptions == null) { @@ -990,8 +998,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel console = createJmolConsole(consolePanel, buttonsToShow); } catch (Throwable e) { - jalview.bin.Console.errPrintln("Could not create Jmol application console. " - + e.getMessage()); + jalview.bin.Console + .errPrintln("Could not create Jmol application console. " + + e.getMessage()); e.printStackTrace(); } if (consolePanel != null) diff --git a/src/jalview/ext/jmol/JmolCommands.java b/src/jalview/ext/jmol/JmolCommands.java index 1fb8761..7c024ba 100644 --- a/src/jalview/ext/jmol/JmolCommands.java +++ b/src/jalview/ext/jmol/JmolCommands.java @@ -241,7 +241,8 @@ public class JmolCommands extends StructureCommandsBase /* * https://chemapps.stolaf.edu/jmol/docs/#writemodel */ - StructureCommand sc = new StructureCommand("write STATE \"" + filepath + "\""); + StructureCommand sc = new StructureCommand( + "write STATE \"" + filepath + "\""); sc.setWaitNeeded(true); return sc; } @@ -318,21 +319,22 @@ public class JmolCommands extends StructureCommandsBase return new StructureCommand( "load FILES \"" + Platform.escapeBackslashes(file) + "\""); } + @Override public StructureCommandI restoreSession(String filePath) { - return new StructureCommand( - "restore STATE \"" + Platform.escapeBackslashes(filePath) + "\""); + return new StructureCommand("restore STATE \"" + + Platform.escapeBackslashes(filePath) + "\""); } @Override public List showHetatms(List toShow) { // always clear the current hetero cpk display - + StringBuilder sb = new StringBuilder(); sb.append("select hetero; cpk off;"); - + if (toShow != null && !toShow.isEmpty()) { // select what was requested @@ -347,9 +349,10 @@ public class JmolCommands extends StructureCommandsBase // and show as sb.append("; cpk;"); } - + return Arrays.asList(new StructureCommand(sb.toString())); } + /** * Obsolete method, only referenced from * jalview.javascript.MouseOverStructureListener diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 0ca2ba8..92c762b 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -92,6 +92,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener { super(fp, doXferSettings); } + public JmolParser(FileParse fp) throws IOException { super(fp); @@ -488,7 +489,8 @@ public class JmolParser extends StructureFile implements JmolStatusListener { int length = sq.getLength(); boolean ssFound = false; - Annotation asecstr[] = new Annotation[length + (firstResNum-sq.getStart())]; + Annotation asecstr[] = new Annotation[length + + (firstResNum - sq.getStart())]; for (int p = 0; p < length; p++) { if (secstr[p] >= 'A' && secstr[p] <= 'z') diff --git a/src/jalview/ext/rbvi/chimera/ChimeraListener.java b/src/jalview/ext/rbvi/chimera/ChimeraListener.java index af31b78..0c2a478 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraListener.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraListener.java @@ -131,7 +131,8 @@ public class ChimeraListener extends AbstractRequestHandler } else { - jalview.bin.Console.errPrintln("Unexpected chimeraNotification: " + message); + jalview.bin.Console + .errPrintln("Unexpected chimeraNotification: " + message); } } } @@ -143,7 +144,8 @@ public class ChimeraListener extends AbstractRequestHandler */ protected void processModelChanged(String message) { - // jalview.bin.Console.outPrintln(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 a292e88..a82eecb 100644 --- a/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java +++ b/src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java @@ -627,8 +627,9 @@ public abstract class JalviewChimeraBinding extends AAStructureBindingModel executeCommand(false, null, command); } catch (IOException e) { - jalview.bin.Console.errPrintln("Sending commands to Chimera via file failed with " - + e.getMessage()); + 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 86b8c7d..bd4590c 100644 --- a/src/jalview/fts/core/FTSDataColumnPreferences.java +++ b/src/jalview/fts/core/FTSDataColumnPreferences.java @@ -94,7 +94,8 @@ public class FTSDataColumnPreferences extends JScrollPane int x = 0; for (FTSDataColumnI field : allFTSDataColumns) { - // jalview.bin.Console.outPrintln("allFTSDataColumns==" + allFTSDataColumns); + // jalview.bin.Console.outPrintln("allFTSDataColumns==" + + // allFTSDataColumns); if (field.getName().equalsIgnoreCase("all")) { continue; @@ -106,7 +107,8 @@ public class FTSDataColumnPreferences extends JScrollPane data[x++] = new Object[] { ftsRestClient .getAllDefaultDisplayedFTSDataColumns().contains(field), field.getName(), field.getGroup() }; - // jalview.bin.Console.outPrintln(" 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/pdb/PDBFTSRestClient.java b/src/jalview/fts/service/pdb/PDBFTSRestClient.java index 5619075..b4bb66e 100644 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@ -183,7 +183,8 @@ public class PDBFTSRestClient extends FTSRestClient Map jsonObj = null; String responseString = null; - jalview.bin.Console.outPrintln("query >>>>>>> " + pdbRestRequest.toString()); + jalview.bin.Console + .outPrintln("query >>>>>>> " + pdbRestRequest.toString()); if (!isMocked()) { diff --git a/src/jalview/fts/service/threedbeacons/TDB_FTSData.java b/src/jalview/fts/service/threedbeacons/TDB_FTSData.java index 4e1b2b0..45cf825 100644 --- a/src/jalview/fts/service/threedbeacons/TDB_FTSData.java +++ b/src/jalview/fts/service/threedbeacons/TDB_FTSData.java @@ -154,11 +154,12 @@ public class TDB_FTSData implements FTSData { return (String) getField(Model_id); } - + public String getConfidenceScoreType() { return (String) getField(Confidence_Score_Type); } + public String getConfidenceScoreVersion() { return (String) getField(Confidence_Score_Version); diff --git a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java index c275bda..67ed7e6 100644 --- a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java +++ b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java @@ -269,7 +269,8 @@ public class TDBeaconsFTSRestClient extends FTSRestClient String fieldData = (tdbJsonStructure.get(field.getCode()) == null) ? " " : tdbJsonStructure.get(field.getCode()).toString(); - // jalview.bin.Console.outPrintln("Field : " + field + " Data : " + fieldData); + // jalview.bin.Console.outPrintln("Field : " + field + " Data : " + + // fieldData); if (field.isPrimaryKeyColumn()) { primaryKey = fieldData; @@ -293,7 +294,8 @@ public class TDBeaconsFTSRestClient extends FTSRestClient } catch (Exception e) { // e.printStackTrace(); - jalview.bin.Console.outPrintln("offending value:" + fieldData + fieldData); + jalview.bin.Console + .outPrintln("offending value:" + fieldData + fieldData); } } } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 4f13a78..0745b85 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4864,7 +4864,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } mtch = idm.findAllIdMatches(pdbfn); } - FileFormatI type=null; + FileFormatI type = null; if (mtch != null) { try @@ -4882,7 +4882,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } // File wasn't named like one of the sequences or wasn't a PDB // file. - filesnotmatched.add(new Object[] { file, protocol, type}); + filesnotmatched.add(new Object[] { file, protocol, type }); } } int assocfiles = 0; @@ -4936,7 +4936,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ for (Object[] o : filesmatched) { - filesnotmatched.add(new Object[] { o[0], o[1]}); + filesnotmatched.add(new Object[] { o[0], o[1] }); } } } @@ -4960,7 +4960,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } for (Object[] fn : filesnotmatched) { - loadJalviewDataFile(fn[0], (DataSourceType) fn[1], (FileFormatI)fn[2], null); + loadJalviewDataFile(fn[0], (DataSourceType) fn[1], + (FileFormatI) fn[2], null); } } @@ -5854,7 +5855,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } } alignPanel.validateAnnotationDimensions(true); - // TODO this triggers relayout of annotation panel - otherwise annotation label height is different to panel height + // TODO this triggers relayout of annotation panel - otherwise annotation + // label height is different to panel height alignPanel.fontChanged(); alignPanel.alignmentChanged(); } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index fe6477e..d3f80ce 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -298,8 +298,10 @@ public class AlignmentPanel extends GAlignmentPanel implements { return calculateIdWidth(-1, false, false); } + /** * pre 2.11.3 Id width calculation - used when importing old projects only + * * @return */ public int getLegacyIdWidth() @@ -328,26 +330,34 @@ public class AlignmentPanel extends GAlignmentPanel implements { return calculateIdWidth(maxwidth, true, false); } + /** * Calculate the width of the alignment labels based on the displayed names * and any bounds on label width set in preferences. * * @param maxwidth * -1 or maximum width allowed for IdWidth - * @param includeAnnotations - when true includes width of any additional marks in annotation id panel - * @param visibleOnly - when true, ignore label widths for hidden annotation rows + * @param includeAnnotations + * - when true includes width of any additional marks in annotation + * id panel + * @param visibleOnly + * - when true, ignore label widths for hidden annotation rows * @return Dimension giving the maximum width of the alignment label panel * that should be used. */ public Dimension calculateIdWidth(int maxwidth, boolean includeAnnotations, boolean visibleOnly) { - return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations, visibleOnly); + return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations, + visibleOnly); } - + /** * legacy mode or post 2.11.3 ID width calculation - * @param legacy - uses annotation labels, not rendered label width (excludes additional decorators) + * + * @param legacy + * - uses annotation labels, not rendered label width (excludes + * additional decorators) * @param maxwidth * @param includeAnnotations * @param visibleOnly @@ -606,7 +616,8 @@ public class AlignmentPanel extends GAlignmentPanel implements // this is called after loading new annotation onto alignment if (alignFrame.getHeight() == 0) { - jalview.bin.Console.error("adjustAnnotationHeight called with zero height alignment window"); + jalview.bin.Console.error( + "adjustAnnotationHeight called with zero height alignment window"); } validateAnnotationDimensions(true); addNotify(); @@ -1040,13 +1051,13 @@ public class AlignmentPanel extends GAlignmentPanel implements final int idWidth, idWidthForGui; // otherwise calculate it idWidth = getVisibleIdWidth(false); -// if (getIdPanel()!=null && getIdPanel().getWidth()>0) -// { -// // use the current IdPanel's width, if its set and non-zero -// idWidthForGui = getIdPanel().getWidth(); -// } else { -// idWidthForGui=0; -// } + // if (getIdPanel()!=null && getIdPanel().getWidth()>0) + // { + // // use the current IdPanel's width, if its set and non-zero + // idWidthForGui = getIdPanel().getWidth(); + // } else { + // idWidthForGui=0; + // } /* * Get the horizontal offset to where we draw the sequences. * This is idWidth if using a single Graphics context, else zero. @@ -1096,7 +1107,7 @@ public class AlignmentPanel extends GAlignmentPanel implements final int alignmentDrawnHeight = (endSeq - startSeq) * charHeight + 3; alignmentGraphics.setColor(Color.white); - alignmentGraphics.fillRect(0, 0, pageWidth, pageHeight+scaleHeight); + alignmentGraphics.fillRect(0, 0, pageWidth, pageHeight + scaleHeight); /* * draw the Scale at horizontal offset, then reset to top left (0, 0) @@ -1114,9 +1125,9 @@ public class AlignmentPanel extends GAlignmentPanel implements IdCanvas idCanvas = getIdPanel().getIdCanvas(); List selection = av.getSelectionGroup() == null ? null : av.getSelectionGroup().getSequences(null); - + idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1, - selection, false,idWidth); + selection, false, idWidth); idGraphics.setFont(av.getFont()); idGraphics.translate(0, -scaleHeight); @@ -1263,7 +1274,7 @@ public class AlignmentPanel extends GAlignmentPanel implements // see if rendering offscreen - check preferences and calc width accordingly if (!onscreen && Cache.getDefault("FIGURE_AUTOIDWIDTH", false)) { - return calculateIdWidth(-1,true,true).width; + return calculateIdWidth(-1, true, true).width; } Integer idwidth = onscreen ? null : Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH"); diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index d898398..965770c 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -73,9 +73,11 @@ public class AnnotationColourChooser extends AnnotationRowFilter public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap) { - this(av,ap,null); + this(av, ap, null); } - public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap,AnnotationColourGradient initSettings) + + public AnnotationColourChooser(AlignViewport av, final AlignmentPanel ap, + AnnotationColourGradient initSettings) { super(av, ap); oldcs = av.getGlobalColourScheme(); @@ -110,15 +112,17 @@ public class AnnotationColourChooser extends AnnotationRowFilter setDefaultMinMax(); adjusting = true; - if (oldcs instanceof AnnotationColourGradient && initSettings==null) + if (oldcs instanceof AnnotationColourGradient && initSettings == null) { // init from oldcs initialiseFrom((AnnotationColourGradient) oldcs); - } else { + } + else + { // use initial colour gradient - if any.. initialiseFrom(initSettings); } - + jbInit(); adjusting = false; @@ -126,12 +130,13 @@ public class AnnotationColourChooser extends AnnotationRowFilter frame.invalidate(); frame.pack(); } + private void initialiseFrom(AnnotationColourGradient acg) { - if (acg!=null) + if (acg != null) { useOriginalColours.setSelected( - acg.isPredefinedColours() || acg.getBaseColour() != null); + acg.isPredefinedColours() || acg.getBaseColour() != null); if (!acg.isPredefinedColours() && acg.getBaseColour() == null) { minColour.setBackground(acg.getMinColour()); @@ -146,10 +151,11 @@ public class AnnotationColourChooser extends AnnotationRowFilter populateThresholdComboBox(threshold); - if (acg!=null) + if (acg != null) { String label = getAnnotationMenuLabel(acg.getAnnotation()); - // TODO: workaround below shouldn't be necessary - there's a bug in getAnnotationMenuLabel! + // TODO: workaround below shouldn't be necessary - there's a bug in + // getAnnotationMenuLabel! if (acg.isSeqAssociated()) { label = acg.getAnnotation().label; @@ -375,8 +381,7 @@ public class AnnotationColourChooser extends AnnotationRowFilter return; } - int selIndex = annotations - .getSelectedIndex(); + int selIndex = annotations.getSelectedIndex(); int annIndex = annmap[selIndex]; setCurrentAnnotation( av.getAlignment().getAlignmentAnnotation()[annIndex]); @@ -475,26 +480,34 @@ public class AnnotationColourChooser extends AnnotationRowFilter * @param av * @param ap * @param alignmentAnnotation - * @param perseq - when true, enable per-sequence if alignment annotation is per sequence + * @param perseq + * - when true, enable per-sequence if alignment annotation is per + * sequence */ public static void displayFor(AlignViewport av, AlignmentPanel ap, AlignmentAnnotation alignmentAnnotation, boolean perSeq) { ColourSchemeI global = av.getGlobalColourScheme(); - AnnotationColourGradient newCS = new AnnotationColourGradient(alignmentAnnotation, global, alignmentAnnotation.threshold!=null ? AnnotationColourGradient.ABOVE_THRESHOLD:AnnotationColourGradient.NO_THRESHOLD); - if (alignmentAnnotation.sequenceRef!=null) + AnnotationColourGradient newCS = new AnnotationColourGradient( + alignmentAnnotation, global, + alignmentAnnotation.threshold != null + ? AnnotationColourGradient.ABOVE_THRESHOLD + : AnnotationColourGradient.NO_THRESHOLD); + if (alignmentAnnotation.sequenceRef != null) { newCS.setSeqAssociated(perSeq); } - for (int i=0;i(getAnnotationItems(false))); populateThresholdComboBox(threshold); AnnotationColumnChooser lastChooser = av @@ -139,14 +141,16 @@ public class AnnotationColumnChooser extends AnnotationRowFilter percentThreshold .setSelected(lastChooser.percentThreshold.isSelected()); } - if (selectedAnnotation!=null) + if (selectedAnnotation != null) { - try { + try + { setCurrentAnnotation(selectedAnnotation); - annotations.setSelectedItem(getAnnotationMenuLabel(selectedAnnotation)); + annotations.setSelectedItem( + getAnnotationMenuLabel(selectedAnnotation)); } catch (Exception x) { - Console.error("Couldn't select annotation in column chooser",x); + Console.error("Couldn't select annotation in column chooser", x); } } @@ -869,6 +873,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter public static void displayFor(AlignViewport av, AlignmentPanel ap, AlignmentAnnotation alignmentAnnotation) { - AnnotationColumnChooser colchooser = new AnnotationColumnChooser(av, ap, alignmentAnnotation); + AnnotationColumnChooser colchooser = new AnnotationColumnChooser(av, ap, + alignmentAnnotation); } } diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 08a25ba..6b98944 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -1198,7 +1198,8 @@ public class AnnotationLabels extends JPanel * @param width * Width for scaling labels */ - public void drawComponent(Graphics g, boolean clip, int givenWidth, boolean forGUI) + public void drawComponent(Graphics g, boolean clip, int givenWidth, + boolean forGUI) { int width = givenWidth; IdwidthAdjuster iwa = null; @@ -1210,8 +1211,8 @@ public class AnnotationLabels extends JPanel { Graphics2D g2d = (Graphics2D) g; Graphics dummy = g2d.create(); - int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, forGUI, - null, false); + int newAnnotationIdWidth = drawLabels(dummy, clip, width, false, + forGUI, null, false); dummy.dispose(); Dimension d = ap.calculateDefaultAlignmentIdWidth(); int alignmentIdWidth = d.width; @@ -1245,8 +1246,10 @@ public class AnnotationLabels extends JPanel } else { - int newAnnotationIdWidth = drawLabels(g, clip, width, false, forGUI, null, false); - width = newAnnotationIdWidth