X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBChain.java;h=904a8601f18865002dc0a43cc4870b80475fe1bb;hb=6d882bd2c72c5fe9e8d0a8eb9df4de7a86bbc773;hp=29b994e493108a5c96b05b74aaf4070fb989b59c;hpb=04a92acb1e484730552d42fdf2d356e04551c5ea;p=jalview.git diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index 29b994e..904a860 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -45,11 +45,11 @@ public class PDBChain public String id; - public Vector bonds = new Vector(); + public Vector bonds = new Vector<>(); - public Vector atoms = new Vector(); + public Vector atoms = new Vector<>(); - public Vector residues = new Vector(); + public Vector residues = new Vector<>(); public int offset; @@ -343,12 +343,13 @@ public class PDBChain boolean deoxyn = false; boolean nucleotide = false; StringBuilder seq = new StringBuilder(256); - Vector resFeatures = new Vector(); - Vector resAnnotation = new Vector(); - int i, iSize = atoms.size() - 1; + Vector resFeatures = new Vector<>(); + Vector resAnnotation = new Vector<>(); + int iSize = atoms.size() - 1; int resNumber = -1; char insCode = ' '; - for (i = 0; i <= iSize; i++) + + for (int i = 0; i <= iSize; i++) { Atom tmp = atoms.elementAt(i); resNumber = tmp.resNumber; @@ -362,7 +363,7 @@ public class PDBChain offset = resNumber; } - Vector resAtoms = new Vector(); + Vector resAtoms = new Vector<>(); // Add atoms to a vector while the residue number // remains the same as the first atom's resNumber (res) while ((resNumber == res) && (ins == insCode) && (i < atoms.size())) @@ -469,7 +470,8 @@ public class PDBChain if (StructureImportSettings.isShowSeqFeatures()) { - for (i = 0, iSize = resFeatures.size(); i < iSize; i++) + iSize = resFeatures.size(); + for (int i = 0; i < iSize; i++) { sequence.addSequenceFeature(resFeatures.elementAt(i)); resFeatures.setElementAt(null, i); @@ -478,20 +480,20 @@ public class PDBChain if (visibleChainAnnotation) { Annotation[] annots = new Annotation[resAnnotation.size()]; - float max = 0; - for (i = 0, iSize = annots.length; i < iSize; i++) + float max = 0f; + float min = 0f; + iSize = annots.length; + for (int i = 0; i < iSize; i++) { annots[i] = resAnnotation.elementAt(i); - if (annots[i].value > max) - { - max = annots[i].value; - } + max = Math.max(max, annots[i].value); + min = Math.min(min, annots[i].value); resAnnotation.setElementAt(null, i); } AlignmentAnnotation tfactorann = new AlignmentAnnotation( "Temperature Factor", "Temperature Factor for " + pdbid + id, - annots, 0, max, AlignmentAnnotation.LINE_GRAPH); + annots, min, max, AlignmentAnnotation.LINE_GRAPH); tfactorann.setSequenceRef(sequence); sequence.addAlignmentAnnotation(tfactorann); }