git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2694 StructureSelectionManager.getMapping takes a list of Chain IDs per sequence...
[jalview.git]
/
src
/
MCview
/
AppletPDBCanvas.java
diff --git
a/src/MCview/AppletPDBCanvas.java
b/src/MCview/AppletPDBCanvas.java
index
61ac94c
..
7b03d7c
100644
(file)
--- a/
src/MCview/AppletPDBCanvas.java
+++ b/
src/MCview/AppletPDBCanvas.java
@@
-1,6
+1,6
@@
/*
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*
* This file is part of Jalview.
*
@@
-26,7
+26,9
@@
import jalview.appletgui.FeatureRenderer;
import jalview.appletgui.SequenceRenderer;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.appletgui.SequenceRenderer;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
import jalview.io.StructureFile;
import jalview.io.StructureFile;
+import jalview.renderer.seqfeatures.FeatureColourFinder;
import jalview.structure.AtomSpec;
import jalview.structure.StructureListener;
import jalview.structure.StructureMapping;
import jalview.structure.AtomSpec;
import jalview.structure.StructureListener;
import jalview.structure.StructureMapping;
@@
-50,8
+52,8
@@
import java.io.PrintStream;
import java.util.List;
import java.util.Vector;
import java.util.List;
import java.util.Vector;
-public class AppletPDBCanvas extends Panel implements MouseListener,
- MouseMotionListener, StructureListener
+public class AppletPDBCanvas extends Panel
+ implements MouseListener, MouseMotionListener, StructureListener
{
MCMatrix idmat = new MCMatrix(3, 3);
{
MCMatrix idmat = new MCMatrix(3, 3);
@@
-145,7
+147,7
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
StructureSelectionManager ssm;
public AppletPDBCanvas(PDBEntry pdbentry, SequenceI[] seq,
StructureSelectionManager ssm;
public AppletPDBCanvas(PDBEntry pdbentry, SequenceI[] seq,
- String[] chains, AlignmentPanel ap, String protocol)
+ String[] chains, AlignmentPanel ap, DataSourceType protocol)
{
this.ap = ap;
{
this.ap = ap;
@@
-157,9
+159,11
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
try
{
try
{
- pdb = ssm.setMapping(seq, chains, pdbentry.getFile(), protocol);
+ pdb = ssm.setMapping(seq,
+ StructureSelectionManager.perChainList(chains),
+ pdbentry.getFile(), protocol);
- if (protocol.equals(jalview.io.AppletFormatAdapter.PASTE))
+ if (protocol == DataSourceType.PASTE)
{
pdbentry.setFile("INLINE" + pdb.getId());
}
{
pdbentry.setFile("INLINE" + pdb.getId());
}
@@
-176,7
+180,7
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
colourBySequence();
colourBySequence();
- int max = -10;
+ float max = -10;
int maxchain = -1;
int pdbstart = 0;
int pdbend = 0;
int maxchain = -1;
int pdbstart = 0;
int pdbend = 0;
@@
-189,10
+193,9
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
for (int i = 0; i < pdb.getChains().size(); i++)
{
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");
mappingDetails.append("\nNo of residues = "
+ pdb.getChains().elementAt(i).residues.size() + "\n\n");
@@
-201,8
+204,9
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
// Align the sequence to the pdb
// TODO: DNa/Pep switch
AlignSeq as = new AlignSeq(sequence,
// 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)
as.calcScoreMatrix();
as.traceAlignment();
PrintStream ps = new PrintStream(System.out)
@@
-486,9
+490,8
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.black);
g.setFont(new Font("Verdana", Font.BOLD, 14));
g.fillRect(0, 0, getSize().width, getSize().height);
g.setColor(Color.black);
g.setFont(new Font("Verdana", Font.BOLD, 14));
- g.drawString(
- MessageManager.getString("label.error_loading_pdb_data"), 50,
- getSize().height / 2);
+ g.drawString(MessageManager.getString("label.error_loading_pdb_data"),
+ 50, getSize().height / 2);
return;
}
return;
}
@@
-576,6
+579,8
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
showFeatures = true;
}
showFeatures = true;
}
+ FeatureColourFinder finder = new FeatureColourFinder(fr);
+
PDBChain chain;
if (bysequence && pdb != null)
{
PDBChain chain;
if (bysequence && pdb != null)
{
@@
-603,25
+608,16
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
if (pos > 0)
{
pos = sequence[s].findIndex(pos);
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);
}
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);
}
}
-
}
}
}
}
}
}
@@
-649,11
+645,15
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
{
tmpBond = visiblebonds.elementAt(i);
{
tmpBond = visiblebonds.elementAt(i);
- xstart = (int) (((tmpBond.start[0] - centre[0]) * scale) + (getSize().width / 2));
- ystart = (int) (((centre[1] - tmpBond.start[1]) * scale) + (getSize().height / 2));
+ xstart = (int) (((tmpBond.start[0] - centre[0]) * scale)
+ + (getSize().width / 2));
+ ystart = (int) (((centre[1] - tmpBond.start[1]) * scale)
+ + (getSize().height / 2));
- xend = (int) (((tmpBond.end[0] - centre[0]) * scale) + (getSize().width / 2));
- yend = (int) (((centre[1] - tmpBond.end[1]) * scale) + (getSize().height / 2));
+ xend = (int) (((tmpBond.end[0] - centre[0]) * scale)
+ + (getSize().width / 2));
+ yend = (int) (((centre[1] - tmpBond.end[1]) * scale)
+ + (getSize().height / 2));
xmid = (xend + xstart) / 2;
ymid = (yend + ystart) / 2;
xmid = (xend + xstart) / 2;
ymid = (yend + ystart) / 2;
@@
-970,8
+970,10
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
if (n == 1)
{
if (n == 1)
{
- int xstart = (int) (((b.start[0] - centre[0]) * scale) + (getSize().width / 2));
- int ystart = (int) (((centre[1] - b.start[1]) * scale) + (getSize().height / 2));
+ int xstart = (int) (((b.start[0] - centre[0]) * scale)
+ + (getSize().width / 2));
+ int ystart = (int) (((centre[1] - b.start[1]) * scale)
+ + (getSize().height / 2));
g.setColor(Color.red);
g.drawString(b.at1.resName + "-" + b.at1.resNumber, xstart, ystart);
g.setColor(Color.red);
g.drawString(b.at1.resName + "-" + b.at1.resNumber, xstart, ystart);
@@
-979,8
+981,10
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
if (n == 2)
{
if (n == 2)
{
- int xstart = (int) (((b.end[0] - centre[0]) * scale) + (getSize().width / 2));
- int ystart = (int) (((centre[1] - b.end[1]) * scale) + (getSize().height / 2));
+ int xstart = (int) (((b.end[0] - centre[0]) * scale)
+ + (getSize().width / 2));
+ int ystart = (int) (((centre[1] - b.end[1]) * scale)
+ + (getSize().height / 2));
g.setColor(Color.red);
g.drawString(b.at2.resName + "-" + b.at2.resNumber, xstart, ystart);
g.setColor(Color.red);
g.drawString(b.at2.resName + "-" + b.at2.resNumber, xstart, ystart);
@@
-1009,11
+1013,13
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
{
tmpBond = bonds.elementAt(i);
{
tmpBond = bonds.elementAt(i);
- truex = (int) (((tmpBond.start[0] - centre[0]) * scale) + (getSize().width / 2));
+ truex = (int) (((tmpBond.start[0] - centre[0]) * scale)
+ + (getSize().width / 2));
if (Math.abs(truex - x) <= 2)
{
if (Math.abs(truex - x) <= 2)
{
- int truey = (int) (((centre[1] - tmpBond.start[1]) * scale) + (getSize().height / 2));
+ int truey = (int) (((centre[1] - tmpBond.start[1]) * scale)
+ + (getSize().height / 2));
if (Math.abs(truey - y) <= 2)
{
if (Math.abs(truey - y) <= 2)
{
@@
-1026,11
+1032,13
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
// Still here? Maybe its the last bond
// Still here? Maybe its the last bond
- truex = (int) (((tmpBond.end[0] - centre[0]) * scale) + (getSize().width / 2));
+ truex = (int) (((tmpBond.end[0] - centre[0]) * scale)
+ + (getSize().width / 2));
if (Math.abs(truex - x) <= 2)
{
if (Math.abs(truex - x) <= 2)
{
- int truey = (int) (((tmpBond.end[1] - centre[1]) * scale) + (getSize().height / 2));
+ int truey = (int) (((tmpBond.end[1] - centre[1]) * scale)
+ + (getSize().height / 2));
if (Math.abs(truey - y) <= 2)
{
if (Math.abs(truey - y) <= 2)
{
@@
-1124,7
+1132,7
@@
public class AppletPDBCanvas extends Panel implements MouseListener,
// ////////////////////////////////
// /StructureListener
@Override
// ////////////////////////////////
// /StructureListener
@Override
- public String[] getPdbFile()
+ public String[] getStructureFiles()
{
return new String[] { pdbentry.getFile() };
}
{
return new String[] { pdbentry.getFile() };
}