X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAppJmol.java;h=ea7fb6b22bfc22e508e6e9477a51c254fcc71bc7;hb=682ebcd21b2123786463a3f56cc6f7c17f361bae;hp=29f02d6c68bd16bacdd1fa9c24462c0ad6782ce7;hpb=0ca159283d6fdd7b76b033421393209ee8c0c8a8;p=jalview.git diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 29f02d6..ea7fb6b 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -57,7 +57,7 @@ public class AppJmol extends StructureViewerBase private static final String SPACE = " "; - private static final String BACKSLASH = "\""; + private static final String QUOTE = "\""; AppJmolBinding jmb; @@ -175,10 +175,13 @@ public class AppJmol extends StructureViewerBase { 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; @@ -187,8 +190,8 @@ public class AppJmol extends StructureViewerBase 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 @@ -210,16 +213,19 @@ public class AppJmol extends StructureViewerBase } /** - * 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); } @@ -253,8 +259,6 @@ public class AppJmol extends StructureViewerBase jmb.setFinishedInit(true); } - boolean allChainsSelected = false; - @Override void showSelectedChains() { @@ -321,8 +325,8 @@ public class AppJmol extends StructureViewerBase 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(); @@ -397,7 +401,7 @@ public class AppJmol extends StructureViewerBase jmb.updateColours(ap); } // do superposition if asked to - if (Cache.getDefault("AUTOSUPERIMPOSE", true) && alignAddedStructures) + if (alignAddedStructures) { alignAddedStructures(); } @@ -431,7 +435,7 @@ public class AppJmol extends StructureViewerBase } } }); - alignAddedStructures = false; + } /** @@ -460,6 +464,7 @@ public class AppJmol extends StructureViewerBase 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(); @@ -510,7 +515,7 @@ public class AppJmol extends StructureViewerBase 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;