X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fext%2Fedu%2Fucsf%2Frbvi%2Fstrucviz2%2FStructureManager.java;h=4797b374f609400e201b7cf67231b6e88ae6dcb9;hb=e8479b912a9f5caf2e86d2dee10f153955522e33;hp=ec956d701ae719580627ac8ef827d21a6cdefcf4;hpb=274eb184c92307edde158510463c335a5179a724;p=jalview.git diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java index ec956d7..4797b37 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java @@ -1,12 +1,14 @@ package ext.edu.ucsf.rbvi.strucviz2; +import jalview.bin.Cache; +import jalview.gui.Preferences; + import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; @@ -32,10 +34,6 @@ public class StructureManager static final String[] defaultResidueKeys = { "FunctionalResidues", "ResidueList", "Residues" }; - private final String chimeraPropertyName = "chimera"; - - private final String chimeraPathPropertyKey = "LastChimeraPath"; - public enum ModelType { PDB_MODEL, MODBASE_MODEL, SMILES @@ -494,7 +492,9 @@ public class StructureManager // we do not care about the model anymore selSpec = selSpec.concat(nodeInfo.toSpec()); if (i < chimSelectionList.size() - 1) + { selSpec.concat("|"); + } } if (selSpec.length() > 0) { @@ -665,7 +665,9 @@ public class StructureManager for (ChimeraStructuralObject cso : chimSelectionList) { if (cso != null) + { cso.setSelected(false); + } } chimSelectionList.clear(); } @@ -862,34 +864,35 @@ public class StructureManager StructureSettings defaultSettings = null; // TODO: [Optional] Change priority of Chimera paths - public List getChimeraPaths() + public static List getChimeraPaths() { List pathList = new ArrayList(); // if no network is available and the settings have been modified by the // user, check for a // path to chimera - if (defaultSettings != null) - { - String defaultPath = defaultSettings.getChimeraPath(); - if (defaultPath != null && !defaultPath.equals("")) - { - pathList.add(defaultPath); - return pathList; - } - } - - // if no network settings, check if the last chimera path is saved in the - // session - // String lastPath = CytoUtils.getDefaultChimeraPath(registrar, - // chimeraPropertyName, - // chimeraPathPropertyKey); - // if (lastPath != null && !lastPath.equals("")) { - // pathList.add(lastPath); + // + // For Jalview, Preferences/Cache plays this role instead + // if (defaultSettings != null) + // { + // String defaultPath = defaultSettings.getChimeraPath(); + // if (defaultPath != null && !defaultPath.equals("")) + // { + // pathList.add(defaultPath); // return pathList; // } + // } + + /* + * Jalview addition: check if path set in user preferences. + */ + String userPath = Cache.getDefault(Preferences.CHIMERA_PATH, null); + if (userPath != null) + { + pathList.add(0, userPath); + } - // if no user settings and no last path, get default system's settings + // Add default installation paths String os = System.getProperty("os.name"); if (os.startsWith("Linux")) {