private static final String SPACE = " ";
- private static final String BACKSLASH = "\"";
+ private static final String QUOTE = "\"";
AppJmolBinding jmb;
{
progressBar = ap.alignFrame;
- openNewJmol(ap, new PDBEntry[] { pdbentry }, new SequenceI[][] { seq });
+ openNewJmol(ap, alignAddedStructures, new PDBEntry[] { pdbentry },
+ new SequenceI[][]
+ { seq });
}
- private void openNewJmol(AlignmentPanel ap, PDBEntry[] pdbentrys,
+ private void openNewJmol(AlignmentPanel ap, boolean alignAdded,
+ PDBEntry[] pdbentrys,
SequenceI[][] seqs)
{
progressBar = ap.alignFrame;
addAlignmentPanel(ap);
useAlignmentPanelForColourbyseq(ap);
- alignAddedStructures = true;
- useAlignmentPanelForSuperposition(ap);
+ alignAddedStructures = alignAdded;
+ useAlignmentPanelForSuperposition(ap);
jmb.setColourBySequence(true);
setSize(400, 400); // probably should be a configurable/dynamic default here
}
/**
- * create a new Jmol containing several structures superimposed using the
- * given alignPanel.
+ * create a new Jmol containing several structures optionally superimposed
+ * using the given alignPanel.
*
* @param ap
+ * @param alignAdded
+ * - true to superimpose
* @param pe
* @param seqs
*/
- public AppJmol(AlignmentPanel ap, PDBEntry[] pe, SequenceI[][] seqs)
+ public AppJmol(AlignmentPanel ap, boolean alignAdded, PDBEntry[] pe,
+ SequenceI[][] seqs)
{
- openNewJmol(ap, pe, seqs);
+ openNewJmol(ap, alignAdded, pe, seqs);
}
jmb.setFinishedInit(true);
}
- boolean allChainsSelected = false;
-
@Override
void showSelectedChains()
{
StringBuilder fileList = new StringBuilder();
for (String s : files)
{
- fileList.append(SPACE).append(BACKSLASH)
- .append(Platform.escapeString(s)).append(BACKSLASH);
+ fileList.append(SPACE).append(QUOTE)
+ .append(Platform.escapeBackslashes(s)).append(QUOTE);
}
String filesString = fileList.toString();
jmb.updateColours(ap);
}
// do superposition if asked to
- if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures)
+ if (alignAddedStructures)
{
alignAddedStructures();
}
}
}
});
- alignAddedStructures = false;
+
}
/**
String file = jmb.getPdbEntry(pi).getFile();
if (file == null)
{
+ // todo: extract block as method and pull up (also ChimeraViewFrame)
// retrieve the pdb and store it locally
AlignmentI pdbseq = null;
pdbid = jmb.getPdbEntry(pi).getId();
addingStructures = true; // already files loaded.
for (int c = 0; c < filesInViewer.length; c++)
{
- if (filesInViewer[c].equals(file))
+ if (Platform.pathEquals(filesInViewer[c], file))
{
file = null;
break;