From: Jim Procter Date: Wed, 5 Oct 2016 15:28:14 +0000 (+0100) Subject: JAL-2189 source formatting X-Git-Tag: Release_2_10_0~9^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=853624fb32058cccc544ae7d13af6ad4b0800b6c;p=jalview.git JAL-2189 source formatting --- diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index df98833..ad5837e 100644 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -189,8 +189,10 @@ public class AppletPDBCanvas extends Panel implements MouseListener, for (int i = 0; i < pdb.getChains().size(); i++) { - mappingDetails.append("\n\nPDB Sequence is :\nSequence = " - + pdb.getChains().elementAt(i).sequence.getSequenceAsString()); + mappingDetails + .append("\n\nPDB Sequence is :\nSequence = " + + pdb.getChains().elementAt(i).sequence + .getSequenceAsString()); mappingDetails.append("\nNo of residues = " + pdb.getChains().elementAt(i).residues.size() + "\n\n"); @@ -199,8 +201,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, // Align the sequence to the pdb // TODO: DNa/Pep switch AlignSeq as = new AlignSeq(sequence, - pdb.getChains().elementAt(i).sequence, - pdb.getChains().elementAt(i).isNa ? AlignSeq.DNA : AlignSeq.PEP); + pdb.getChains().elementAt(i).sequence, pdb.getChains() + .elementAt(i).isNa ? AlignSeq.DNA : AlignSeq.PEP); as.calcScoreMatrix(); as.traceAlignment(); PrintStream ps = new PrintStream(System.out) diff --git a/src/MCview/Atom.java b/src/MCview/Atom.java index fe6a0ac..904e307 100755 --- a/src/MCview/Atom.java +++ b/src/MCview/Atom.java @@ -126,6 +126,7 @@ public class Atom } return false; } + public Atom(float x, float y, float z) { this.x = x; diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 1c7a1f7..0dd58ad 100644 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -188,8 +188,10 @@ public class PDBCanvas extends JPanel implements MouseListener, for (int i = 0; i < pdb.getChains().size(); i++) { - mappingDetails.append("\n\nPDB Sequence is :\nSequence = " - + pdb.getChains().elementAt(i).sequence.getSequenceAsString()); + mappingDetails + .append("\n\nPDB Sequence is :\nSequence = " + + pdb.getChains().elementAt(i).sequence + .getSequenceAsString()); mappingDetails.append("\nNo of residues = " + pdb.getChains().elementAt(i).residues.size() + "\n\n"); diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index cf794b6..b74f101 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -357,53 +357,53 @@ public class PDBChain else { - // Make a new Residue object with the new atoms vector - residues.addElement(new Residue(resAtoms, resNumber - 1, count)); + // Make a new Residue object with the new atoms vector + residues.addElement(new Residue(resAtoms, resNumber - 1, count)); - Residue tmpres = residues.lastElement(); - Atom tmpat = tmpres.atoms.get(0); - // Make A new SequenceFeature for the current residue numbering + Residue tmpres = residues.lastElement(); + Atom tmpat = tmpres.atoms.get(0); + // Make A new SequenceFeature for the current residue numbering SequenceFeature sf = new SequenceFeature("RESNUM", tmpat.resName - + ":" + tmpat.resNumIns + " " + pdbid + id, "", offset - + count, offset + count, pdbid); - resFeatures.addElement(sf); - resAnnotation.addElement(new Annotation(tmpat.tfactor)); - // Keep totting up the sequence + + ":" + tmpat.resNumIns + " " + pdbid + id, "", offset + + count, offset + count, pdbid); + resFeatures.addElement(sf); + resAnnotation.addElement(new Annotation(tmpat.tfactor)); + // Keep totting up the sequence - if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null) - { - String nucname = tmpat.resName.trim(); - // use the aaIndex rather than call 'toLower' - which would take a bit - // more time. - deoxyn = nucname.length() == 2 - && ResidueProperties.aaIndex[nucname.charAt(0)] == ResidueProperties.aaIndex['D']; - if (tmpat.name.equalsIgnoreCase("CA") - || ResidueProperties.nucleotideIndex[nucname - .charAt((deoxyn ? 1 : 0))] == -1) + if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null) { + String nucname = tmpat.resName.trim(); + // use the aaIndex rather than call 'toLower' - which would take a bit + // more time. + deoxyn = nucname.length() == 2 + && ResidueProperties.aaIndex[nucname.charAt(0)] == ResidueProperties.aaIndex['D']; + if (tmpat.name.equalsIgnoreCase("CA") + || ResidueProperties.nucleotideIndex[nucname + .charAt((deoxyn ? 1 : 0))] == -1) + { char r = ResidueProperties .getSingleCharacterCode(ResidueProperties .getCanonicalAminoAcid(tmpat.resName)); seq.append(r == '0' ? 'X' : r); // System.err.println("PDBReader:Null aa3Hash for " + // tmpat.resName); + } + else + { + // nucleotide flag + nucleotide = true; + seq.append(nucname.charAt((deoxyn ? 1 : 0))); + } } else { - // nucleotide flag - nucleotide = true; - seq.append(nucname.charAt((deoxyn ? 1 : 0))); - } - } - else - { - if (nucleotide) - { - System.err - .println("Warning: mixed nucleotide and amino acid chain.. its gonna do bad things to you!"); + if (nucleotide) + { + System.err + .println("Warning: mixed nucleotide and amino acid chain.. its gonna do bad things to you!"); + } + seq.append(ResidueProperties.aa[((Integer) symbol).intValue()]); } - seq.append(ResidueProperties.aa[((Integer) symbol).intValue()]); - } count++; } } @@ -425,11 +425,11 @@ public class PDBChain if (StructureImportSettings.isShowSeqFeatures()) { - for (i = 0, iSize = resFeatures.size(); i < iSize; i++) - { - sequence.addSequenceFeature(resFeatures.elementAt(i)); - resFeatures.setElementAt(null, i); - } + for (i = 0, iSize = resFeatures.size(); i < iSize; i++) + { + sequence.addSequenceFeature(resFeatures.elementAt(i)); + resFeatures.setElementAt(null, i); + } } if (visibleChainAnnotation) { diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index 66ce147..8f014a4 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -438,8 +438,7 @@ public class PDBViewer extends JInternalFrame implements Runnable radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( - jalview.gui.Desktop.desktop, - MessageManager + jalview.gui.Desktop.desktop, MessageManager .getString("label.remove_from_default_list"), MessageManager .getString("label.remove_user_defined_colour"), diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 2746807..f5a0255 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -55,8 +55,7 @@ public class PDBfile extends StructureFile } public PDBfile(boolean addAlignmentAnnotations, boolean predictSecStr, - boolean externalSecStr, - FileParse source) throws IOException + boolean externalSecStr, FileParse source) throws IOException { super(false, source); addSettings(addAlignmentAnnotations, predictSecStr, externalSecStr); @@ -145,7 +144,7 @@ public class PDBfile extends StructureFile Atom tmpatom = new Atom(line); try { - tmpchain = findChain(tmpatom.chain); + tmpchain = findChain(tmpatom.chain); if (tmpatom.resNumIns.trim().equals(lastID)) { // phosphorylated protein - seen both CA and P.. @@ -203,8 +202,6 @@ public class PDBfile extends StructureFile markCalcIds(); } - - /** * Process a parsed chain to construct and return a Sequence, and add it to * the list of sequences parsed. diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 369721d..3ad3188 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -663,8 +663,7 @@ public class AlignSeq } pid = pid / (aseq1.length - count) * 100; - output = output.append(new Format("Percentage ID = %2.2f\n") - .form(pid)); + output = output.append(new Format("Percentage ID = %2.2f\n").form(pid)); try { os.print(output.toString()); diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 5ee4bcb..59cdccf 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -719,10 +719,12 @@ public class AlignmentSorter public static void sortByFeature(String featureLabel, String groupLabel, int start, int stop, AlignmentI alignment, String method) { - sortByFeature(featureLabel == null ? null + sortByFeature( + featureLabel == null ? null : Arrays.asList(new String[] { featureLabel }), - groupLabel == null ? null - : Arrays.asList(new String[]{ groupLabel }), start, stop, alignment, method); + groupLabel == null ? null : Arrays + .asList(new String[] { groupLabel }), start, stop, + alignment, method); } private static boolean containsIgnoreCase(final String lab, @@ -747,8 +749,8 @@ public class AlignmentSorter } public static void sortByFeature(List featureLabels, - List groupLabels, int start, int stop, AlignmentI alignment, - String method) + List groupLabels, int start, int stop, + AlignmentI alignment, String method) { if (method != FEATURE_SCORE && method != FEATURE_LABEL && method != FEATURE_DENSITY) diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index c521d9b..34fe221 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -73,7 +73,9 @@ public class AlignmentUtils { private static final int CODON_LENGTH = 3; + private static final String SEQUENCE_VARIANT = "sequence_variant:"; + private static final String ID = "ID"; /** @@ -446,8 +448,8 @@ public class AlignmentUtils */ if (cdnaLength != mappedLength && cdnaLength > 2) { - String lastCodon = String.valueOf(cdnaSeqChars, cdnaLength - CODON_LENGTH, CODON_LENGTH) - .toUpperCase(); + String lastCodon = String.valueOf(cdnaSeqChars, + cdnaLength - CODON_LENGTH, CODON_LENGTH).toUpperCase(); for (String stop : ResidueProperties.STOP) { if (lastCodon.equals(stop)) @@ -509,8 +511,7 @@ public class AlignmentUtils int aaPos = 0; int dnaPos = cdnaStart; - for (; dnaPos < cdnaSeqChars.length - 2 - && aaPos < aaSeqChars.length; dnaPos += CODON_LENGTH, aaPos++) + for (; dnaPos < cdnaSeqChars.length - 2 && aaPos < aaSeqChars.length; dnaPos += CODON_LENGTH, aaPos++) { String codon = String.valueOf(cdnaSeqChars, dnaPos, CODON_LENGTH); final String translated = ResidueProperties.codonTranslate(codon); @@ -936,7 +937,7 @@ public class AlignmentUtils .println("alignCdsSequenceAsProtein needs aligned sequence!"); return false; } - + List dnaMappings = MappingUtils .findMappingsForSequence(cdsSeq, mappings); for (AlignedCodonFrame mapping : dnaMappings) @@ -958,7 +959,8 @@ public class AlignmentUtils .getFromRanges()); int mappedToLength = MappingUtils .getLength(mapList.getToRanges()); - boolean addStopCodon = (cdsLength == mappedFromLength * CODON_LENGTH + CODON_LENGTH) + boolean addStopCodon = (cdsLength == mappedFromLength + * CODON_LENGTH + CODON_LENGTH) || (peptide.getDatasetSequence().getLength() == mappedFromLength - 1); if (cdsLength != mappedToLength && !addStopCodon) { @@ -1097,7 +1099,7 @@ public class AlignmentUtils // TODO resolve JAL-2022 so this fudge can be removed int mappedSequenceCount = protein.getHeight() - unmappedProtein.size(); addUnmappedPeptideStarts(alignedCodons, mappedSequenceCount); - + return alignedCodons; } @@ -1710,8 +1712,9 @@ public class AlignmentUtils */ List cdsRange = Collections.singletonList(new int[] { 1, cdsSeq.getLength() }); - MapList cdsToProteinMap = new MapList(cdsRange, mapList.getToRanges(), - mapList.getFromRatio(), mapList.getToRatio()); + MapList cdsToProteinMap = new MapList(cdsRange, + mapList.getToRanges(), mapList.getFromRatio(), + mapList.getToRatio()); AlignedCodonFrame cdsToProteinMapping = new AlignedCodonFrame(); cdsToProteinMapping.addMap(cdsSeqDss, proteinProduct, cdsToProteinMap); @@ -1746,16 +1749,16 @@ public class AlignmentUtils * same source and accession, so need a different accession for * the CDS from the dna sequence */ - + // specific use case: // Genomic contig ENSCHR:1, contains coding regions for ENSG01, // ENSG02, ENSG03, with transcripts and products similarly named. // cannot add distinct dbrefs mapping location on ENSCHR:1 to ENSG01 - + // JBPNote: ?? can't actually create an example that demonstrates we // need to // synthesize an xref. - + for (DBRefEntry primRef : dnaDss.getPrimaryDBRefs()) { // creates a complementary cross-reference to the source sequence's @@ -1832,7 +1835,8 @@ public class AlignmentUtils int mappedFromLength = MappingUtils.getLength(aMapping.getMap() .getFromRanges()); int dnaLength = seqDss.getLength(); - if (mappedFromLength == dnaLength || mappedFromLength == dnaLength - CODON_LENGTH) + if (mappedFromLength == dnaLength + || mappedFromLength == dnaLength - CODON_LENGTH) { return seqDss; } @@ -1848,7 +1852,8 @@ public class AlignmentUtils for (SequenceToSequenceMapping map : acf.getMappings()) { Mapping mapping = map.getMapping(); - if (mapping != aMapping && mapping.getMap().getFromRatio() == CODON_LENGTH + if (mapping != aMapping + && mapping.getMap().getFromRatio() == CODON_LENGTH && proteinProduct == mapping.getTo() && seqDss != map.getFromSeq()) { @@ -1916,7 +1921,7 @@ public class AlignmentUtils } } } - + /* * assign 'from id' held in the mapping if set (e.g. EMBL protein_id), * else generate a sequence name @@ -2482,7 +2487,9 @@ public class AlignmentUtils StringBuilder link = new StringBuilder(32); try { - link.append(desc).append(" ").append(id) + link.append(desc) + .append(" ") + .append(id) .append("|http://www.ensembl.org/Homo_sapiens/Variation/Summary?v=") .append(URLEncoder.encode(id, "UTF-8")); sf.addLink(link.toString()); @@ -2491,8 +2498,7 @@ public class AlignmentUtils // as if } } - String clinSig = (String) var.variant - .getValue(CLINICAL_SIGNIFICANCE); + String clinSig = (String) var.variant.getValue(CLINICAL_SIGNIFICANCE); if (clinSig != null) { sf.setValue(CLINICAL_SIGNIFICANCE, clinSig); @@ -2741,7 +2747,7 @@ public class AlignmentUtils } newCol++; } - + /* * trim trailing gaps */ diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index 711710b..75dec63 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -558,8 +558,10 @@ public class Conservation { tot = 0; xx = new double[24]; - seqNum = (j < lengths[k]) ? seqNums.elementAt(k)[j + 1] - : 23; // Sequence, or gap at the end + seqNum = (j < lengths[k]) ? seqNums.elementAt(k)[j + 1] : 23; // Sequence, + // or gap + // at the + // end // This is a loop over r for (i = 0; i < 23; i++) @@ -741,12 +743,12 @@ public class Conservation Conservation cons = new Conservation(name, threshold, seqs, start, end); cons.calculate(); cons.verdict(posOrNeg, consPercGaps); - + if (calcQuality) { cons.findQuality(); } - + return cons; } } diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index cd71bbd..4ba7e41 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -220,8 +220,7 @@ public class CrossRef rseqs = new ArrayList(); AlignedCodonFrame cf = new AlignedCodonFrame(); - matcher = new SequenceIdMatcher( - dataset.getSequences()); + matcher = new SequenceIdMatcher(dataset.getSequences()); for (SequenceI seq : fromSeqs) { @@ -630,8 +629,7 @@ public class CrossRef * attribute in equality test; this avoids creating many * otherwise duplicate exon features on genomic sequence */ - SequenceFeature newFeature = new SequenceFeature( - feat) + SequenceFeature newFeature = new SequenceFeature(feat) { @Override public boolean equals(Object o) @@ -667,6 +665,7 @@ public class CrossRef } return imported; } + /** * Sets the inverse sequence mapping in the corresponding dbref of the mapped * to sequence (if any). This is used after fetching a cross-referenced @@ -866,8 +865,8 @@ public class CrossRef MapList mapping = null; SequenceI dsmapFrom = mapFrom.getDatasetSequence() == null ? mapFrom : mapFrom.getDatasetSequence(); - SequenceI dsmapTo = mapTo.getDatasetSequence() == null ? mapTo - : mapTo.getDatasetSequence(); + SequenceI dsmapTo = mapTo.getDatasetSequence() == null ? mapTo : mapTo + .getDatasetSequence(); /* * look for a reverse mapping, if found make its inverse. * Note - we do this on dataset sequences only. diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 800cef2..799a8ed 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -878,7 +878,8 @@ public class Dna public static char getComplement(char c) { char result = c; - switch (c) { + switch (c) + { case '-': case '.': case ' ': diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index 96b45c1..e0e50fb 100644 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -878,8 +878,7 @@ public class NJTree if ((nd.left() == null) && (nd.right() == null)) { - System.out - .println("Leaf = " + ((SequenceI) nd.element()).getName()); + System.out.println("Leaf = " + ((SequenceI) nd.element()).getName()); System.out.println("Dist " + nd.dist); System.out.println("Boot " + nd.getBootstrap()); } @@ -1108,8 +1107,7 @@ public class NJTree } else { - System.out.println(" name = " - + ((SequenceI) nd.element()).getName()); + System.out.println(" name = " + ((SequenceI) nd.element()).getName()); } System.out.println(" dist = " + nd.dist + " " + nd.count + " " @@ -1303,8 +1301,8 @@ public class NJTree public void applyToNodes(NodeTransformI nodeTransformI) { for (Enumeration nodes = node.elements(); nodes - .hasMoreElements(); nodeTransformI - .transform(nodes.nextElement())) + .hasMoreElements(); nodeTransformI.transform(nodes + .nextElement())) { ; } diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 41324d9..89c5c30 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -376,7 +376,7 @@ public class Rna { second -= 32; } - + switch (first) { case 'A': diff --git a/src/jalview/analysis/SeqsetUtils.java b/src/jalview/analysis/SeqsetUtils.java index b0ecfde..21ad1cc 100755 --- a/src/jalview/analysis/SeqsetUtils.java +++ b/src/jalview/analysis/SeqsetUtils.java @@ -63,14 +63,14 @@ public class SeqsetUtils { sqinfo.put("SeqFeatures", sfeat); sqinfo.put("PdbId", - (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries() - : new Vector()); + (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries() + : new Vector()); } else { sqinfo.put("datasetSequence", - (seq.getDatasetSequence() != null) ? seq.getDatasetSequence() - : new Sequence("THISISAPLACEHOLDER", "")); + (seq.getDatasetSequence() != null) ? seq.getDatasetSequence() + : new Sequence("THISISAPLACEHOLDER", "")); } return sqinfo; } @@ -135,7 +135,7 @@ public class SeqsetUtils && !(seqds.getName().equals("THISISAPLACEHOLDER") && seqds .getLength() == 0)) { - if (sfeatures!=null) + if (sfeatures != null) { System.err .println("Implementation error: setting dataset sequence for a sequence which has sequence features.\n\tDataset sequence features will not be visible."); diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index ad3f8d9..7b0858d 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -218,7 +218,7 @@ public class StructureFrequency if (canonicalOrWobblePairCount >= otherPairCount) { maxResidue = (canonicalOrWobblePairCount - canonical) < canonical ? "(" - : "["; + : "["; } else { diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index 0840520..bd7d53d 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -260,7 +260,7 @@ public interface AlignViewportI extends ViewStyleI * @return String[] */ String[] getViewAsString(boolean selectedRegionOnly); - + /** * This method returns the visible alignment as text, as seen on the GUI, ie * if columns are hidden they will not be returned in the result. Use this for @@ -275,7 +275,8 @@ public interface AlignViewportI extends ViewStyleI * * @return String[] */ - String[] getViewAsString(boolean selectedRegionOnly, boolean isExportHiddenSeqs); + String[] getViewAsString(boolean selectedRegionOnly, + boolean isExportHiddenSeqs); void setSelectionGroup(SequenceGroup sg); @@ -412,7 +413,6 @@ public interface AlignViewportI extends ViewStyleI */ void setFollowHighlight(boolean b); - public void applyFeaturesStyle(FeatureSettingsModelI featureSettings); /** diff --git a/src/jalview/api/SiftsClientI.java b/src/jalview/api/SiftsClientI.java index dad434a..c795f3f 100644 --- a/src/jalview/api/SiftsClientI.java +++ b/src/jalview/api/SiftsClientI.java @@ -47,7 +47,6 @@ public interface SiftsClientI */ public String getDbCoordSys(); - /** * Get DB Source for the SIFTs Entry * @@ -117,7 +116,7 @@ public interface SiftsClientI */ public StructureMapping getSiftsStructureMapping(SequenceI seq, String pdbFile, String chain) throws SiftsException; - + /** * Get residue by residue mapping for a given Sequence and SIFTs entity * @@ -129,6 +128,5 @@ public interface SiftsClientI * @throws Exception */ public HashMap getGreedyMapping(String entityId, - SequenceI seq, - java.io.PrintStream os) throws SiftsException; + SequenceI seq, java.io.PrintStream os) throws SiftsException; } \ No newline at end of file diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index e36944f..80984c1 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -926,11 +926,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (alignPanel.getAlignment().getAlignmentAnnotation() != null) { for (AlignmentAnnotation aa : alignPanel.getAlignment() - .getAlignmentAnnotation()) - { - boolean visible = (aa.sequenceRef == null ? showForAlignment - : showForSequences); - aa.visible = visible; + .getAlignmentAnnotation()) + { + boolean visible = (aa.sequenceRef == null ? showForAlignment + : showForSequences); + aa.visible = visible; } } alignPanel.validateAnnotationDimensions(true); @@ -1415,9 +1415,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, FeaturesFile formatter = new FeaturesFile(); if (format.equalsIgnoreCase("Jalview")) { - features = formatter.printJalviewFormat(viewport - .getAlignment().getSequencesArray(), - getDisplayedFeatureCols()); + features = formatter.printJalviewFormat(viewport.getAlignment() + .getSequencesArray(), getDisplayedFeatureCols()); } else { diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index 9733c86..2c454a4 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -185,8 +185,7 @@ public class FeatureSettings extends Panel implements ItemListener, } protected void popupSort(final MyCheckbox check, - final Map minmax, - int x, int y) + final Map minmax, int x, int y) { final String type = check.type; final FeatureColourI typeCol = fr.getFeatureStyle(type); @@ -804,11 +803,10 @@ public class FeatureSettings extends Panel implements ItemListener, * @param type * @param columnsContaining */ - void hideFeatureColumns(final String type, - boolean columnsContaining) + void hideFeatureColumns(final String type, boolean columnsContaining) { - if (ap.alignFrame.avc.markColumnsContainingFeatures( - columnsContaining, false, false, type)) + if (ap.alignFrame.avc.markColumnsContainingFeatures(columnsContaining, + false, false, type)) { if (ap.alignFrame.avc.markColumnsContainingFeatures( !columnsContaining, false, false, type)) diff --git a/src/jalview/appletgui/IdPanel.java b/src/jalview/appletgui/IdPanel.java index 36c2199..ed96b55 100755 --- a/src/jalview/appletgui/IdPanel.java +++ b/src/jalview/appletgui/IdPanel.java @@ -352,8 +352,7 @@ public class IdPanel extends Panel implements MouseListener, if ((av.getSelectionGroup() == null) || ((!jalview.util.Platform.isControlDown(e) && !e - .isShiftDown()) && av - .getSelectionGroup() != null)) + .isShiftDown()) && av.getSelectionGroup() != null)) { av.setSelectionGroup(new SequenceGroup()); av.getSelectionGroup().setStartRes(0); diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index d2c1693..5a156fa 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -152,8 +152,7 @@ public class ScalePanel extends Panel implements MouseMotionListener, PopupMenu pop = new PopupMenu(); if (reveal != null) { - MenuItem item = new MenuItem( - MessageManager.getString("label.reveal")); + MenuItem item = new MenuItem(MessageManager.getString("label.reveal")); item.addActionListener(new ActionListener() { @Override @@ -205,8 +204,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, { av.hideColumns(res, res); if (av.getSelectionGroup() != null - && av.getSelectionGroup().getSize() == av - .getAlignment().getHeight()) + && av.getSelectionGroup().getSize() == av.getAlignment() + .getHeight()) { av.setSelectionGroup(null); } @@ -495,8 +494,7 @@ public class ScalePanel extends Panel implements MouseMotionListener, gg.fillPolygon(new int[] { -1 + res * avCharWidth - avcharHeight / 4, -1 + res * avCharWidth + avcharHeight / 4, - -1 + res * avCharWidth }, - new int[] { y, y, y + 2 * yOf }, 3); + -1 + res * avCharWidth }, new int[] { y, y, y + 2 * yOf }, 3); } } } diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 22849f1..7216bfe 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -113,8 +113,7 @@ public class SeqCanvas extends Panel } g.drawLine((mpos * avcharWidth) + (avcharWidth / 2), (ypos + 2) - (avcharHeight / 2), (mpos * avcharWidth) - + (avcharWidth / 2), - ypos - 2); + + (avcharWidth / 2), ypos - 2); } } } diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index a437960..6ca9499 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -1552,7 +1552,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } PaintRefresher.Refresh(ap, av.getSequenceSetId()); ap.paintAlignment(needOverviewUpdate); - needOverviewUpdate =false; + needOverviewUpdate = false; changeEndRes = false; changeStartRes = false; stretchGroup = null; diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index 2c53c08..35c2a22 100644 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -131,8 +131,9 @@ public class SliderPanel extends Panel implements ActionListener, pid = (SliderPanel) PIDSlider.getComponent(0); pid.cs = cs; } - PIDSlider.setTitle(MessageManager - .formatMessage("label.percentage_identity_threshold", + PIDSlider + .setTitle(MessageManager.formatMessage( + "label.percentage_identity_threshold", new String[] { source })); if (ap.av.getAlignment().getGroups() != null) diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index 47c2d28..3b509e5 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -528,8 +528,7 @@ public class TreeCanvas extends Panel implements MouseListener, for (int i = 0; i < leaves.size(); i++) { - SequenceI seq = (SequenceI) leaves.elementAt(i) - .element(); + SequenceI seq = (SequenceI) leaves.elementAt(i).element(); treeSelectionChanged(seq); } } @@ -628,14 +627,13 @@ public class TreeCanvas extends Panel implements MouseListener, (int) (Math.random() * 255), (int) (Math.random() * 255)); setColor(tree.getGroups().elementAt(i), col.brighter()); - Vector l = tree.findLeaves(tree - .getGroups().elementAt(i)); + Vector l = tree.findLeaves(tree.getGroups() + .elementAt(i)); Vector sequences = new Vector(); for (int j = 0; j < l.size(); j++) { - SequenceI s1 = (SequenceI) l.elementAt(j) - .element(); + SequenceI s1 = (SequenceI) l.elementAt(j).element(); if (!sequences.contains(s1)) { sequences.addElement(s1); diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 00c8b86..8412dab 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -228,7 +228,7 @@ public class Cache private final static String DEFAULT_CACHE_THRESHOLD_IN_DAYS = "2"; private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30"; - + /** * Allowed values are PDB or mmCIF */ @@ -895,7 +895,7 @@ public class Cache { setProperty(property, jalview.util.Format.getHexString(colour)); } - + /** * Stores a formatted date in a jalview property, using a fixed locale. * diff --git a/src/jalview/commands/TrimRegionCommand.java b/src/jalview/commands/TrimRegionCommand.java index dc6c424..655657e 100644 --- a/src/jalview/commands/TrimRegionCommand.java +++ b/src/jalview/commands/TrimRegionCommand.java @@ -68,7 +68,6 @@ public class TrimRegionCommand extends EditCommand setEdit(new Edit(Action.CUT, seqs, column + 1, width, al)); } - performEdit(0, null); } diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index 326cc4e..c5204eb 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -93,8 +93,8 @@ public class AlignedCodonFrame return (this.fromSeq == that.fromSeq || (this.fromSeq != null && that.fromSeq != null && this.fromSeq.getDatasetSequence() != null && this.fromSeq - .getDatasetSequence() == that.fromSeq - .getDatasetSequence())) && this.mapping.equals(that.mapping); + .getDatasetSequence() == that.fromSeq.getDatasetSequence())) + && this.mapping.equals(that.mapping); } public SequenceI getFromSeq() @@ -719,8 +719,8 @@ public class AlignedCodonFrame } /** - * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or null - * if none found + * Returns the first mapping found that is between 'fromSeq' and 'toSeq', or + * null if none found * * @param fromSeq * aligned or dataset sequence diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 2a89fa1..05688cb 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -1307,8 +1307,7 @@ public class AlignmentAnnotation * already */ public void remap(SequenceI newref, HashMap mapping, - int from, int to, - int idxoffset) + int from, int to, int idxoffset) { if (mapping != null) { diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index 8bc8f54..d651c0b 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -1148,9 +1148,9 @@ public class ColumnSelection */ public int[] locateVisibleBoundsOfSequence(SequenceI seq) { - int fpos=seq.getStart(),lpos= seq.getEnd(); + int fpos = seq.getStart(), lpos = seq.getEnd(); int start = 0; - + if (hiddenColumns == null || hiddenColumns.size() == 0) { int ifpos = seq.findIndex(fpos) - 1, ilpos = seq.findIndex(lpos) - 1; diff --git a/src/jalview/datamodel/HiddenSequences.java b/src/jalview/datamodel/HiddenSequences.java index 8ca3c5a..9e2cf72 100755 --- a/src/jalview/datamodel/HiddenSequences.java +++ b/src/jalview/datamodel/HiddenSequences.java @@ -296,6 +296,7 @@ public class HiddenSequences * makes a copy of the alignment with hidden sequences included. Using the * copy for anything other than simple output is not recommended. Note - this * method DOES NOT USE THE AlignmentI COPY CONSTRUCTOR! + * * @return */ public AlignmentI getFullAlignment() diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 68c8c50..c8b94ce 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -233,8 +233,7 @@ public class Sequence extends ASequence implements SequenceI { char[] oseq = seq.getSequence(); initSeqAndName(seq.getName(), Arrays.copyOf(oseq, oseq.length), - seq.getStart(), - seq.getEnd()); + seq.getStart(), seq.getEnd()); } description = seq.getDescription(); if (seq != datasetSequence) @@ -293,7 +292,6 @@ public class Sequence extends ASequence implements SequenceI } } - @Override public void setSequenceFeatures(SequenceFeature[] features) { @@ -318,7 +316,7 @@ public class Sequence extends ASequence implements SequenceI @Override public synchronized void addSequenceFeature(SequenceFeature sf) { - if (sequenceFeatures==null && datasetSequence != null) + if (sequenceFeatures == null && datasetSequence != null) { datasetSequence.addSequenceFeature(sf); return; @@ -348,8 +346,9 @@ public class Sequence extends ASequence implements SequenceI { if (sequenceFeatures == null) { - if (datasetSequence!=null) { - datasetSequence.deleteFeature(sf); + if (datasetSequence != null) + { + datasetSequence.deleteFeature(sf); } return; } @@ -1094,7 +1093,7 @@ public class Sequence extends ASequence implements SequenceI @Override public SequenceI deriveSequence() { - Sequence seq=null; + Sequence seq = null; if (datasetSequence == null) { if (isValidDatasetSequence()) @@ -1108,7 +1107,7 @@ public class Sequence extends ASequence implements SequenceI else { // Create a new, valid dataset sequence - createDatasetSequence(); + createDatasetSequence(); } } return new Sequence(this); @@ -1156,9 +1155,9 @@ public class Sequence extends ASequence implements SequenceI dsseq.setDescription(description); // move features and database references onto dataset sequence dsseq.sequenceFeatures = sequenceFeatures; - sequenceFeatures=null; + sequenceFeatures = null; dsseq.dbrefs = dbrefs; - dbrefs=null; + dbrefs = null; // TODO: search and replace any references to this sequence with // references to the dataset sequence in Mappings on dbref dsseq.pdbIds = pdbIds; @@ -1416,15 +1415,14 @@ public class Sequence extends ASequence implements SequenceI return null; } - @Override public List getPrimaryDBRefs() { - if (datasetSequence!=null) + if (datasetSequence != null) { return datasetSequence.getPrimaryDBRefs(); } - if (dbrefs==null || dbrefs.length==0) + if (dbrefs == null || dbrefs.length == 0) { return Collections.emptyList(); } diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 49ddf86..aec68ab 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -459,7 +459,6 @@ public interface SequenceI extends ASequenceI */ public PDBEntry getPDBEntry(String pdbId); - /** * Get all primary database/accessions for this sequence's data. These * DBRefEntry are expected to resolve to a valid record in the associated diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index 3ba36ca..4d09bdc 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -48,8 +48,7 @@ import java.util.regex.Pattern; * Data model for one entry returned from an EMBL query, as marshalled by a * Castor binding file * - * For example: - * http://www.ebi.ac.uk/ena/data/view/J03321&display=xml + * For example: http://www.ebi.ac.uk/ena/data/view/J03321&display=xml * * @see embl_mapping.xml */ @@ -200,7 +199,6 @@ public class EmblEntry retrievedref.setMap(new Mapping(null, new int[] { 1, dna.getLength() }, new int[] { 1, dna.getLength() }, 1, 1)); - /* * transform EMBL Database refs to canonical form */ @@ -298,7 +296,8 @@ public class EmblEntry if (qname.equals("translation")) { // remove all spaces (precompiled String.replaceAll(" ", "")) - translation = SPACE_PATTERN.matcher(q.getValues()[0]).replaceAll(""); + translation = SPACE_PATTERN.matcher(q.getValues()[0]).replaceAll( + ""); } else if (qname.equals("protein_id")) { @@ -469,13 +468,14 @@ public class EmblEntry */ String source = DBRefUtils.getCanonicalName(ref.getSource()); ref.setSource(source); - DBRefEntry proteinDbRef = new DBRefEntry(ref.getSource(), ref.getVersion(), ref - .getAccessionId()); + DBRefEntry proteinDbRef = new DBRefEntry(ref.getSource(), + ref.getVersion(), ref.getAccessionId()); if (source.equals(DBRefSource.UNIPROT)) { String proteinSeqName = DBRefSource.UNIPROT + "|" + ref.getAccessionId(); - if (dnaToProteinMapping != null && dnaToProteinMapping.getTo() != null) + if (dnaToProteinMapping != null + && dnaToProteinMapping.getTo() != null) { if (mappingUsed) { diff --git a/src/jalview/ext/ensembl/EnsemblCdna.java b/src/jalview/ext/ensembl/EnsemblCdna.java index e141db4..0276719 100644 --- a/src/jalview/ext/ensembl/EnsemblCdna.java +++ b/src/jalview/ext/ensembl/EnsemblCdna.java @@ -23,7 +23,7 @@ public class EnsemblCdna extends EnsemblSeqProxy */ private static final Regex ACCESSION_REGEX = new Regex( "(ENS([A-Z]{3}|)[TG][0-9]{11}$)" + "|" + "(CCDS[0-9.]{3,}$)"); - + /* * fetch exon features on genomic sequence (to identify the cdna regions) * and cds and variation features (to retain) diff --git a/src/jalview/ext/ensembl/EnsemblFeatures.java b/src/jalview/ext/ensembl/EnsemblFeatures.java index 0547433..2e1f633 100644 --- a/src/jalview/ext/ensembl/EnsemblFeatures.java +++ b/src/jalview/ext/ensembl/EnsemblFeatures.java @@ -79,8 +79,7 @@ class EnsemblFeatures extends EnsemblRestClient protected URL getUrl(List ids) throws MalformedURLException { StringBuffer urlstring = new StringBuffer(128); - urlstring.append(getDomain()).append("/overlap/id/") - .append(ids.get(0)); + urlstring.append(getDomain()).append("/overlap/id/").append(ids.get(0)); // @see https://github.com/Ensembl/ensembl-rest/wiki/Output-formats urlstring.append("?content-type=text/x-gff3"); diff --git a/src/jalview/ext/ensembl/EnsemblGene.java b/src/jalview/ext/ensembl/EnsemblGene.java index 0c20e12..d6e7d85 100644 --- a/src/jalview/ext/ensembl/EnsemblGene.java +++ b/src/jalview/ext/ensembl/EnsemblGene.java @@ -262,8 +262,7 @@ public class EnsemblGene extends EnsemblSeqProxy } } gene.setSequenceFeatures(filtered - .toArray(new SequenceFeature[filtered - .size()])); + .toArray(new SequenceFeature[filtered.size()])); } } @@ -529,6 +528,7 @@ public class EnsemblGene extends EnsemblSeqProxy return new FeatureSettingsAdapter() { SequenceOntologyI so = SequenceOntologyFactory.getInstance(); + @Override public boolean isFeatureDisplayed(String type) { diff --git a/src/jalview/ext/ensembl/EnsemblGenomes.java b/src/jalview/ext/ensembl/EnsemblGenomes.java index 9ba2e1c..3fb20be 100644 --- a/src/jalview/ext/ensembl/EnsemblGenomes.java +++ b/src/jalview/ext/ensembl/EnsemblGenomes.java @@ -1,6 +1,5 @@ package jalview.ext.ensembl; - /** * A class to behave much like EnsemblGene but referencing the ensemblgenomes * domain and data diff --git a/src/jalview/ext/ensembl/EnsemblLookup.java b/src/jalview/ext/ensembl/EnsemblLookup.java index c5945ae..4c9ad2b 100644 --- a/src/jalview/ext/ensembl/EnsemblLookup.java +++ b/src/jalview/ext/ensembl/EnsemblLookup.java @@ -105,7 +105,7 @@ public class EnsemblLookup extends EnsemblRestClient public String getParent(String identifier) { List ids = Arrays.asList(new String[] { identifier }); - + BufferedReader br = null; try { diff --git a/src/jalview/ext/ensembl/EnsemblRestClient.java b/src/jalview/ext/ensembl/EnsemblRestClient.java index 30dcee8..8daf234 100644 --- a/src/jalview/ext/ensembl/EnsemblRestClient.java +++ b/src/jalview/ext/ensembl/EnsemblRestClient.java @@ -52,10 +52,10 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher private final static long VERSION_RETEST_INTERVAL = 1000L * 3600; // 1 hr private static final Regex TRANSCRIPT_REGEX = new Regex( - "(ENS)([A-Z]{3}|)T[0-9]{11}$"); + "(ENS)([A-Z]{3}|)T[0-9]{11}$"); private static final Regex GENE_REGEX = new Regex( - "(ENS)([A-Z]{3}|)G[0-9]{11}$"); + "(ENS)([A-Z]{3}|)G[0-9]{11}$"); static { @@ -207,7 +207,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher throws IOException { URL url = getUrl(ids); - + BufferedReader reader = getHttpResponse(url, ids); if (reader == null) { @@ -233,7 +233,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher { // long now = System.currentTimeMillis(); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - + /* * POST method allows multiple queries in one request; it is supported for * sequence queries, but not for overlap @@ -253,9 +253,9 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher { writePostBody(connection, ids); } - + int responseCode = connection.getResponseCode(); - + if (responseCode != 200) { /* @@ -272,7 +272,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher // + (System.currentTimeMillis() - now) + "ms to fetch"); checkRateLimits(connection); - + BufferedReader reader = null; reader = new BufferedReader(new InputStreamReader(response, "UTF-8")); return reader; @@ -325,7 +325,7 @@ abstract class EnsemblRestClient extends EnsemblSequenceFetcher // remaining, limit, reset)); } } - + /** * Rechecks if Ensembl is responding, unless the last check was successful and * the retest interval has not yet elapsed. Returns true if Ensembl is up, diff --git a/src/jalview/ext/ensembl/EnsemblSeqProxy.java b/src/jalview/ext/ensembl/EnsemblSeqProxy.java index 91b09ea..9109fb2 100644 --- a/src/jalview/ext/ensembl/EnsemblSeqProxy.java +++ b/src/jalview/ext/ensembl/EnsemblSeqProxy.java @@ -274,7 +274,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient proteinSeq.createDatasetSequence(); querySeq.createDatasetSequence(); - MapList mapList = AlignmentUtils.mapCdsToProtein(querySeq, proteinSeq); + MapList mapList = AlignmentUtils + .mapCdsToProtein(querySeq, proteinSeq); if (mapList != null) { // clunky: ensure Uniprot xref if we have one is on mapped sequence @@ -293,7 +294,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient for (DBRefEntry up : uprots) { // locate local uniprot ref and map - List upx = DBRefUtils.searchRefs(upxrefs, up.getAccessionId()); + List upx = DBRefUtils.searchRefs(upxrefs, + up.getAccessionId()); DBRefEntry upxref; if (upx.size() != 0) { @@ -308,7 +310,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient else { upxref = new DBRefEntry(DBRefSource.UNIPROT, - getEnsemblDataVersion(), up.getAccessionId()); + getEnsemblDataVersion(), up.getAccessionId()); } Mapping newMap = new Mapping(ds, mapList); @@ -319,15 +321,16 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient // add the new uniprot ref querySeq.getDatasetSequence().addDBRef(upxref); } - + } } - + /* * copy exon features to protein, compute peptide variants from dna * variants and add as features on the protein sequence ta-da */ - AlignmentUtils.computeProteinFeatures(querySeq, proteinSeq, mapList); + AlignmentUtils + .computeProteinFeatures(querySeq, proteinSeq, mapList); } } catch (Exception e) { @@ -413,9 +416,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient if (fr.getSeqs().size() > 0) { - AlignmentI seqal = new Alignment( - fr.getSeqsAsArray()); - for (SequenceI sq:seqal.getSequences()) + AlignmentI seqal = new Alignment(fr.getSeqsAsArray()); + for (SequenceI sq : seqal.getSequences()) { if (sq.getDescription() == null) { @@ -547,7 +549,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient int mappedLength = 0; int direction = 1; // forward boolean directionSet = false; - + for (SequenceFeature sf : sfs) { /* @@ -564,20 +566,20 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient // abort - mix of forward and backward System.err.println("Error: forward and backward strand for " + accId); - return null; - } - direction = strand; - directionSet = true; - - /* - * add to CDS ranges, semi-sorted forwards/backwards - */ - if (strand < 0) - { - regions.add(0, new int[] { sf.getEnd(), sf.getBegin() }); - } - else - { + return null; + } + direction = strand; + directionSet = true; + + /* + * add to CDS ranges, semi-sorted forwards/backwards + */ + if (strand < 0) + { + regions.add(0, new int[] { sf.getEnd(), sf.getBegin() }); + } + else + { regions.add(new int[] { sf.getBegin(), sf.getEnd() }); } mappedLength += Math.abs(sf.getEnd() - sf.getBegin() + 1); @@ -592,7 +594,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient } } } - + if (regions.isEmpty()) { System.out.println("Failed to identify target sequence for " + accId @@ -605,10 +607,10 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient * (havana / ensembl_havana) */ Collections.sort(regions, new RangeSorter(direction == 1)); - + List to = Arrays.asList(new int[] { start, start + mappedLength - 1 }); - + return new MapList(regions, to, 1, 1); } @@ -652,7 +654,7 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient int start = sf.getBegin(); int end = sf.getEnd(); int[] mappedRange = mapping.locateInTo(start, end); - + if (mappedRange != null) { SequenceFeature copy = new SequenceFeature(sf); @@ -762,8 +764,8 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient // long start = System.currentTimeMillis(); SequenceFeature[] sfs = sourceSequence.getSequenceFeatures(); - MapList mapping = getGenomicRangesFromFeatures(sourceSequence, accessionId, - targetSequence.getStart()); + MapList mapping = getGenomicRangesFromFeatures(sourceSequence, + accessionId, targetSequence.getStart()); if (mapping == null) { return false; @@ -894,11 +896,13 @@ public abstract class EnsemblSeqProxy extends EnsemblRestClient String type, String parentId) { List result = new ArrayList(); - + SequenceFeature[] sfs = sequence.getSequenceFeatures(); - if (sfs != null) { + if (sfs != null) + { SequenceOntologyI so = SequenceOntologyFactory.getInstance(); - for (SequenceFeature sf :sfs) { + for (SequenceFeature sf : sfs) + { if (so.isA(sf.getType(), type)) { String parent = (String) sf.getValue(PARENT); diff --git a/src/jalview/ext/ensembl/EnsemblSymbol.java b/src/jalview/ext/ensembl/EnsemblSymbol.java index b8c8c54..7763f29 100644 --- a/src/jalview/ext/ensembl/EnsemblSymbol.java +++ b/src/jalview/ext/ensembl/EnsemblSymbol.java @@ -71,8 +71,7 @@ public class EnsemblSymbol extends EnsemblXref protected URL getUrl(String id, Species species) { String url = getDomain() + "/xrefs/symbol/" + species.toString() + "/" - + id - + "?content-type=application/json"; + + id + "?content-type=application/json"; try { return new URL(url); @@ -94,7 +93,7 @@ public class EnsemblSymbol extends EnsemblXref List result = new ArrayList(); List ids = new ArrayList(); ids.add(identifier); - + String[] queries = identifier.split(getAccessionSeparator()); BufferedReader br = null; try diff --git a/src/jalview/ext/ensembl/EnsemblXref.java b/src/jalview/ext/ensembl/EnsemblXref.java index 313572f..5ce18be 100644 --- a/src/jalview/ext/ensembl/EnsemblXref.java +++ b/src/jalview/ext/ensembl/EnsemblXref.java @@ -41,7 +41,7 @@ class EnsemblXref extends EnsemblRestClient super(d); dbName = dbSource; xrefVersion = dbSource + ":" + version; - + } @Override diff --git a/src/jalview/ext/htsjdk/HtsContigDb.java b/src/jalview/ext/htsjdk/HtsContigDb.java index f3b5098..667e567 100644 --- a/src/jalview/ext/htsjdk/HtsContigDb.java +++ b/src/jalview/ext/htsjdk/HtsContigDb.java @@ -59,18 +59,21 @@ public class HtsContigDb } - SAMSequenceDictionary rrefDict = null; - private ReferenceSequenceFile initSequenceDictionaryFor(File dbLocation2) throws Exception + + private ReferenceSequenceFile initSequenceDictionaryFor(File dbLocation2) + throws Exception { rrefDict = getDictionary(dbLocation2, true); if (rrefDict != null) { - ReferenceSequenceFile rrefFile = ReferenceSequenceFileFactory.getReferenceSequenceFile(dbLocation2, true); + ReferenceSequenceFile rrefFile = ReferenceSequenceFileFactory + .getReferenceSequenceFile(dbLocation2, true); return rrefFile; } return null; } + /** * code below hacked out from picard ---- * @@ -79,7 +82,6 @@ public class HtsContigDb * broadinstitute/picard/commit/270580d3e28123496576f0b91b3433179bb5d876 */ - /* * The MIT License * diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index b1b5ce4..2f3464b 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -171,7 +171,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { // remove listeners for all structures in viewer getSsm().removeStructureViewerListener(this, this.getPdbFile()); - viewer.dispose(); + viewer.dispose(); lastCommand = null; viewer = null; releaseUIResources(); diff --git a/src/jalview/ext/jmol/JmolParser.java b/src/jalview/ext/jmol/JmolParser.java index 65b4b96..1800ef0 100644 --- a/src/jalview/ext/jmol/JmolParser.java +++ b/src/jalview/ext/jmol/JmolParser.java @@ -61,8 +61,7 @@ public class JmolParser extends StructureFile implements JmolStatusListener { Viewer viewer = null; - public JmolParser(String inFile, String type) - throws IOException + public JmolParser(String inFile, String type) throws IOException { super(inFile, type); } @@ -356,9 +355,9 @@ public class JmolParser extends StructureFile implements JmolStatusListener { try { - asecstr[p] = new Annotation(String.valueOf(secstr[p]), null, - secstrcode[p], Float.NaN); - ssFound = true; + asecstr[p] = new Annotation(String.valueOf(secstr[p]), null, + secstrcode[p], Float.NaN); + ssFound = true; } catch (Exception e) { // e.printStackTrace(); diff --git a/src/jalview/ext/so/SequenceOntology.java b/src/jalview/ext/so/SequenceOntology.java index 28ddfd9..5aae8bf 100644 --- a/src/jalview/ext/so/SequenceOntology.java +++ b/src/jalview/ext/so/SequenceOntology.java @@ -175,9 +175,9 @@ public class SequenceOntology implements SequenceOntologyI } else { - System.err.println("Warning: " + term.getName() - + " has replaced " + replaced.getName() - + " for lookup of '" + description + "'"); + System.err.println("Warning: " + term.getName() + + " has replaced " + replaced.getName() + + " for lookup of '" + description + "'"); } } termsByDescription.put(description, term); @@ -200,8 +200,8 @@ public class SequenceOntology implements SequenceOntologyI { try { - if (Boolean.TRUE.equals(ann.getProperty("is_obsolete"))) - { + if (Boolean.TRUE.equals(ann.getProperty("is_obsolete"))) + { return true; } } catch (NoSuchElementException e) diff --git a/src/jalview/fts/api/FTSRestClientI.java b/src/jalview/fts/api/FTSRestClientI.java index 3701c76..33b0ed6 100644 --- a/src/jalview/fts/api/FTSRestClientI.java +++ b/src/jalview/fts/api/FTSRestClientI.java @@ -74,7 +74,6 @@ public interface FTSRestClientI public FTSDataColumnI getDataColumnByNameOrCode(String nameOrCode) throws Exception; - /** * Convert collection of FTSDataColumnI objects to a comma delimited string of * the 'code' values @@ -87,7 +86,6 @@ public interface FTSRestClientI public String getDataColumnsFieldsAsCommaDelimitedString( Collection wantedFields); - /** * Fetch index of the primary key column for the dynamic table * @@ -102,7 +100,7 @@ public interface FTSRestClientI public int getPrimaryKeyColumIndex( Collection wantedFields, boolean hasRefSeq) throws Exception; - + /** * Fetch the primary key data column object * @@ -139,4 +137,3 @@ public interface FTSRestClientI */ public int getDefaultResponsePageSize(); } - diff --git a/src/jalview/fts/core/FTSDataColumnPreferences.java b/src/jalview/fts/core/FTSDataColumnPreferences.java index eb7455e..1a8f398 100644 --- a/src/jalview/fts/core/FTSDataColumnPreferences.java +++ b/src/jalview/fts/core/FTSDataColumnPreferences.java @@ -40,7 +40,6 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; - @SuppressWarnings("serial") public class FTSDataColumnPreferences extends JScrollPane { @@ -71,7 +70,7 @@ public class FTSDataColumnPreferences extends JScrollPane if (source.equals(PreferenceSource.STRUCTURE_CHOOSER) || source.equals(PreferenceSource.PREFERENCES)) { - structSummaryColumns = ((PDBFTSRestClient) ftsRestClient) + structSummaryColumns = ((PDBFTSRestClient) ftsRestClient) .getAllDefaultDisplayedStructureDataColumns(); } allFTSDataColumns.addAll(ftsRestClient.getAllFTSDataColumns()); @@ -111,19 +110,18 @@ public class FTSDataColumnPreferences extends JScrollPane { case SEARCH_SUMMARY: data[x++] = new Object[] { - ftsRestClient.getAllDefaultDisplayedFTSDataColumns() - .contains(field), - field.getName(), field.getGroup() }; + ftsRestClient.getAllDefaultDisplayedFTSDataColumns().contains( + field), field.getName(), field.getGroup() }; break; case STRUCTURE_CHOOSER: data[x++] = new Object[] { structSummaryColumns.contains(field), field.getName(), field.getGroup() }; break; case PREFERENCES: - data[x++] = new Object[] { field.getName(), - ftsRestClient.getAllDefaultDisplayedFTSDataColumns() - .contains(field), - structSummaryColumns.contains(field) }; + data[x++] = new Object[] { + field.getName(), + ftsRestClient.getAllDefaultDisplayedFTSDataColumns().contains( + field), structSummaryColumns.contains(field) }; break; default: break; @@ -131,7 +129,8 @@ public class FTSDataColumnPreferences extends JScrollPane map.put(field.getName(), field); } - FTSDataColumnPrefsTableModel model = new FTSDataColumnPrefsTableModel(columnNames, data); + FTSDataColumnPrefsTableModel model = new FTSDataColumnPrefsTableModel( + columnNames, data); tbl_FTSDataColumnPrefs.setModel(model); switch (source) @@ -147,8 +146,7 @@ public class FTSDataColumnPreferences extends JScrollPane tbl_FTSDataColumnPrefs.getColumnModel().getColumn(1).setMinWidth(150); tbl_FTSDataColumnPrefs.getColumnModel().getColumn(2) .setPreferredWidth(150); - tbl_FTSDataColumnPrefs.getColumnModel().getColumn(2) -.setMinWidth(150); + tbl_FTSDataColumnPrefs.getColumnModel().getColumn(2).setMinWidth(150); TableRowSorter sorter = new TableRowSorter<>( tbl_FTSDataColumnPrefs.getModel()); @@ -158,8 +156,7 @@ public class FTSDataColumnPreferences extends JScrollPane sortKeys.add(new RowSorter.SortKey(columnIndexToSort, SortOrder.ASCENDING)); sorter.setSortKeys(sortKeys); - sorter.setComparator( - columnIndexToSort, + sorter.setComparator(columnIndexToSort, new Comparator() { @Override @@ -189,7 +186,8 @@ public class FTSDataColumnPreferences extends JScrollPane class FTSDataColumnPrefsTableModel extends AbstractTableModel { - public FTSDataColumnPrefsTableModel(String[] columnNames, Object[][] data) + public FTSDataColumnPrefsTableModel(String[] columnNames, + Object[][] data) { this.data = data; this.columnNames = columnNames; @@ -301,9 +299,8 @@ public class FTSDataColumnPreferences extends JScrollPane if (currentSource == PreferenceSource.SEARCH_SUMMARY) { - updatePrefs(ftsRestClient - .getAllDefaultDisplayedFTSDataColumns(), ftsDataColumn, - selected); + updatePrefs(ftsRestClient.getAllDefaultDisplayedFTSDataColumns(), + ftsDataColumn, selected); } else if (currentSource == PreferenceSource.STRUCTURE_CHOOSER) { @@ -313,9 +310,8 @@ public class FTSDataColumnPreferences extends JScrollPane { if (col == 1) { - updatePrefs(ftsRestClient - .getAllDefaultDisplayedFTSDataColumns(), ftsDataColumn, - selected); + updatePrefs(ftsRestClient.getAllDefaultDisplayedFTSDataColumns(), + ftsDataColumn, selected); } else if (col == 2) { @@ -324,8 +320,7 @@ public class FTSDataColumnPreferences extends JScrollPane } } - private void updatePrefs( - Collection prefConfig, + private void updatePrefs(Collection prefConfig, FTSDataColumnI dataColumn, boolean selected) { if (prefConfig.contains(dataColumn) && !selected) diff --git a/src/jalview/fts/core/FTSRestClient.java b/src/jalview/fts/core/FTSRestClient.java index 230cbdb..1f91fba 100644 --- a/src/jalview/fts/core/FTSRestClient.java +++ b/src/jalview/fts/core/FTSRestClient.java @@ -45,9 +45,9 @@ public abstract class FTSRestClient implements FTSRestClientI public void parseDataColumnsConfigFile() { String fileName = getColumnDataConfigFileName(); - - InputStream in = getClass().getResourceAsStream(fileName); - + + InputStream in = getClass().getResourceAsStream(fileName); + try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) { String line; @@ -259,7 +259,6 @@ public abstract class FTSRestClient implements FTSRestClientI this.getGroup()); } - @Override public boolean equals(Object otherObject) { @@ -269,7 +268,6 @@ public abstract class FTSRestClient implements FTSRestClientI && this.getGroup().equals(that.getGroup()); } - }; dataColumns.add(dataCol); @@ -345,7 +343,6 @@ public abstract class FTSRestClient implements FTSRestClientI return result; } - @Override public Collection getAllFTSDataColumns() { @@ -432,10 +429,9 @@ public abstract class FTSRestClient implements FTSRestClientI switch (code) { case 400: - message = MessageManager - .getString("exception.bad_request"); + message = MessageManager.getString("exception.bad_request"); break; - + case 410: message = MessageManager.formatMessage( "exception.fts_rest_service_no_longer_available", service); diff --git a/src/jalview/fts/core/FTSRestRequest.java b/src/jalview/fts/core/FTSRestRequest.java index 164b102..2e1c632 100644 --- a/src/jalview/fts/core/FTSRestRequest.java +++ b/src/jalview/fts/core/FTSRestRequest.java @@ -107,8 +107,7 @@ public class FTSRestRequest return wantedFields; } - public void setWantedFields( - Collection wantedFields) + public void setWantedFields(Collection wantedFields) { this.wantedFields = wantedFields; } diff --git a/src/jalview/fts/core/FTSRestResponse.java b/src/jalview/fts/core/FTSRestResponse.java index 92ea5f8..5d8fb96 100644 --- a/src/jalview/fts/core/FTSRestResponse.java +++ b/src/jalview/fts/core/FTSRestResponse.java @@ -90,8 +90,8 @@ public class FTSRestResponse public static DefaultTableModel getTableModel(FTSRestRequest request, Collection summariesList) { - final FTSDataColumnI[] cols = request.getWantedFields() - .toArray(new FTSDataColumnI[0]); + final FTSDataColumnI[] cols = request.getWantedFields().toArray( + new FTSDataColumnI[0]); final int colOffset = request.getAssociatedSequence() == null ? 0 : 1; DefaultTableModel tableModel = new DefaultTableModel() { @@ -118,8 +118,7 @@ public class FTSRestResponse tableModel.addColumn("Ref Sequence"); // Create sequence column header if // exists in the request } - for (FTSDataColumnI field : request - .getWantedFields()) + for (FTSDataColumnI field : request.getWantedFields()) { tableModel.addColumn(field.getName()); // Create sequence column header if // exists in the request @@ -172,5 +171,4 @@ public class FTSRestResponse } } - } diff --git a/src/jalview/fts/core/GFTSPanel.java b/src/jalview/fts/core/GFTSPanel.java index 30b6417..a69d9f8 100644 --- a/src/jalview/fts/core/GFTSPanel.java +++ b/src/jalview/fts/core/GFTSPanel.java @@ -148,6 +148,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI protected static final DecimalFormat totalNumberformatter = new DecimalFormat( "###,###"); + private JTable tbl_summary = new JTable() { private boolean inLayout; @@ -225,6 +226,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI return toolTipText; } }; + protected JScrollPane scrl_searchResult = new JScrollPane(tbl_summary); public GFTSPanel() @@ -504,8 +506,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI }); final DeferredTextInputListener listener = new DeferredTextInputListener( - 1500, - new ActionListener() + 1500, new ActionListener() { @Override public void actionPerformed(ActionEvent e) @@ -530,7 +531,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI @Override public void focusLost(FocusEvent e) { -// listener.stop(); + // listener.stop(); } }); @@ -563,8 +564,8 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI txt_search.setEnabled(false); cmb_searchTarget.setEnabled(false); previousWantedFields = getFTSRestClient() - .getAllDefaultDisplayedFTSDataColumns() - .toArray(new Object[0]); + .getAllDefaultDisplayedFTSDataColumns().toArray( + new Object[0]); } if (sourceTabbedPane.getTitleAt(index).equals(searchTabTitle)) { @@ -645,6 +646,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI getTempUserPrefs().put("FTSPanel.y", mainFrame.getY()); mainFrame.dispose(); } + public class DeferredTextInputListener implements DocumentListener { private final Timer swingTimer; @@ -694,9 +696,8 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI } return Arrays.equals(getFTSRestClient() - .getAllDefaultDisplayedFTSDataColumns() - .toArray(new Object[0]), previousWantedFields) ? false - : true; + .getAllDefaultDisplayedFTSDataColumns().toArray(new Object[0]), + previousWantedFields) ? false : true; } @@ -812,7 +813,6 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI } } - public void transferToSequenceFetcher(String ids) { // mainFrame.dispose(); @@ -925,8 +925,8 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI int[] selectedRows = resultTable.getSelectedRows(); for (int summaryRow : selectedRows) { - String idStr = resultTable.getValueAt(summaryRow, - primaryKeyColIndex).toString(); + String idStr = resultTable.getValueAt(summaryRow, primaryKeyColIndex) + .toString(); paginatorCart.add(idStr); } // System.out.println("Paginator shopping cart size : " @@ -962,6 +962,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI } validateSelection(); } + public void refreshPaginatorState() { // System.out.println("resultSet count : " + resultSetCount); @@ -982,6 +983,7 @@ public abstract class GFTSPanel extends JPanel implements GFTSPanelI setPrevPageButtonEnabled(true); } } + public void referesh() { mainFrame.setTitle(getFTSFrameTitle()); diff --git a/src/jalview/fts/service/pdb/PDBFTSPanel.java b/src/jalview/fts/service/pdb/PDBFTSPanel.java index 3fe8603..1dfabce 100644 --- a/src/jalview/fts/service/pdb/PDBFTSPanel.java +++ b/src/jalview/fts/service/pdb/PDBFTSPanel.java @@ -52,7 +52,6 @@ public class PDBFTSPanel extends GFTSPanel .getProgressIndicator(); } - @Override public void searchAction(boolean isFreshSearch) { @@ -104,7 +103,7 @@ public class PDBFTSPanel extends GFTSPanel { getResultTable().setModel( FTSRestResponse.getTableModel(request, - resultList.getSearchSummary())); + resultList.getSearchSummary())); FTSRestResponse.configureTableColumn(getResultTable(), wantedFields, tempUserPrefs); getResultTable().setVisible(true); @@ -117,10 +116,12 @@ public class PDBFTSPanel extends GFTSPanel String result = (resultSetCount > 0) ? MessageManager .getString("label.results") : MessageManager .getString("label.result"); - + if (isPaginationEnabled() && resultSetCount > 0) { - updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result + updateSearchFrameTitle(defaultFTSFrameTitle + + " - " + + result + " " + totalNumberformatter.format((Number) (offSet + 1)) + " to " @@ -128,8 +129,8 @@ public class PDBFTSPanel extends GFTSPanel .format((Number) (offSet + resultSetCount)) + " of " + totalNumberformatter - .format((Number) totalResultSetCount) - + " " + " (" + (endTime - startTime) + " milli secs)"); + .format((Number) totalResultSetCount) + " " + + " (" + (endTime - startTime) + " milli secs)"); } else { @@ -137,7 +138,7 @@ public class PDBFTSPanel extends GFTSPanel + resultSetCount + " " + result + " (" + (endTime - startTime) + " milli secs)"); } - + setSearchInProgress(false); refreshPaginatorState(); updateSummaryTableSelections(); @@ -193,8 +194,7 @@ public class PDBFTSPanel extends GFTSPanel try { primaryKeyColIndex = getFTSRestClient().getPrimaryKeyColumIndex( - wantedFields, - false); + wantedFields, false); } catch (Exception e) { e.printStackTrace(); @@ -204,8 +204,7 @@ public class PDBFTSPanel extends GFTSPanel for (int summaryRow : selectedRows) { String idStr = getResultTable().getValueAt(summaryRow, - primaryKeyColIndex) - .toString(); + primaryKeyColIndex).toString(); selectedIdsSet.add(getPDBIdwithSpecifiedChain(idStr, searchTerm)); } @@ -227,7 +226,6 @@ public class PDBFTSPanel extends GFTSPanel delayAndEnableActionButtons(); } - public static String getPDBIdwithSpecifiedChain(String pdbId, String searchTerm) { diff --git a/src/jalview/fts/service/pdb/PDBFTSRestClient.java b/src/jalview/fts/service/pdb/PDBFTSRestClient.java index 219d6d6..06bf55b 100644 --- a/src/jalview/fts/service/pdb/PDBFTSRestClient.java +++ b/src/jalview/fts/service/pdb/PDBFTSRestClient.java @@ -140,8 +140,7 @@ public class PDBFTSRestClient extends FTSRestClient .queryParam("wt", "json").queryParam("fl", wantedFields) .queryParam("rows", String.valueOf(responseSize)) .queryParam("start", String.valueOf(offSet)) - .queryParam("q", query) - .queryParam("sort", sortParam); + .queryParam("q", query).queryParam("sort", sortParam); } // Execute the REST request ClientResponse clientResponse = webResource.accept( @@ -162,8 +161,8 @@ public class PDBFTSRestClient extends FTSRestClient } else { - errorMessage = getMessageByHTTPStatusCode(clientResponse -.getStatus(), "PDB"); + errorMessage = getMessageByHTTPStatusCode( + clientResponse.getStatus(), "PDB"); throw new Exception(errorMessage); } } @@ -198,7 +197,6 @@ public class PDBFTSRestClient extends FTSRestClient } } - /** * Process error response from PDB server if/when one occurs. * @@ -328,15 +326,13 @@ public class PDBFTSRestClient extends FTSRestClient { summaryRowData[colCounter++] = (field.getDataType() .getDataTypeClass() == Integer.class) ? Integer - .valueOf(fieldData) - : (field.getDataType() + .valueOf(fieldData) : (field.getDataType() .getDataTypeClass() == Double.class) ? Double - .valueOf(fieldData) - : sanitiseData(fieldData); + .valueOf(fieldData) : sanitiseData(fieldData); } catch (Exception e) { e.printStackTrace(); - System.out.println("offending value:" + fieldData); + System.out.println("offending value:" + fieldData); } } } @@ -405,7 +401,6 @@ public class PDBFTSRestClient extends FTSRestClient return "/fts/pdb_data_columns.txt"; } - public static FTSRestClientI getInstance() { if (instance == null) diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index 5ee518b..27bfca8 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -241,13 +241,12 @@ public class UniProtFTSRestClient extends FTSRestClient summaryRowData[colCounter++] = (field.getDataType() .getDataTypeClass() == Integer.class) ? Integer .valueOf(fieldData.replace(",", "")) - : (field.getDataType() - .getDataTypeClass() == Double.class) ? Double + : (field.getDataType().getDataTypeClass() == Double.class) ? Double .valueOf(fieldData) : fieldData; } catch (Exception e) { e.printStackTrace(); - System.out.println("offending value:" + fieldData); + System.out.println("offending value:" + fieldData); } } } catch (Exception e) @@ -306,7 +305,6 @@ public class UniProtFTSRestClient extends FTSRestClient }; } - public static FTSRestClientI getInstance() { if (instance == null) diff --git a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java index 0d02cc0..f04e4fa 100644 --- a/src/jalview/fts/service/uniprot/UniprotFTSPanel.java +++ b/src/jalview/fts/service/uniprot/UniprotFTSPanel.java @@ -62,7 +62,7 @@ public class UniprotFTSPanel extends GFTSPanel offSet = 0; } new Thread() - { + { @Override public void run() { @@ -120,7 +120,9 @@ public class UniprotFTSPanel extends GFTSPanel .getString("label.result"); if (isPaginationEnabled() && resultSetCount > 0) { - updateSearchFrameTitle(defaultFTSFrameTitle + " - " + result + updateSearchFrameTitle(defaultFTSFrameTitle + + " - " + + result + " " + totalNumberformatter.format((Number) (offSet + 1)) + " to " @@ -128,8 +130,8 @@ public class UniprotFTSPanel extends GFTSPanel .format((Number) (offSet + resultSetCount)) + " of " + totalNumberformatter - .format((Number) totalResultSetCount) - + " " + " (" + (endTime - startTime) + " milli secs)"); + .format((Number) totalResultSetCount) + " " + + " (" + (endTime - startTime) + " milli secs)"); } else { @@ -173,7 +175,6 @@ public class UniprotFTSPanel extends GFTSPanel return foundSearchTerms; } - @Override public boolean isPaginationEnabled() { diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 49bd138..672f7ac 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -3640,8 +3640,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( - jalview.gui.Desktop.desktop, - MessageManager + jalview.gui.Desktop.desktop, MessageManager .getString("label.remove_from_default_list"), MessageManager .getString("label.remove_user_defined_colour"), diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index f755b25..51e50e2 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -676,7 +676,8 @@ public class AlignViewport extends AlignmentViewport implements List choosenSeqs = new ArrayList(); for (SequenceI sq : alignment.getSequences()) { - Vector pdbRefEntries = sq.getDatasetSequence().getAllPDBEntries(); + Vector pdbRefEntries = sq.getDatasetSequence() + .getAllPDBEntries(); if (pdbRefEntries == null) { continue; @@ -708,7 +709,8 @@ public class AlignViewport extends AlignmentViewport implements } } } - seqvectors.add(choosenSeqs.toArray(new SequenceI[choosenSeqs.size()])); + seqvectors + .add(choosenSeqs.toArray(new SequenceI[choosenSeqs.size()])); } return seqvectors.toArray(new SequenceI[seqvectors.size()][]); } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 424d52f..4db029c 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1281,7 +1281,7 @@ public class AlignmentPanel extends GAlignmentPanel implements if (file != null) { alignFrame.setProgressBar(MessageManager.formatMessage( - "status.saving_file", new Object[] { type.getLabel() }), + "status.saving_file", new Object[] { type.getLabel() }), pSessionId); } } @@ -1310,8 +1310,8 @@ public class AlignmentPanel extends GAlignmentPanel implements im = new jalview.util.ImageMaker(this, type, imageAction, aDimension.getWidth(), aDimension.getHeight() - + boarderBottomOffset, file, - imageTitle, alignFrame, pSessionId, headless); + + boarderBottomOffset, file, imageTitle, + alignFrame, pSessionId, headless); if (av.getWrapAlignment()) { if (im.getGraphics() != null) diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index 469e495..0d47e36 100644 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -174,7 +174,8 @@ public class AnnotationExporter extends JPanel else { text = new FeaturesFile().printJalviewFormat(ap.av.getAlignment() - .getDataset().getSequencesArray(), displayedFeatureColours, true, ap.av.isShowNPFeats()); // ap.av.featuresDisplayed); + .getDataset().getSequencesArray(), displayedFeatureColours, + true, ap.av.isShowNPFeats()); // ap.av.featuresDisplayed); text = formatter.printJalviewFormat(sequences, featureColours, true, includeNonPositional); } diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 0b2f6cc..199c4e5 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -458,8 +458,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, String tlabel = null; if (anots[index] != null) { // LML added stem code - if (type.equals(HELIX) || type.equals(SHEET) - || type.equals(STEM) || type.equals(LABEL)) + if (type.equals(HELIX) || type.equals(SHEET) || type.equals(STEM) + || type.equals(LABEL)) { tlabel = anots[index].description; if (tlabel == null || tlabel.length() < 1) @@ -814,8 +814,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { text.append(", ") .append(MessageManager.getString("label.sequence")) - .append(" ") - .append(seqIndex + 1); + .append(" ").append(seqIndex + 1); char residue = seqref.getCharAt(column); if (!Comparison.isGap(residue)) { diff --git a/src/jalview/gui/AnnotationRowFilter.java b/src/jalview/gui/AnnotationRowFilter.java index 37f1e55..c8bd69c 100644 --- a/src/jalview/gui/AnnotationRowFilter.java +++ b/src/jalview/gui/AnnotationRowFilter.java @@ -329,8 +329,8 @@ public abstract class AnnotationRowFilter extends JPanel } } - protected boolean colorAlignmContaining( - AlignmentAnnotation currentAnn, int selectedThresholdOption) + protected boolean colorAlignmContaining(AlignmentAnnotation currentAnn, + int selectedThresholdOption) { AnnotationColourGradient acg = null; @@ -347,8 +347,7 @@ public abstract class AnnotationRowFilter extends JPanel } acg.setSeqAssociated(seqAssociated.isSelected()); - if (currentAnn.graphMin == 0f - && currentAnn.graphMax == 0f) + if (currentAnn.graphMin == 0f && currentAnn.graphMax == 0f) { acg.setPredefinedColours(true); } diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 2299c26..24604ed 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -511,8 +511,8 @@ public class AppJmol extends StructureViewerBase StringBuilder fileList = new StringBuilder(); for (String s : files) { - fileList.append(SPACE).append(BACKSLASH).append(Platform.escapeString(s)) - .append(BACKSLASH); + fileList.append(SPACE).append(BACKSLASH) + .append(Platform.escapeString(s)).append(BACKSLASH); } String filesString = fileList.toString(); @@ -544,8 +544,7 @@ public class AppJmol extends StructureViewerBase jmb.evalStateCommand(command); } catch (OutOfMemoryError oomerror) { - new OOMWarning( - "When trying to add structures to the Jmol viewer!", + new OOMWarning("When trying to add structures to the Jmol viewer!", oomerror); Cache.log.debug("File locations are " + filesString); } catch (Exception ex) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 00b359a..f99af34 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -2514,8 +2514,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit - .getDefaultToolkit().getMenuShortcutKeyMask()), - "Quit"); + .getDefaultToolkit().getMenuShortcutKeyMask()), "Quit"); getRootPane().getActionMap().put("Quit", new AbstractAction() { @Override @@ -3185,7 +3184,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements for (Object file : (List) t .getTransferData(DataFlavor.javaFileListFlavor)) { - files.add(((File)file).toString()); + files.add(((File) file).toString()); protocols.add(FormatAdapter.FILE); } } diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 874ce16..15f3e5b 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -818,8 +818,8 @@ public class FeatureSettings extends JPanel implements } else { - Color color = new Color( - Integer.parseInt(jucs.getColour(i).getRGB(), 16)); + Color color = new Color(Integer.parseInt(jucs.getColour(i) + .getRGB(), 16)); fr.setColour(name = jucs.getColour(i).getName(), new FeatureColour(color)); } @@ -844,8 +844,7 @@ public class FeatureSettings extends JPanel implements void save() { JalviewFileChooser chooser = new JalviewFileChooser( - Cache.getProperty("LAST_DIRECTORY"), - new String[] { "fc" }, + Cache.getProperty("LAST_DIRECTORY"), new String[] { "fc" }, new String[] { "Sequence Feature Colours" }, "Sequence Feature Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index 8f16e77..f2d8113 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -37,8 +37,8 @@ public class Help { public enum HelpId { - Home("home"), SequenceFeatureSettings("seqfeatures.settings"), StructureViewer( - "viewingpdbs"); + Home("home"), SequenceFeatureSettings("seqfeatures.settings"), + StructureViewer("viewingpdbs"); private String id; diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 05166ad..a65be7b 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -334,8 +334,8 @@ public class IdPanel extends JPanel implements MouseListener, } if ((av.getSelectionGroup() == null) - || (!jalview.util.Platform.isControlDown(e) - && !e.isShiftDown() && av.getSelectionGroup() != null)) + || (!jalview.util.Platform.isControlDown(e) && !e.isShiftDown() && av + .getSelectionGroup() != null)) { av.setSelectionGroup(new SequenceGroup()); av.getSelectionGroup().setStartRes(0); @@ -368,8 +368,7 @@ public class IdPanel extends JPanel implements MouseListener, Sequence sq = (Sequence) av.getAlignment().getSequenceAt(seq2); // build a new links menu based on the current links + any non-positional // features - Vector nlinks = new Vector( - Preferences.sequenceURLLinks); + Vector nlinks = new Vector(Preferences.sequenceURLLinks); SequenceFeature sfs[] = sq == null ? null : sq.getSequenceFeatures(); if (sfs != null) { diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 47a8faf..d24daa1 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -314,6 +314,7 @@ public class Jalview2XML } return sq; } + /** * @return true if the forward reference was fully resolved */ @@ -388,35 +389,44 @@ public class Jalview2XML public void resolveFrefedSequences() { - Iterator nextFref=frefedSequence.iterator(); - int toresolve=frefedSequence.size(); - int unresolved=0,failedtoresolve=0; - while (nextFref.hasNext()) { + Iterator nextFref = frefedSequence.iterator(); + int toresolve = frefedSequence.size(); + int unresolved = 0, failedtoresolve = 0; + while (nextFref.hasNext()) + { SeqFref ref = nextFref.next(); if (ref.isResolvable()) { - try { + try + { if (ref.resolve()) { nextFref.remove(); - } else { + } + else + { failedtoresolve++; } - } catch (Exception x) { - System.err.println("IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence "+ref.getSref()); + } catch (Exception x) + { + System.err + .println("IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence " + + ref.getSref()); x.printStackTrace(); failedtoresolve++; - } - } else { + } + } + else + { unresolved++; } } - if (unresolved>0) + if (unresolved > 0) { System.err.println("Jalview Project Import: There were " + unresolved + " forward references left unresolved on the stack."); } - if (failedtoresolve>0) + if (failedtoresolve > 0) { System.err.println("SERIOUS! " + failedtoresolve + " resolvable forward references failed to resolve."); @@ -795,7 +805,7 @@ public class Jalview2XML JSeq jseq; Set calcIdSet = new HashSet(); // record the set of vamsas sequence XML POJO we create. - HashMap vamsasSetIds = new HashMap(); + HashMap vamsasSetIds = new HashMap(); // SAVE SEQUENCES for (final SequenceI jds : rjal.getSequences()) { @@ -848,8 +858,7 @@ public class Jalview2XML if (av.isHiddenRepSequence(jds)) { jalview.datamodel.SequenceI[] reps = av - .getRepresentedSequences(jds) - .getSequencesInOrder(rjal); + .getRepresentedSequences(jds).getSequencesInOrder(rjal); for (int h = 0; h < reps.length; h++) { @@ -1341,8 +1350,7 @@ public class Jalview2XML for (String featureType : renderOrder) { FeatureColourI fcol = ap.getSeqPanel().seqCanvas - .getFeatureRenderer() - .getFeatureStyle(featureType); + .getFeatureRenderer().getFeatureStyle(featureType); Setting setting = new Setting(); setting.setType(featureType); if (!fcol.isSimpleColour()) @@ -1355,8 +1363,8 @@ public class Jalview2XML setting.setAutoScale(fcol.isAutoScaled()); setting.setThreshold(fcol.getThreshold()); // -1 = No threshold, 0 = Below, 1 = Above - setting.setThreshstate(fcol.isAboveThreshold() ? 1 - : (fcol.isBelowThreshold() ? 0 : -1)); + setting.setThreshstate(fcol.isAboveThreshold() ? 1 : (fcol + .isBelowThreshold() ? 0 : -1)); } else { @@ -1378,8 +1386,7 @@ public class Jalview2XML // is groups actually supposed to be a map here ? Iterator en = ap.getSeqPanel().seqCanvas - .getFeatureRenderer() - .getFeatureGroups().iterator(); + .getFeatureRenderer().getFeatureGroups().iterator(); Vector groupsAdded = new Vector(); while (en.hasNext()) { @@ -2813,7 +2820,6 @@ public class Jalview2XML List hiddenSeqs = null; - List tmpseqs = new ArrayList(); boolean multipleView = false; @@ -2830,13 +2836,16 @@ public class Jalview2XML if (!incompleteSeqs.containsKey(seqId)) { // may not need this check, but keep it for at least 2.9,1 release - if (tmpSeq.getStart()!=jseqs[i].getStart() || tmpSeq.getEnd()!=jseqs[i].getEnd()) - { + if (tmpSeq.getStart() != jseqs[i].getStart() + || tmpSeq.getEnd() != jseqs[i].getEnd()) + { System.err .println("Warning JAL-2154 regression: updating start/end for sequence " + tmpSeq.toString() + " to " + jseqs[i]); } - } else { + } + else + { incompleteSeqs.remove(seqId); } if (vamsasSeq.length > vi && vamsasSeq[vi].getId().equals(seqId)) @@ -4009,11 +4018,10 @@ public class Jalview2XML // filename // translation differently. StructureData filedat = oldFiles.get(new File(oldfilenam)); - if (filedat == null) - { - String reformatedOldFilename = oldfilenam.replaceAll("/", - "\\\\"); - filedat = oldFiles.get(new File(reformatedOldFilename)); + if (filedat == null) + { + String reformatedOldFilename = oldfilenam.replaceAll("/", "\\\\"); + filedat = oldFiles.get(new File(reformatedOldFilename)); } newFileLoc.append(Platform.escapeString(filedat.getFilePath())); pdbfilenames.add(filedat.getFilePath()); diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index 040a1e5..e584eb7 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -579,8 +579,8 @@ public class OptsAndParamsPage if (!adjusting) { valueField.setText("" - + ((integ) ? ("" + slider.getValue()) - : ("" + slider.getValue() / 1000f))); + + ((integ) ? ("" + slider.getValue()) : ("" + slider + .getValue() / 1000f))); checkIfModified(); } diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index d09c756..1c48690 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -480,6 +480,7 @@ public class OverviewPanel extends JPanel implements Runnable } private BufferedImage lastMiniMe = null; + /** * DOCUMENT ME! * diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 939c087..7ab6022 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -928,8 +928,7 @@ public class PopupMenu extends JPopupMenu urlLink = new GroupUrlLink(link); } catch (Exception foo) { - Cache.log.error("Exception for GroupURLLink '" + link - + "'", foo); + Cache.log.error("Exception for GroupURLLink '" + link + "'", foo); continue; } ; diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index afc93e0..8dbe5e2 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -536,8 +536,8 @@ public class Preferences extends GPreferences /* * Save Output settings */ - Cache.applicationProperties.setProperty("EPS_RENDERING", - ((OptionsParam) epsRendering.getSelectedItem()).getCode()); + Cache.applicationProperties.setProperty("EPS_RENDERING", + ((OptionsParam) epsRendering.getSelectedItem()).getCode()); /* * Save Connections settings @@ -1046,7 +1046,8 @@ public class Preferences extends GPreferences } @Override - public int hashCode(){ + public int hashCode() + { return name.hashCode() + code.hashCode(); } } diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 136d222..bae80db 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -1752,7 +1752,7 @@ public class SeqPanel extends JPanel implements MouseListener, } PaintRefresher.Refresh(this, av.getSequenceSetId()); ap.paintAlignment(needOverviewUpdate); - needOverviewUpdate =false; + needOverviewUpdate = false; changeEndRes = false; changeStartRes = false; stretchGroup = null; @@ -2012,8 +2012,8 @@ public class SeqPanel extends JPanel implements MouseListener, { if (av.getAlignment() == null) { - Cache.log.warn("alignviewport av SeqSetId=" - + av.getSequenceSetId() + " ViewId=" + av.getViewId() + Cache.log.warn("alignviewport av SeqSetId=" + av.getSequenceSetId() + + " ViewId=" + av.getViewId() + " 's alignment is NULL! returning immediately."); return; } diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index 5d4ea68..bbe2f68 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -167,9 +167,8 @@ public class SequenceFetcher extends JPanel implements Runnable if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry() || lastDasSourceRegistry != (Cache.getDasSourceRegistry() - .getDasRegistryURL() + Cache - .getDasSourceRegistry().getLocalSourceString()) - .hashCode()) + .getDasRegistryURL() + Cache.getDasSourceRegistry() + .getLocalSourceString()).hashCode()) { _initingFetcher = true; initingThread = Thread.currentThread(); @@ -213,7 +212,7 @@ public class SequenceFetcher extends JPanel implements Runnable public SequenceFetcher(IProgressIndicator guiIndic, final String selectedDb, final String queryString) { - this._isConstructing=true; + this._isConstructing = true; this.progressIndicator = guiIndic; final SequenceFetcher us = this; // launch initialiser thread @@ -226,7 +225,7 @@ public class SequenceFetcher extends JPanel implements Runnable if (getSequenceFetcherSingleton(progressIndicator) != null) { us.initGui(progressIndicator, selectedDb, queryString); - us._isConstructing=false; + us._isConstructing = false; } else { @@ -252,17 +251,23 @@ public class SequenceFetcher extends JPanel implements Runnable }); sf.start(); } + /** - * blocking call which creates a new sequence fetcher panel, configures it and presses the OK button with the given database and query. + * blocking call which creates a new sequence fetcher panel, configures it and + * presses the OK button with the given database and query. + * * @param database * @param query */ public static List fetchAndShow(String database, String query) { - final SequenceFetcher sf = new SequenceFetcher(Desktop.instance, database, query); + final SequenceFetcher sf = new SequenceFetcher(Desktop.instance, + database, query); while (sf._isConstructing) { - try { Thread.sleep(50); + try + { + Thread.sleep(50); } catch (Exception q) { return Collections.emptyList(); @@ -282,7 +287,7 @@ public class SequenceFetcher extends JPanel implements Runnable { }; - + /** * initialise the database and query for this fetcher panel * @@ -523,6 +528,7 @@ public class SequenceFetcher extends JPanel implements Runnable new UniprotFTSPanel(this); frame.dispose(); } + private void otherSourceAction() { try @@ -912,8 +918,8 @@ public class SequenceFetcher extends JPanel implements Runnable } catch (Exception e) { Cache.log.info( - "Error retrieving " + accession - + " from " + proxy.getDbName(), e); + "Error retrieving " + accession + " from " + + proxy.getDbName(), e); } return success; } @@ -1032,8 +1038,7 @@ public class SequenceFetcher extends JPanel implements Runnable try { - af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", - false)); + af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN", false)); } catch (Exception ex) { } diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index c3fec4f..a381e8b 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -219,8 +219,9 @@ public class SliderPanel extends GSliderPanel pid.cs = cs; } - PIDSlider.setTitle(MessageManager - .formatMessage("label.percentage_identity_threshold", + PIDSlider + .setTitle(MessageManager.formatMessage( + "label.percentage_identity_threshold", new String[] { source })); if (ap.av.getAlignment().getGroups() != null) diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index 1bc85d2..6c849c3 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -70,7 +70,9 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI private static final int WINDOWS_INSETS_HEIGHT = 50; // tbc private static final int MAC_INSETS_HEIGHT = 50; + private static final int DESKTOP_DECORATORS_HEIGHT = 65; + private static final long serialVersionUID = 1L; public SplitFrame(GAlignFrame top, GAlignFrame bottom) @@ -723,6 +725,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI return Arrays.asList(new AlignFrame[] { (AlignFrame) getTopFrame(), (AlignFrame) getBottomFrame() }); } + /** * Replace Cmd-F Find action with our version. This is necessary because the * 'default' Finder searches in the first AlignFrame it finds. We need it to diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index af8b2f3..57debe3 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -195,7 +195,7 @@ public class StructureChooser extends GStructureChooser implements { getResultTable().setModel( FTSRestResponse.getTableModel(lastPdbRequest, - discoveredStructuresSet)); + discoveredStructuresSet)); noOfStructuresFound = discoveredStructuresSet.size(); mainFrame.setTitle(MessageManager.formatMessage( "label.structure_chooser_no_of_structures", @@ -264,8 +264,7 @@ public class StructureChooser extends GStructureChooser implements if (isValidSeqName(entry.getId())) { queryBuilder.append("pdb_id:") - .append(entry.getId().toLowerCase()) - .append(" OR "); + .append(entry.getId().toLowerCase()).append(" OR "); isPDBRefsFound = true; // seqRefs.add(entry.getId()); } @@ -281,8 +280,7 @@ public class StructureChooser extends GStructureChooser implements if (dbRef.getSource().equalsIgnoreCase(DBRefSource.UNIPROT)) { queryBuilder.append("uniprot_accession:") - .append(getDBRefId(dbRef)) - .append(" OR "); + .append(getDBRefId(dbRef)).append(" OR "); queryBuilder.append("uniprot_id:").append(getDBRefId(dbRef)) .append(" OR "); isUniProtRefsFound = true; @@ -291,8 +289,7 @@ public class StructureChooser extends GStructureChooser implements { queryBuilder.append("pdb_id:") - .append(getDBRefId(dbRef).toLowerCase()) - .append(" OR "); + .append(getDBRefId(dbRef).toLowerCase()).append(" OR "); isPDBRefsFound = true; } else @@ -347,7 +344,6 @@ public class StructureChooser extends GStructureChooser implements .replaceAll("[^\\dA-Za-z|_]", "").replaceAll("\\s+", "+"); } - /** * Ensures sequence ref names are not less than 3 characters and does not * contain a database name @@ -458,8 +454,8 @@ public class StructureChooser extends GStructureChooser implements reorderedStructuresSet.addAll(filteredResponse); reorderedStructuresSet.addAll(discoveredStructuresSet); getResultTable().setModel( - FTSRestResponse.getTableModel( - lastPdbRequest, reorderedStructuresSet)); + FTSRestResponse.getTableModel(lastPdbRequest, + reorderedStructuresSet)); FTSRestResponse.configureTableColumn(getResultTable(), wantedFields, tempUserPrefs); @@ -898,9 +894,9 @@ public class StructureChooser extends GStructureChooser implements } if (seq.getPrimaryDBRefs().size() == 0) { - seqsWithoutSourceDBRef.add(seq); - continue; - } + seqsWithoutSourceDBRef.add(seq); + continue; + } } if (!seqsWithoutSourceDBRef.isEmpty()) { @@ -1003,8 +999,7 @@ public class StructureChooser extends GStructureChooser implements pdbRequest.setResponseSize(1); pdbRequest.setFieldToSearchBy("(pdb_id:"); pdbRequest.setWantedFields(wantedFields); - pdbRequest -.setSearchTerm(searchTerm + ")"); + pdbRequest.setSearchTerm(searchTerm + ")"); pdbRequest.setAssociatedSequence(selectedSequence); pdbRestCleint = PDBFTSRestClient.getInstance(); wantedFields.add(pdbRestCleint.getPrimaryKeyColumn()); diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index ef65b92..0e513f7 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -811,8 +811,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, for (int i = 0; i < leaves.size(); i++) { - SequenceI seq = (SequenceI) leaves.elementAt(i) - .element(); + SequenceI seq = (SequenceI) leaves.elementAt(i).element(); treeSelectionChanged(seq); } av.sendSelection(); @@ -968,15 +967,14 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, (int) (Math.random() * 255), (int) (Math.random() * 255)); setColor(tree.getGroups().elementAt(i), col.brighter()); - Vector l = tree.findLeaves(tree - .getGroups().elementAt(i)); + Vector l = tree.findLeaves(tree.getGroups() + .elementAt(i)); Vector sequences = new Vector(); for (int j = 0; j < l.size(); j++) { - SequenceI s1 = (SequenceI) l.elementAt(j) - .element(); + SequenceI s1 = (SequenceI) l.elementAt(j).element(); if (!sequences.contains(s1)) { diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index 4c2265c..ec1c82e 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -174,8 +174,7 @@ public class FastaFile extends AlignFile addProperties(al); for (int i = 0; i < annotations.size(); i++) { - AlignmentAnnotation aa = annotations - .elementAt(i); + AlignmentAnnotation aa = annotations.elementAt(i); aa.setPadGaps(true, al.getGapCharacter()); al.addAnnotation(aa); } diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index aa38540..73783e5 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -138,8 +138,7 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @return true if features were added */ public boolean parse(AlignmentI align, - Map colours, - boolean removeHTML) + Map colours, boolean removeHTML) { return parse(align, colours, removeHTML, false); } @@ -176,8 +175,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @return true if features were added */ public boolean parse(AlignmentI align, - Map colours, - boolean removeHTML, boolean relaxedIdmatching) + Map colours, boolean removeHTML, + boolean relaxedIdmatching) { Map gffProps = new HashMap(); /* @@ -587,7 +586,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI { for (SequenceFeature sequenceFeature : features) { - isnonpos = sequenceFeature.begin == 0 && sequenceFeature.end == 0; + isnonpos = sequenceFeature.begin == 0 + && sequenceFeature.end == 0; if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible .containsKey(sequenceFeature.type))) diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index 4e1b261..68173ff 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -57,7 +57,6 @@ public class HtmlSvgOutput private boolean headless; - public HtmlSvgOutput(File file, AlignmentPanel ap) { this.av = ap.av; @@ -114,8 +113,7 @@ public class HtmlSvgOutput try { setProgressMessage(null); - setProgressMessage(MessageManager -.formatMessage( + setProgressMessage(MessageManager.formatMessage( "status.exporting_alignment_as_x_file", "HTML")); AlignmentDimension aDimension = ap.getAlignmentDimension(); SVGGraphics2D g1 = new SVGGraphics2D(aDimension.getWidth(), diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 889359f..deae9ae 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -251,7 +251,7 @@ public class IdentifyFile } int lessThan = data.indexOf("<"); if ((lessThan > -1)) // possible Markup Language data i.e HTML, - // RNAML, XML + // RNAML, XML { String upper = data.toUpperCase(); if (upper.substring(lessThan).startsWith(" -1 - || tmpString.indexOf(">") > -1) + if (tmpString.indexOf("<") > -1 || tmpString.indexOf(">") > -1) { // The description does not specify html is to // be used, so we must remove < > symbols @@ -167,8 +166,7 @@ public class SequenceAnnotationReport .getType()); if (rng != null && rng[0] != null && rng[0][0] != rng[0][1]) { - sb.append(" Score=").append( - String.valueOf(feature.getScore())); + sb.append(" Score=").append(String.valueOf(feature.getScore())); } } String status = (String) feature.getValue("status"); @@ -312,8 +310,7 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - result.add(new String[] { target, label, urls[u], - urls[u + 1] }); + result.add(new String[] { target, label, urls[u], urls[u + 1] }); uniques.add(unq); } } @@ -331,8 +328,7 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - result.add(new String[] { target, label, urls[u], - urls[u + 1] }); + result.add(new String[] { target, label, urls[u], urls[u + 1] }); uniques.add(unq); } } @@ -349,8 +345,7 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - result.add(new String[] { target, label, urls[u], - urls[u + 1] }); + result.add(new String[] { target, label, urls[u], urls[u + 1] }); uniques.add(unq); } } diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index bec7d82..27be358 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -829,8 +829,7 @@ public class StockholmFile extends AlignFile { if (DETECT_BRACKETS.search(pos)) { - ann.secondaryStructure = Rna.getRNASecStrucState( - pos).charAt(0); + ann.secondaryStructure = Rna.getRNASecStrucState(pos).charAt(0); } else { diff --git a/src/jalview/io/StructureFile.java b/src/jalview/io/StructureFile.java index 0bc6a73..7047f7f 100644 --- a/src/jalview/io/StructureFile.java +++ b/src/jalview/io/StructureFile.java @@ -77,8 +77,8 @@ public abstract class StructureFile extends AlignFile } - public StructureFile(boolean parseImmediately, String dataObject, String type) - throws IOException + public StructureFile(boolean parseImmediately, String dataObject, + String type) throws IOException { super(parseImmediately, dataObject, type); } diff --git a/src/jalview/io/gff/ExonerateHelper.java b/src/jalview/io/gff/ExonerateHelper.java index f7805fd..1ee99c0 100644 --- a/src/jalview/io/gff/ExonerateHelper.java +++ b/src/jalview/io/gff/ExonerateHelper.java @@ -64,8 +64,8 @@ public class ExonerateHelper extends Gff2Helper try { - processGffSimilarity(set, seq, gffColumns, - align, newseqs, relaxedIdMatching); + processGffSimilarity(set, seq, gffColumns, align, newseqs, + relaxedIdMatching); } catch (IOException ivfe) { System.err.println(ivfe); @@ -98,8 +98,7 @@ public class ExonerateHelper extends Gff2Helper * if true allow fuzzy search for a matching target sequence * @throws IOException */ - protected void processGffSimilarity( - Map> set, + protected void processGffSimilarity(Map> set, SequenceI seq, String[] gff, AlignmentI align, List newseqs, boolean relaxedIdMatching) throws IOException @@ -228,15 +227,17 @@ public class ExonerateHelper extends Gff2Helper int alignFromStart; int alignToStart; int alignCount; - try { + try + { alignFromStart = Integer.parseInt(tokens[0]); alignToStart = Integer.parseInt(tokens[1]); alignCount = Integer.parseInt(tokens[2]); - } catch (NumberFormatException nfe) { + } catch (NumberFormatException nfe) + { System.err.println(nfe.toString()); return null; } - + int fromStart; int fromEnd; int toStart; @@ -290,10 +291,8 @@ public class ExonerateHelper extends Gff2Helper { result = MappingType.PeptideToNucleotide; } - else if (model.contains(CODING2CODING) - || model.contains(CODING2GENOME) - || model.contains(CDNA2GENOME) - || model.contains(GENOME2GENOME)) + else if (model.contains(CODING2CODING) || model.contains(CODING2GENOME) + || model.contains(CDNA2GENOME) || model.contains(GENOME2GENOME)) { result = MappingType.NucleotideToNucleotide; } @@ -323,10 +322,8 @@ public class ExonerateHelper extends Gff2Helper { String mdl = model.toLowerCase(); if (mdl.contains(PROTEIN2DNA) || mdl.contains(PROTEIN2GENOME) - || mdl.contains(CODING2CODING) - || mdl.contains(CODING2GENOME) - || mdl.contains(CDNA2GENOME) - || mdl.contains(GENOME2GENOME)) + || mdl.contains(CODING2CODING) || mdl.contains(CODING2GENOME) + || mdl.contains(CDNA2GENOME) || mdl.contains(GENOME2GENOME)) { return true; } diff --git a/src/jalview/io/gff/Gff3Helper.java b/src/jalview/io/gff/Gff3Helper.java index 031900d..f517310 100644 --- a/src/jalview/io/gff/Gff3Helper.java +++ b/src/jalview/io/gff/Gff3Helper.java @@ -77,8 +77,8 @@ public class Gff3Helper extends GffHelperBase } else if (so.isA(soTerm, SequenceOntologyI.NUCLEOTIDE_MATCH)) { - sf = processNucleotideMatch(attributes, seq, gff, align, - newseqs, relaxedIdMatching); + sf = processNucleotideMatch(attributes, seq, gff, align, newseqs, + relaxedIdMatching); } else { @@ -92,7 +92,7 @@ public class Gff3Helper extends GffHelperBase */ sf = buildSequenceFeature(gff, null); } - + return sf; } @@ -119,8 +119,7 @@ public class Gff3Helper extends GffHelperBase protected SequenceFeature processNucleotideMatch( Map> attributes, SequenceI seq, String[] gffColumns, AlignmentI align, List newseqs, - boolean relaxedIdMatching) - throws IOException + boolean relaxedIdMatching) throws IOException { String strand = gffColumns[STRAND_COL]; @@ -166,8 +165,8 @@ public class Gff3Helper extends GffHelperBase * (new or existing) virtual sequence in the newseqs list */ String targetId = findTargetId(tokens[0], attributes); - SequenceI mappedSequence1 = findSequence(targetId, align, - newseqs, relaxedIdMatching); + SequenceI mappedSequence1 = findSequence(targetId, align, newseqs, + relaxedIdMatching); SequenceI mappedSequence = mappedSequence1; if (mappedSequence == null) { @@ -195,8 +194,7 @@ public class Gff3Helper extends GffHelperBase int fromStart = Integer.parseInt(gffColumns[START_COL]); int fromEnd = Integer.parseInt(gffColumns[END_COL]); MapList mapping = constructMappingFromAlign(fromStart, fromEnd, - toStart, toEnd, - MappingType.NucleotideToNucleotide); + toStart, toEnd, MappingType.NucleotideToNucleotide); if (mapping != null) { @@ -280,8 +278,8 @@ public class Gff3Helper extends GffHelperBase for (String target : targets) { - SequenceI mappedSequence1 = findSequence(findTargetId(target, set), align, - newseqs, relaxedIdMatching); + SequenceI mappedSequence1 = findSequence(findTargetId(target, set), + align, newseqs, relaxedIdMatching); SequenceI mappedSequence = mappedSequence1; if (mappedSequence == null) { @@ -379,8 +377,8 @@ public class Gff3Helper extends GffHelperBase /* * Ensembl returns dna variants as 'alleles' */ - desc = StringUtils.listToDelimitedString( - attributes.get("alleles"), ","); + desc = StringUtils.listToDelimitedString(attributes.get("alleles"), + ","); } /* diff --git a/src/jalview/io/gff/GffHelperBase.java b/src/jalview/io/gff/GffHelperBase.java index feeec1d..21c89b3 100644 --- a/src/jalview/io/gff/GffHelperBase.java +++ b/src/jalview/io/gff/GffHelperBase.java @@ -392,7 +392,8 @@ public abstract class GffHelperBase implements GffHelperI * @param toSeq * @return */ - protected AlignedCodonFrame getMapping(AlignmentI align, SequenceI fromSeq, SequenceI toSeq) + protected AlignedCodonFrame getMapping(AlignmentI align, + SequenceI fromSeq, SequenceI toSeq) { AlignedCodonFrame acf = align.getMapping(fromSeq, toSeq); if (acf == null) diff --git a/src/jalview/io/gff/GffHelperFactory.java b/src/jalview/io/gff/GffHelperFactory.java index 8bd5115..9cfa5a8 100644 --- a/src/jalview/io/gff/GffHelperFactory.java +++ b/src/jalview/io/gff/GffHelperFactory.java @@ -1,6 +1,5 @@ package jalview.io.gff; - /** * A factory to serve instances of GFF helper classes */ diff --git a/src/jalview/io/gff/GffHelperI.java b/src/jalview/io/gff/GffHelperI.java index 3d9dc6f..118b78b 100644 --- a/src/jalview/io/gff/GffHelperI.java +++ b/src/jalview/io/gff/GffHelperI.java @@ -35,9 +35,8 @@ public interface GffHelperI * @throws IOException */ SequenceFeature processGff(SequenceI seq, String[] gffColumns, - AlignmentI align, - List newseqs, boolean relaxedIdMatching) - throws IOException; + AlignmentI align, List newseqs, + boolean relaxedIdMatching) throws IOException; // java 8 will allow static methods in interfaces: // static boolean recognises(String [] columns); diff --git a/src/jalview/io/gff/SequenceOntologyFactory.java b/src/jalview/io/gff/SequenceOntologyFactory.java index 2053b86..40e951d 100644 --- a/src/jalview/io/gff/SequenceOntologyFactory.java +++ b/src/jalview/io/gff/SequenceOntologyFactory.java @@ -1,6 +1,5 @@ package jalview.io.gff; - /** * A factory class that returns a model of the Sequence Ontology. By default a * hard-coded subset is used (for the applet, or testing), or setInstance() can diff --git a/src/jalview/io/gff/SequenceOntologyLite.java b/src/jalview/io/gff/SequenceOntologyLite.java index d46dcbe..206c28d 100644 --- a/src/jalview/io/gff/SequenceOntologyLite.java +++ b/src/jalview/io/gff/SequenceOntologyLite.java @@ -112,7 +112,8 @@ public class SequenceOntologyLite implements SequenceOntologyI private void loadStaticData() { parents = new HashMap>(); - for (String [] pair : TERMS) { + for (String[] pair : TERMS) + { List p = parents.get(pair[0]); if (p == null) { diff --git a/src/jalview/io/packed/JalviewDataset.java b/src/jalview/io/packed/JalviewDataset.java index 63263d2..c1ca1b7 100644 --- a/src/jalview/io/packed/JalviewDataset.java +++ b/src/jalview/io/packed/JalviewDataset.java @@ -211,8 +211,7 @@ public class JalviewDataset * @param parentAlignment */ public JalviewDataset(AlignmentI aldataset, - Map fc, - Hashtable seqDets) + Map fc, Hashtable seqDets) { // TODO not used - remove? this(aldataset, fc, seqDets, null); @@ -234,8 +233,8 @@ public class JalviewDataset * with. */ public JalviewDataset(AlignmentI aldataset, - Map fc, - Hashtable seqDets, AlignmentI parentAlignment) + Map fc, Hashtable seqDets, + AlignmentI parentAlignment) { this(); parentDataset = aldataset; diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 70333f4..6b94559 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -315,8 +315,7 @@ public class GAlignFrame extends JInternalFrame radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( - jalview.gui.Desktop.desktop, - MessageManager + jalview.gui.Desktop.desktop, MessageManager .getString("label.remove_from_default_list"), MessageManager .getString("label.remove_user_defined_colour"), @@ -1742,7 +1741,8 @@ public class GAlignFrame extends JInternalFrame showProducts.setText(MessageManager.getString("label.get_cross_refs")); runGroovy.setText(MessageManager.getString("label.run_groovy")); - runGroovy.setToolTipText(MessageManager.getString("label.run_groovy_tip")); + runGroovy.setToolTipText(MessageManager + .getString("label.run_groovy_tip")); runGroovy.addActionListener(new ActionListener() { @Override @@ -2406,6 +2406,7 @@ public class GAlignFrame extends JInternalFrame { } + /** * Adds the given action listener and key accelerator to the given menu item. * Also saves in a lookup table to support lookup of action by key stroke. diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 4d66a18..3a064d2 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -612,10 +612,9 @@ public abstract class GStructureChooser extends JPanel implements { return true; } - + FTSDataColumnI[] currentWantedFields = pdbDocFieldPrefs - .getStructureSummaryFields() - .toArray(new FTSDataColumnI[0]); + .getStructureSummaryFields().toArray(new FTSDataColumnI[0]); return Arrays.equals(currentWantedFields, previousWantedFields) ? false : true; @@ -795,6 +794,7 @@ public abstract class GStructureChooser extends JPanel implements { return tbl_summary; } + public JComboBox getCmbFilterOption() { return cmb_filterOption; diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index e58ba02..3fdcb3b 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -151,9 +151,9 @@ public class AnnotationRenderer annotationPanel = null; } - void drawStemAnnot(Graphics g, Annotation[] row_annotations, - int lastSSX, int x, int y, int iconOffset, int startRes, - int column, boolean validRes, boolean validEnd) + void drawStemAnnot(Graphics g, Annotation[] row_annotations, int lastSSX, + int x, int y, int iconOffset, int startRes, int column, + boolean validRes, boolean validEnd) { g.setColor(STEM_COLOUR); int sCol = (lastSSX / charWidth) + startRes; @@ -1085,8 +1085,8 @@ public class AnnotationRenderer private Color sdNOTCANONICAL_COLOUR; - void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawGlyphLine(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(GLYPHLINE_COLOR); @@ -1117,8 +1117,8 @@ public class AnnotationRenderer } - void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, - int x, int y, int iconOffset, int startRes, int column, + void drawHelixAnnot(Graphics g, Annotation[] row, int lastSSX, int x, + int y, int iconOffset, int startRes, int column, boolean validRes, boolean validEnd) { g.setColor(HELIX_COLOUR); diff --git a/src/jalview/renderer/ScaleRenderer.java b/src/jalview/renderer/ScaleRenderer.java index 6940f22..82536d4 100644 --- a/src/jalview/renderer/ScaleRenderer.java +++ b/src/jalview/renderer/ScaleRenderer.java @@ -62,8 +62,8 @@ public class ScaleRenderer * marker position in alignment column coords, a String to be rendered * at the position (or null) */ - public List calculateMarks(AlignViewportI av, - int startx, int endx) + public List calculateMarks(AlignViewportI av, int startx, + int endx) { int scalestartx = (startx / 10) * 10; diff --git a/src/jalview/schemes/FeatureColour.java b/src/jalview/schemes/FeatureColour.java index bdc70c9..c3b46df 100644 --- a/src/jalview/schemes/FeatureColour.java +++ b/src/jalview/schemes/FeatureColour.java @@ -336,9 +336,10 @@ public class FeatureColour implements FeatureColourI setAutoScaled(fc.isAutoScaled()); setColourByLabel(fc.isColourByLabel()); } - + /** * Copy constructor with new min/max ranges + * * @param fc * @param min * @param max @@ -406,6 +407,7 @@ public class FeatureColour implements FeatureColourI setGraduatedColour(false); } } + @Override public boolean isBelowThreshold() { @@ -543,7 +545,8 @@ public class FeatureColour implements FeatureColourI { scl = 1f; } - return new Color(minRed + scl * deltaRed, minGreen + scl * deltaGreen, minBlue + scl * deltaBlue); + return new Color(minRed + scl * deltaRed, minGreen + scl * deltaGreen, + minBlue + scl * deltaBlue); } /** diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index c235c7a..90a7952 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -1060,8 +1060,8 @@ public class ResidueProperties charged.put("D", Integer.valueOf(1)); charged.put("N", Integer.valueOf(0)); // Asparagine is polar but not // charged. - // Alternative would be charged and - // negative (in basic form)? + // Alternative would be charged and + // negative (in basic form)? charged.put("S", Integer.valueOf(0)); charged.put("T", Integer.valueOf(0)); charged.put("P", Integer.valueOf(0)); diff --git a/src/jalview/structure/StructureImportSettings.java b/src/jalview/structure/StructureImportSettings.java index 82b5f69..af45278 100644 --- a/src/jalview/structure/StructureImportSettings.java +++ b/src/jalview/structure/StructureImportSettings.java @@ -37,7 +37,6 @@ public class StructureImportSettings JMOL_PARSER, JALVIEW_PARSER } - /** * Determines the default file format for structure files to be downloaded * from the PDB sequence fetcher. Possible options include: PDB|mmCIF @@ -49,6 +48,7 @@ public class StructureImportSettings * are : JMolParser|JalveiwParser */ private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER; + public static void addSettings(boolean addAlignmentAnnotations, boolean processSecStr, boolean externalSecStr) { diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 7b103be..612b168 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -327,7 +327,6 @@ public class StructureSelectionManager return setMapping(true, sequence, targetChains, pdbFile, protocol); } - /** * create sequence structure mappings between each sequence and the given * pdbFile (retrieved via the given protocol). @@ -348,8 +347,7 @@ public class StructureSelectionManager */ synchronized public StructureFile setMapping(boolean forStructureView, SequenceI[] sequenceArray, String[] targetChainIds, - String pdbFile, - String protocol) + String pdbFile, String protocol) { /* * There will be better ways of doing this in the future, for now we'll use @@ -538,8 +536,7 @@ public class StructureSelectionManager try { StructureMapping siftsMapping = getStructureMapping(seq, - pdbFile, - chain.id, pdb, chain, sqmpping, maxAlignseq); + pdbFile, chain.id, pdb, chain, sqmpping, maxAlignseq); foundSiftsMappings.add(siftsMapping); } catch (SiftsException e) { @@ -614,24 +611,23 @@ public class StructureSelectionManager PDBChain maxChain, jalview.datamodel.Mapping sqmpping, AlignSeq maxAlignseq) throws SiftsException { - StructureMapping curChainMapping = siftsClient - .getSiftsStructureMapping(seq, pdbFile, targetChainId); - try - { + StructureMapping curChainMapping = siftsClient + .getSiftsStructureMapping(seq, pdbFile, targetChainId); + try + { PDBChain chain = pdb.findChain(targetChainId); if (chain != null) { chain.transferResidueAnnotation(curChainMapping, sqmpping); } - } catch (Exception e) - { - e.printStackTrace(); - } - return curChainMapping; + } catch (Exception e) + { + e.printStackTrace(); + } + return curChainMapping; } - private StructureMapping getNWMappings(SequenceI seq, - String pdbFile, + private StructureMapping getNWMappings(SequenceI seq, String pdbFile, String maxChainId, PDBChain maxChain, StructureFile pdb, AlignSeq maxAlignseq) { diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index fcea21d..9532230 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -62,9 +62,9 @@ public class ImageMaker public enum TYPE { - EPS("EPS", MessageManager.getString("label.eps_file"), getEPSChooser()), PNG( - "PNG", MessageManager.getString("label.png_image"), - getPNGChooser()), SVG("SVG", "SVG", getSVGChooser()); + EPS("EPS", MessageManager.getString("label.eps_file"), getEPSChooser()), + PNG("PNG", MessageManager.getString("label.png_image"), getPNGChooser()), + SVG("SVG", "SVG", getSVGChooser()); private JalviewFileChooser chooser; diff --git a/src/jalview/util/MapList.java b/src/jalview/util/MapList.java index dc5bee8..58abdc3 100644 --- a/src/jalview/util/MapList.java +++ b/src/jalview/util/MapList.java @@ -342,7 +342,8 @@ public class MapList */ public static List coalesceRanges(final List ranges) { - if (ranges == null || ranges.size() < 2) { + if (ranges == null || ranges.size() < 2) + { return ranges; } @@ -353,7 +354,7 @@ public class MapList lastRange = new int[] { lastRange[0], lastRange[1] }; merged.add(lastRange); boolean first = true; - + for (final int[] range : ranges) { if (first) @@ -387,7 +388,8 @@ public class MapList * if next range is in the same direction as last and contiguous, * just update the end position of the last range */ - boolean sameDirection = range[1] == range[0] || direction == lastDirection; + boolean sameDirection = range[1] == range[0] + || direction == lastDirection; boolean extending = range[0] == lastRange[1] + lastDirection; boolean overlapping = (lastDirection == 1 && range[0] >= lastRange[0] && range[0] <= lastRange[1]) || (lastDirection == -1 && range[0] <= lastRange[0] && range[0] >= lastRange[1]); @@ -404,7 +406,7 @@ public class MapList lastDirection = (range[1] == range[0]) ? lastDirection : direction; } } - + return changed ? merged : ranges; } diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index da83338..1fe452d 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -374,7 +374,8 @@ public final class MappingUtils /* * Found a sequence mapping. Locate the start/end mapped residues. */ - List mapping = Arrays.asList(new AlignedCodonFrame[] { acf }); + List mapping = Arrays + .asList(new AlignedCodonFrame[] { acf }); SearchResults sr = buildSearchResults(selected, startResiduePos, mapping); for (Match m : sr.getResults()) @@ -555,9 +556,9 @@ public final class MappingUtils * @param fromGapChar */ protected static void mapHiddenColumns(int[] hidden, - List mappings, - ColumnSelection mappedColumns, List fromSequences, - List toSequences, char fromGapChar) + List mappings, ColumnSelection mappedColumns, + List fromSequences, List toSequences, + char fromGapChar) { for (int col = hidden[0]; col <= hidden[1]; col++) { @@ -589,9 +590,9 @@ public final class MappingUtils * @param fromGapChar */ protected static void mapColumn(int col, - List mappings, - ColumnSelection mappedColumns, List fromSequences, - List toSequences, char fromGapChar) + List mappings, ColumnSelection mappedColumns, + List fromSequences, List toSequences, + char fromGapChar) { int[] mappedTo = findMappedColumns(col, mappings, fromSequences, toSequences, fromGapChar); @@ -646,8 +647,7 @@ public final class MappingUtils * Get the residue position and find the mapped position. */ int residuePos = fromSeq.findPosition(col); - SearchResults sr = buildSearchResults(fromSeq, residuePos, - mappings); + SearchResults sr = buildSearchResults(fromSeq, residuePos, mappings); for (Match m : sr.getResults()) { int mappedStartResidue = m.getStart(); @@ -893,7 +893,7 @@ public final class MappingUtils { return ranges; } - + int[] copy = Arrays.copyOf(ranges, ranges.length); int sxpos = -1; int cdspos = 0; @@ -921,7 +921,7 @@ public final class MappingUtils break; } } - + if (sxpos > 0) { /* diff --git a/src/jalview/util/QuickSort.java b/src/jalview/util/QuickSort.java index c1ef153..62fd56e 100755 --- a/src/jalview/util/QuickSort.java +++ b/src/jalview/util/QuickSort.java @@ -670,7 +670,7 @@ public class QuickSort final int length = arr.length; Integer[] indices = makeIndexArray(length); Arrays.sort(indices, new IntComparator(arr, ascending)); - + /* * Copy the array values as per the sorted indices */ @@ -681,7 +681,7 @@ public class QuickSort sortedInts[i] = arr[indices[i]]; sortedObjects[i] = s[indices[i]]; } - + /* * And copy the sorted values back into the arrays */ @@ -707,7 +707,7 @@ public class QuickSort final int length = arr.length; Integer[] indices = makeIndexArray(length); Arrays.sort(indices, new ExternalComparator(arr, ascending)); - + /* * Copy the array values as per the sorted indices */ @@ -718,7 +718,7 @@ public class QuickSort sortedStrings[i] = arr[indices[i]]; sortedObjects[i] = s[indices[i]]; } - + /* * And copy the sorted values back into the arrays */ @@ -743,7 +743,7 @@ public class QuickSort final int length = arr.length; Integer[] indices = makeIndexArray(length); Arrays.sort(indices, new DoubleComparator(arr, ascending)); - + /* * Copy the array values as per the sorted indices */ @@ -754,7 +754,7 @@ public class QuickSort sortedDoubles[i] = arr[indices[i]]; sortedObjects[i] = s[indices[i]]; } - + /* * And copy the sorted values back into the arrays */ diff --git a/src/jalview/util/StringUtils.java b/src/jalview/util/StringUtils.java index ccc2012..b5ab40d 100644 --- a/src/jalview/util/StringUtils.java +++ b/src/jalview/util/StringUtils.java @@ -248,7 +248,7 @@ public class StringUtils } return "" + separator; } - + /** * Converts a list to a string with a delimiter before each term except the * first. Returns an empty string given a null or zero-length argument. This diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 80319be..3a92e4b 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1573,7 +1573,7 @@ public abstract class AlignmentViewport implements AlignViewportI, public boolean isHiddenRepSequence(SequenceI seq) { return (hiddenRepSequences != null && hiddenRepSequences - .containsKey(seq)); + .containsKey(seq)); } /** @@ -2796,8 +2796,7 @@ public abstract class AlignmentViewport implements AlignViewportI, public void expandColSelection(SequenceGroup sg, boolean wholewidth) { int sgs, sge; - if (sg != null - && (sgs = sg.getStartRes()) >= 0 + if (sg != null && (sgs = sg.getStartRes()) >= 0 && sg.getStartRes() <= (sge = sg.getEndRes()) && !this.hasSelectedColumns()) { diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java index d813fe2..4ac4804 100644 --- a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java @@ -572,7 +572,7 @@ public abstract class FeatureRendererModel implements @Override public void setColour(String featureType, FeatureColourI col) { - featureColours.put(featureType, col); + featureColours.put(featureType, col); } public void setTransparency(float value) diff --git a/src/jalview/workers/AlignCalcWorker.java b/src/jalview/workers/AlignCalcWorker.java index 771c492..0ad8726 100644 --- a/src/jalview/workers/AlignCalcWorker.java +++ b/src/jalview/workers/AlignCalcWorker.java @@ -95,6 +95,7 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI ourAnnots.clear(); } } + // TODO: allow GUI to query workers associated with annotation to add items to // annotation label panel popup menu @@ -118,8 +119,10 @@ public abstract class AlignCalcWorker implements AlignCalcWorkerI float max = Float.MIN_VALUE; float min = Float.MAX_VALUE; boolean set = false; - for (Annotation a : anns) { - if (a != null) { + for (Annotation a : anns) + { + if (a != null) + { set = true; float val = a.value; max = Math.max(max, val); diff --git a/src/jalview/workers/AlignmentAnnotationFactory.java b/src/jalview/workers/AlignmentAnnotationFactory.java index 2b7d9e1..9c9ea83 100644 --- a/src/jalview/workers/AlignmentAnnotationFactory.java +++ b/src/jalview/workers/AlignmentAnnotationFactory.java @@ -69,7 +69,7 @@ public class AlignmentAnnotationFactory { // TODO need an interface for AlignFrame by which to access // its AlignViewportI and AlignmentViewPanel - AlignFrame currentAlignFrame = Jalview.getCurrentAlignFrame() ; + AlignFrame currentAlignFrame = Jalview.getCurrentAlignFrame(); if (currentAlignFrame != null) { newCalculator(currentAlignFrame.getViewport(), currentAlignFrame @@ -91,8 +91,7 @@ public class AlignmentAnnotationFactory * provider of AlignmentAnnotation for the alignment */ public static void newCalculator(AlignViewportI viewport, - AlignmentViewPanel panel, - AnnotationProviderI calculator) + AlignmentViewPanel panel, AnnotationProviderI calculator) { new AnnotationWorker(viewport, panel, calculator); } diff --git a/src/jalview/workers/ColumnCounterWorker.java b/src/jalview/workers/ColumnCounterWorker.java index 2f73cb5..dd56aaf 100644 --- a/src/jalview/workers/ColumnCounterWorker.java +++ b/src/jalview/workers/ColumnCounterWorker.java @@ -168,8 +168,7 @@ class ColumnCounterWorker extends AlignCalcWorker */ AlignmentAnnotation ann = alignViewport.getAlignment() .findOrCreateAnnotation(counter.getName(), - counter.getDescription(), false, null, - null); + counter.getDescription(), false, null, null); ann.description = counter.getDescription(); ann.showAllColLabels = true; ann.scaleColLabel = true; diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java index 453cd00..fd511dc 100644 --- a/src/jalview/ws/DBRefFetcher.java +++ b/src/jalview/ws/DBRefFetcher.java @@ -115,7 +115,8 @@ public class DBRefFetcher implements Runnable */ public DBRefFetcher(SequenceI[] seqs, IProgressIndicator progressIndicatorFrame, - DbSourceProxy[] sources, FeatureSettings featureSettings, boolean isNucleotide) + DbSourceProxy[] sources, FeatureSettings featureSettings, + boolean isNucleotide) { listeners = new ArrayList(); this.progressWindow = progressIndicatorFrame; @@ -340,7 +341,7 @@ public class DBRefFetcher implements Runnable { progressWindow.setProgressBar( MessageManager.getString("status.fetching_db_refs"), - startTime); + startTime); } try { @@ -389,8 +390,8 @@ public class DBRefFetcher implements Runnable // Still queries to make for current seqIndex StringBuffer queryString = new StringBuffer(""); int numq = 0; - int nqSize = (maxqlen > queries.size()) ? queries - .size() : maxqlen; + int nqSize = (maxqlen > queries.size()) ? queries.size() + : maxqlen; while (queries.size() > 0 && numq < nqSize) { @@ -514,8 +515,7 @@ public class DBRefFetcher implements Runnable output.setText(sb.toString()); Desktop.addInternalFrame(output, - MessageManager.getString("label.sequences_updated"), - 600, 300); + MessageManager.getString("label.sequences_updated"), 600, 300); // The above is the dataset, we must now find out the index // of the viewed sequence @@ -551,8 +551,7 @@ public class DBRefFetcher implements Runnable * @param warningMessages * a list of messages to add to */ - boolean transferReferences(Vector sdataset, - String dbSource, + boolean transferReferences(Vector sdataset, String dbSource, AlignmentI retrievedAl, boolean trimDatasetSeqs, List warningMessages) { @@ -573,8 +572,8 @@ public class DBRefFetcher implements Runnable // taking into account all accessionIds and names in the file Vector sequenceMatches = new Vector(); // look for corresponding accession ids - DBRefEntry[] entryRefs = DBRefUtils.selectRefs(retrievedSeq.getDBRefs(), - new String[] { dbSource }); + DBRefEntry[] entryRefs = DBRefUtils.selectRefs( + retrievedSeq.getDBRefs(), new String[] { dbSource }); if (entryRefs == null) { System.err @@ -684,8 +683,8 @@ public class DBRefFetcher implements Runnable */ mp = new Mapping(null, new int[] { sequenceStart + absStart, sequenceStart + absStart + entrySeq.length() - 1 }, new int[] - { retrievedSeq.getStart(), retrievedSeq.getStart() + entrySeq.length() - 1 }, - 1, 1); + { retrievedSeq.getStart(), + retrievedSeq.getStart() + entrySeq.length() - 1 }, 1, 1); updateRefFrame = false; } else @@ -725,7 +724,8 @@ public class DBRefFetcher implements Runnable } System.out.println("Adding dbrefs to " + sequence.getName() - + " from " + dbSource + " sequence : " + retrievedSeq.getName()); + + " from " + dbSource + " sequence : " + + retrievedSeq.getName()); sequence.transferAnnotation(retrievedSeq, mp); absStart += retrievedSeq.getStart(); diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java index 5f9b2d9..7e069e3 100644 --- a/src/jalview/ws/DasSequenceFeatureFetcher.java +++ b/src/jalview/ws/DasSequenceFeatureFetcher.java @@ -253,8 +253,7 @@ public class DasSequenceFeatureFetcher public void run() { running = true; - boolean isNucleotide = af.getViewport().getAlignment() - .isNucleotide(); + boolean isNucleotide = af.getViewport().getAlignment().isNucleotide(); new DBRefFetcher(sequences, af, null, af.featureSettings, isNucleotide).fetchDBRefs(true); @@ -287,8 +286,7 @@ public class DasSequenceFeatureFetcher { jalviewSourceI[] sources = sourceRegistry.getSources().toArray( new jalviewSourceI[0]); - String active = Cache.getDefault("DAS_ACTIVE_SOURCE", - "uniprot"); + String active = Cache.getDefault("DAS_ACTIVE_SOURCE", "uniprot"); StringTokenizer st = new StringTokenizer(active, "\t"); selectedSources = new Vector(); String token; @@ -644,8 +642,8 @@ public class DasSequenceFeatureFetcher { return null; } - DBRefEntry[] uprefs = DBRefUtils.selectRefs( - seq.getDBRefs(), new String[] { + DBRefEntry[] uprefs = DBRefUtils.selectRefs(seq.getDBRefs(), + new String[] { // jalview.datamodel.DBRefSource.PDB, DBRefSource.UNIPROT, // jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord @@ -666,8 +664,8 @@ public class DasSequenceFeatureFetcher for (COORDINATES csys : dasSource.getVersion().getCOORDINATES()) { - if (DBRefUtils.isDasCoordinateSystem( - csys.getAuthority(), uprefs[j])) + if (DBRefUtils.isDasCoordinateSystem(csys.getAuthority(), + uprefs[j])) { debug("Launched fetcher for coordinate system " + csys.getAuthority()); diff --git a/src/jalview/ws/dbsources/Pdb.java b/src/jalview/ws/dbsources/Pdb.java index a50ed14..11fe95e 100644 --- a/src/jalview/ws/dbsources/Pdb.java +++ b/src/jalview/ws/dbsources/Pdb.java @@ -1,4 +1,3 @@ - /* * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) * Copyright (C) $$Year-Rel$$ The Jalview Authors @@ -47,9 +46,10 @@ import com.stevesoft.pat.Regex; public class Pdb extends EbiFileRetrievedProxy { private static final String SEPARATOR = "|"; + private static final String COLON = ":"; - private static final int PDB_ID_LENGTH = 4; + private static final int PDB_ID_LENGTH = 4; public Pdb() { @@ -140,10 +140,10 @@ public class Pdb extends EbiFileRetrievedProxy String ext = StructureImportSettings.getDefaultStructureFileFormat() .equalsIgnoreCase(Type.MMCIF.toString()) ? ".cif" : ".xml"; EBIFetchClient ebi = new EBIFetchClient(); - file = ebi.fetchDataAsFile("pdb:" + id, - StructureImportSettings.getDefaultStructureFileFormat().toLowerCase(), - ext) - .getAbsolutePath(); + file = ebi.fetchDataAsFile( + "pdb:" + id, + StructureImportSettings.getDefaultStructureFileFormat() + .toLowerCase(), ext).getAbsolutePath(); stopQuery(); if (file == null) { @@ -177,8 +177,8 @@ public class Pdb extends EbiFileRetrievedProxy { // FIXME seems to result in 'PDB|1QIP|1qip|A' - 1QIP is redundant. // TODO: suggest simplify naming to 1qip|A as default name defined - pdbcs.setName(jalview.datamodel.DBRefSource.PDB + SEPARATOR + id - + SEPARATOR + pdbcs.getName()); + pdbcs.setName(jalview.datamodel.DBRefSource.PDB + SEPARATOR + + id + SEPARATOR + pdbcs.getName()); // Might need to add more metadata to the PDBEntry object // like below /* @@ -269,7 +269,6 @@ public class Pdb extends EbiFileRetrievedProxy return 0; } - /** * Returns a descriptor for suitable feature display settings with *
    diff --git a/src/jalview/ws/dbsources/Pfam.java b/src/jalview/ws/dbsources/Pfam.java index 4f081ee..9acaa96 100644 --- a/src/jalview/ws/dbsources/Pfam.java +++ b/src/jalview/ws/dbsources/Pfam.java @@ -123,10 +123,9 @@ abstract public class Pfam extends Xfam "STH"); for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++) { - rcds.getSequenceAt(s).addDBRef( -new DBRefEntry(DBRefSource.PFAM, - // getDbSource(), - getDbVersion(), queries.trim().toUpperCase())); + rcds.getSequenceAt(s).addDBRef(new DBRefEntry(DBRefSource.PFAM, + // getDbSource(), + getDbVersion(), queries.trim().toUpperCase())); if (!getDbSource().equals(DBRefSource.PFAM)) { // add the specific ref too rcds.getSequenceAt(s).addDBRef( diff --git a/src/jalview/ws/dbsources/PfamFull.java b/src/jalview/ws/dbsources/PfamFull.java index 62b9686..3c5373d 100644 --- a/src/jalview/ws/dbsources/PfamFull.java +++ b/src/jalview/ws/dbsources/PfamFull.java @@ -20,7 +20,6 @@ */ package jalview.ws.dbsources; - /** * flyweight class specifying retrieval of Full family alignments from PFAM * diff --git a/src/jalview/ws/dbsources/PfamSeed.java b/src/jalview/ws/dbsources/PfamSeed.java index 053953c..ba9d1e0 100644 --- a/src/jalview/ws/dbsources/PfamSeed.java +++ b/src/jalview/ws/dbsources/PfamSeed.java @@ -20,7 +20,6 @@ */ package jalview.ws.dbsources; - /** * flyweight class specifying retrieval of Seed alignments from PFAM * diff --git a/src/jalview/ws/dbsources/RfamFull.java b/src/jalview/ws/dbsources/RfamFull.java index 3053363..e6fc8ff 100644 --- a/src/jalview/ws/dbsources/RfamFull.java +++ b/src/jalview/ws/dbsources/RfamFull.java @@ -20,7 +20,6 @@ */ package jalview.ws.dbsources; - /** * Flyweight class specifying retrieval of Full family alignments from RFAM * diff --git a/src/jalview/ws/dbsources/RfamSeed.java b/src/jalview/ws/dbsources/RfamSeed.java index 77fb841..580ebe2 100644 --- a/src/jalview/ws/dbsources/RfamSeed.java +++ b/src/jalview/ws/dbsources/RfamSeed.java @@ -20,7 +20,6 @@ */ package jalview.ws.dbsources; - /** * Flyweight class specifying retrieval of Seed family alignments from RFAM * @@ -52,6 +51,7 @@ public class RfamSeed extends Rfam { return "/alignment"; } + /* * (non-Javadoc) * diff --git a/src/jalview/ws/dbsources/Uniprot.java b/src/jalview/ws/dbsources/Uniprot.java index 0c2af3b..4030d8c 100644 --- a/src/jalview/ws/dbsources/Uniprot.java +++ b/src/jalview/ws/dbsources/Uniprot.java @@ -193,7 +193,8 @@ public class Uniprot extends DbSourceProxyImpl * UniprotEntry * @return SequenceI instance created from the UniprotEntry instance */ - public SequenceI uniprotEntryToSequenceI(UniprotEntry entry){ + public SequenceI uniprotEntryToSequenceI(UniprotEntry entry) + { String id = getUniprotEntryId(entry); SequenceI sequence = new Sequence(id, entry.getUniprotSequence() .getContent()); diff --git a/src/jalview/ws/dbsources/Xfam.java b/src/jalview/ws/dbsources/Xfam.java index 508047d..6cc383d 100644 --- a/src/jalview/ws/dbsources/Xfam.java +++ b/src/jalview/ws/dbsources/Xfam.java @@ -56,8 +56,7 @@ public abstract class Xfam extends DbSourceProxyImpl // TODO: trap HTTP 404 exceptions and return null AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL() + queries.trim().toUpperCase() + getXFAMURLSUFFIX(), - jalview.io.FormatAdapter.URL, - "STH"); + jalview.io.FormatAdapter.URL, "STH"); for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++) { rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(), diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java index 3f6afbc..b184ff2 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java @@ -259,8 +259,8 @@ public class DasSourceRegistry implements DasSourceRegistryI, } /* - * - */ + * + */ @Override public jalviewSourceI createLocalSource(String url, String name, diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index 1dff32f..f6928c4 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -139,7 +139,8 @@ public class EBIFetchClient } // note: outFile is currently always specified, so return value is null - String[] rslt = fetchBatch(querystring.toString(), database, format, outFile); + String[] rslt = fetchBatch(querystring.toString(), database, format, + outFile); return (rslt != null && rslt.length > 0 ? rslt : null); } @@ -241,8 +242,7 @@ public class EBIFetchClient return null; } System.err.println("Unexpected exception when retrieving from " - + database - + "\nQuery was : '" + ids + "'"); + + database + "\nQuery was : '" + ids + "'"); ex.printStackTrace(System.err); return null; } finally diff --git a/src/jalview/ws/jws1/MsaWSThread.java b/src/jalview/ws/jws1/MsaWSThread.java index 3fd7c5a..e4247f7 100644 --- a/src/jalview/ws/jws1/MsaWSThread.java +++ b/src/jalview/ws/jws1/MsaWSThread.java @@ -670,8 +670,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI while (j < l) { - if (((AlignmentOrder) alorders.get(i)) - .equals((alorders.get(j)))) + if (((AlignmentOrder) alorders.get(i)).equals((alorders + .get(j)))) { alorders.remove(j); l--; diff --git a/src/jalview/ws/jws1/SeqSearchWSClient.java b/src/jalview/ws/jws1/SeqSearchWSClient.java index 2d83bf9..7665fec 100644 --- a/src/jalview/ws/jws1/SeqSearchWSClient.java +++ b/src/jalview/ws/jws1/SeqSearchWSClient.java @@ -172,8 +172,7 @@ public class SeqSearchWSClient extends WS1Client try { - this.server = loc.getSeqSearchService(new java.net.URL( - WsURL)); + this.server = loc.getSeqSearchService(new java.net.URL(WsURL)); ((SeqSearchServiceSoapBindingStub) this.server).setTimeout(60000); // One // minute // timeout diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java index 758d941..8fa118d 100644 --- a/src/jalview/ws/jws2/MsaWSClient.java +++ b/src/jalview/ws/jws2/MsaWSClient.java @@ -338,13 +338,14 @@ public class MsaWSClient extends Jws2Client } }); - String tooltip = JvSwingUtils.wrapTooltip( - true, + String tooltip = JvSwingUtils + .wrapTooltip( + true, "" - + (preset.isModifiable() ? MessageManager - .getString("label.user_preset") - : MessageManager - .getString("label.service_preset")) + + (preset.isModifiable() ? MessageManager + .getString("label.user_preset") + : MessageManager + .getString("label.service_preset")) + "
    " + preset.getDescription()); methodR.setToolTipText(tooltip); diff --git a/src/jalview/ws/seqfetcher/ASequenceFetcher.java b/src/jalview/ws/seqfetcher/ASequenceFetcher.java index 33a917e..31168b4 100644 --- a/src/jalview/ws/seqfetcher/ASequenceFetcher.java +++ b/src/jalview/ws/seqfetcher/ASequenceFetcher.java @@ -112,8 +112,7 @@ public class ASequenceFetcher return true; } } - Cache.log.warn("isFetchable doesn't know about '" + source - + "'"); + Cache.log.warn("isFetchable doesn't know about '" + source + "'"); return false; } diff --git a/src/jalview/ws/sifts/MappingOutputPojo.java b/src/jalview/ws/sifts/MappingOutputPojo.java index aa65f49..aba46a6 100644 --- a/src/jalview/ws/sifts/MappingOutputPojo.java +++ b/src/jalview/ws/sifts/MappingOutputPojo.java @@ -114,5 +114,4 @@ public class MappingOutputPojo this.type = type; } - } diff --git a/src/jalview/ws/sifts/SiftsClient.java b/src/jalview/ws/sifts/SiftsClient.java index f20954e..fb59071 100644 --- a/src/jalview/ws/sifts/SiftsClient.java +++ b/src/jalview/ws/sifts/SiftsClient.java @@ -149,7 +149,6 @@ public class SiftsClient implements SiftsClientI siftsEntry = parseSIFTs(siftsFile); } - /** * Parse the given SIFTs File and return a JAXB POJO of parsed data * @@ -276,21 +275,21 @@ public class SiftsClient implements SiftsClientI { siftsDownloadDir.mkdirs(); } - // System.out.println(">> Download ftp url : " + siftsFileFTPURL); - URL url = new URL(siftsFileFTPURL); - URLConnection conn = url.openConnection(); - InputStream inputStream = conn.getInputStream(); - FileOutputStream outputStream = new FileOutputStream( - downloadedSiftsFile); - byte[] buffer = new byte[BUFFER_SIZE]; - int bytesRead = -1; - while ((bytesRead = inputStream.read(buffer)) != -1) - { - outputStream.write(buffer, 0, bytesRead); - } - outputStream.close(); - inputStream.close(); - // System.out.println(">>> File downloaded : " + downloadedSiftsFile); + // System.out.println(">> Download ftp url : " + siftsFileFTPURL); + URL url = new URL(siftsFileFTPURL); + URLConnection conn = url.openConnection(); + InputStream inputStream = conn.getInputStream(); + FileOutputStream outputStream = new FileOutputStream( + downloadedSiftsFile); + byte[] buffer = new byte[BUFFER_SIZE]; + int bytesRead = -1; + while ((bytesRead = inputStream.read(buffer)) != -1) + { + outputStream.write(buffer, 0, bytesRead); + } + outputStream.close(); + inputStream.close(); + // System.out.println(">>> File downloaded : " + downloadedSiftsFile); return new File(downloadedSiftsFile); } @@ -611,6 +610,7 @@ public class SiftsClient implements SiftsClientI } } } + /** * * @param chainId @@ -762,8 +762,6 @@ public class SiftsClient implements SiftsClientI } } - - @Override public Entity getEntityById(String id) throws SiftsException {