package jalview.structures.models;
import jalview.api.StructureSelectionManagerProvider;
+import jalview.api.structures.JalviewStructureDisplayI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import jalview.io.DataSourceType;
import jalview.structure.AtomSpec;
import jalview.structure.StructureListener;
import jalview.structure.StructureMapping;
/*
* datasource protocol for access to PDBEntrylatest
*/
- String protocol = null;
+ DataSourceType protocol = null;
protected boolean colourBySequence = true;
* @param protocol
*/
public AAStructureBindingModel(StructureSelectionManager ssm,
- PDBEntry[] pdbentry, SequenceI[][] sequenceIs, String[][] chains,
- String protocol)
+ PDBEntry[] pdbentry, SequenceI[][] sequenceIs,
+ DataSourceType protocol)
{
this.ssm = ssm;
this.sequence = sequenceIs;
this.nucleotide = Comparison.isNucleotide(sequenceIs);
- this.chains = chains;
this.pdbEntry = pdbentry;
this.protocol = protocol;
- if (chains == null)
- {
- this.chains = new String[pdbentry.length][];
- }
}
public StructureSelectionManager getSsm()
return chains;
}
- public String getProtocol()
+ public DataSourceType getProtocol()
{
return protocol;
}
// TODO: give a more informative title when multiple structures are
// displayed.
StringBuilder title = new StringBuilder(64);
- final PDBEntry pdbEntry = getPdbEntry(0);
+ final PDBEntry pdbe = getPdbEntry(0);
title.append(viewerName + " view for " + getSequence()[0][0].getName()
- + ":" + pdbEntry.getId());
+ + ":" + pdbe.getId());
if (verbose)
{
- if (pdbEntry.getProperty() != null)
+ String method = (String) pdbe.getProperty("method");
+ if (method != null)
{
- if (pdbEntry.getProperty().get("method") != null)
- {
- title.append(" Method: ");
- title.append(pdbEntry.getProperty().get("method"));
- }
- if (pdbEntry.getProperty().get("chains") != null)
- {
- title.append(" Chain:");
- title.append(pdbEntry.getProperty().get("chains"));
- }
+ title.append(" Method: ").append(method);
+ }
+ String chain = (String) pdbe.getProperty("chains");
+ if (chain != null)
+ {
+ title.append(" Chain:").append(chain);
}
}
return title.toString();
{
this.finishedInit = fi;
}
+
+ /**
+ * Returns a list of chains mapped in this viewer.
+ *
+ * @return
+ */
+ public abstract List<String> getChainNames();
+
+ /**
+ * Returns the Jalview panel hosting the structure viewer (if any)
+ *
+ * @return
+ */
+ public JalviewStructureDisplayI getViewer()
+ {
+ return null;
+ }
}