{
if (frames[f] instanceof AppJmol)
{
- // TODO: revise schema to allow many:one PDB id binding to viewer
jmol = (AppJmol) frames[f];
for (int peid = 0; peid < jmol.jmb.pdbentry.length; peid++)
{
state.setWidth(jmol.getWidth());
state.setHeight(jmol.getHeight());
state.setViewId(jmol.getViewId());
+ state.setAlignwithAlignPanel(jmol.isUsedforaligment(ap));
+ state.setColourwithAlignPanel(jmol
+ .isUsedforcolourby(ap));
if (!jmolViewIds.contains(state.getViewId()))
{
// Make sure we only store a Jmol state once in each XML
if (!jmolViewIds.containsKey(sviewid))
{
jmolViewIds.put(sviewid, new Object[]
- { new int[]
- { x, y, width, height }, "",
- new Hashtable<String, Object[]>() });
+ {
+ new int[]
+ { x, y, width, height },
+ "",
+ new Hashtable<String, Object[]>(),
+ new boolean[]
+ {
+ false,false} });
+ // Legacy->2.7 conversion: if there is no attribute for
+ // colouring with the alignPanel then by default we set the
+ // first encountered view to be the default source of colour
+ // information.
}
// TODO: assemble String[] { pdb files }, String[] { id for each
// file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
- // seqs_file 2}} from hash
+ // seqs_file 2}, boolean[] {
+ // linkAlignPanel,superposeWithAlignpanel}} from hash
Object[] jmoldat = (Object[]) jmolViewIds.get(sviewid);
+ ((boolean[]) jmoldat[3])[0] |= ids[p].getStructureState(s)
+ .hasAlignwithAlignPanel() ? ids[p].getStructureState(
+ s).getAlignwithAlignPanel() : false;
+ // always colour by linked panel if not specified
+ ((boolean[]) jmoldat[3])[1] |= ids[p].getStructureState(s)
+ .hasColourwithAlignPanel() ? ids[p]
+ .getStructureState(s).getColourwithAlignPanel()
+ : false;
+
if (((String) jmoldat[1]).length() < ids[p]
.getStructureState(s).getContent().length())
{
int[] geom = (int[]) svattrib[0];
String state = (String) svattrib[1];
Hashtable<String, Object[]> oldFiles = (Hashtable<String, Object[]>) svattrib[2];
-
+ final boolean useinJmolsuperpos = ((boolean[]) svattrib[3])[0], usetoColourbyseq = ((boolean[]) svattrib[3])[1];
int x = geom[0], y = geom[1], width = geom[2], height = geom[3];
// collate the pdbfile -> sequence mappings from this view
Vector<String> pdbfilenames = new Vector<String>();
try
{
sview = new AppJmol(pdbf, id, sq, alf.alignPanel,
+ useinJmolsuperpos, usetoColourbyseq,
fileloc,
-
rect, vid);
} catch (OutOfMemoryError ex)
{
jalview.io.AppletFormatAdapter.FILE);
((AppJmol) comp).jmb.addSequenceForStructFile(pdbFile, seq);
}
+ // and add the AlignmentPanel's reference to the Jmol view
+ ((AppJmol) comp).addAlignmentPanel(ap);
+ if (useinJmolsuperpos)
+ {
+ ((AppJmol) comp).useAlignmentPanelForSuperposition(ap);
+ }
+ else
+ {
+ ((AppJmol) comp).excludeAlignmentPanelForSuperposition(ap);
+ }
+ if (usetoColourbyseq)
+ {
+ ((AppJmol) comp).useAlignmentPanelForColourbyseq(ap);
+ }
+ else
+ {
+ ((AppJmol) comp).excludeAlignmentPanelForColourbyseq(ap);
+ }
}
}
}