X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FAppletPDBCanvas.java;h=39111c3615ba511e49719f4a43e9101a4d380daf;hb=136c0793b90b72b928c4d77dc109dd5c644e00d3;hp=1a7e7f5b8e9fbe329f7e9ebe6ddc059e6b6374d8;hpb=ee198b3ca3687f18a2ee186f4e7c7330f4ea30f0;p=jalview.git diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index 1a7e7f5..39111c3 100644 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -28,6 +28,7 @@ import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; import jalview.io.DataSourceType; import jalview.io.StructureFile; +import jalview.renderer.seqfeatures.FeatureColourFinder; import jalview.structure.AtomSpec; import jalview.structure.StructureListener; import jalview.structure.StructureMapping; @@ -177,7 +178,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, colourBySequence(); - int max = -10; + float max = -10; int maxchain = -1; int pdbstart = 0; int pdbend = 0; @@ -190,8 +191,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"); @@ -200,8 +203,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) @@ -575,6 +578,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, showFeatures = true; } + FeatureColourFinder finder = new FeatureColourFinder(fr); + PDBChain chain; if (bysequence && pdb != null) { @@ -602,25 +607,16 @@ public class AppletPDBCanvas extends Panel implements MouseListener, if (pos > 0) { pos = sequence[s].findIndex(pos); - tmp.startCol = sr.getResidueBoxColour(sequence[s], pos); - if (showFeatures) - { - tmp.startCol = fr.findFeatureColour(tmp.startCol, - sequence[s], pos); - } + tmp.startCol = sr.getResidueColour(sequence[s], pos, + finder); } pos = mapping[m].getSeqPos(tmp.at2.resNumber) - 1; if (pos > 0) { pos = sequence[s].findIndex(pos); - tmp.endCol = sr.getResidueBoxColour(sequence[s], pos); - if (showFeatures) - { - tmp.endCol = fr.findFeatureColour(tmp.endCol, - sequence[s], pos); - } + tmp.endCol = sr + .getResidueColour(sequence[s], pos, finder); } - } } } @@ -1123,7 +1119,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, // //////////////////////////////// // /StructureListener @Override - public String[] getPdbFile() + public String[] getStructureFiles() { return new String[] { pdbentry.getFile() }; }