import jalview.structure.StructureImportSettings;
import jalview.urls.IdOrgSettings;
import jalview.util.ColorUtils;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
-import jalview.ws.dbsources.das.datamodel.DasSourceRegistry;
import jalview.ws.sifts.SiftsSettings;
import java.awt.Color;
private final static String DEFAULT_PDB_FILE_PARSER = StructureImportSettings.StructureParser.JMOL_PARSER
.toString();
- private static String HMMER_PATH;
-
/*
* a date formatter using a fixed (rather than the user's) locale;
* this ensures that date properties can be written and re-read successfully
}
}
- /** Called when Jalview is started */
+ /**
+ * Loads properties from the given properties file. Any existing properties
+ * are first cleared.
+ */
public static void loadProperties(String propsFile)
{
propertiesFile = propsFile;
{
fis = new FileInputStream(propertiesFile);
}
+ applicationProperties.clear();
applicationProperties.load(fis);
// remove any old build properties
* @param obj
* String value of property
*
- * @return String value of property
+ * @return previous value of property (or null)
*/
- public static String setProperty(String key, String obj)
+ public static Object setProperty(String key, String obj)
{
-
+ Object oldValue = null;
try
{
- applicationProperties.setProperty(key, obj);
+ oldValue = applicationProperties.setProperty(key, obj);
if (!propsAreReadOnly)
{
FileOutputStream out = new FileOutputStream(propertiesFile);
System.out.println(
"Error setting property: " + key + " " + obj + "\n" + ex);
}
- return obj;
+ return oldValue;
}
/**
return null;
}
- private static DasSourceRegistryI sourceRegistry = null;
-
- /**
- * initialise and ..
- *
- * @return instance of the das source registry
- */
- public static DasSourceRegistryI getDasSourceRegistry()
- {
- if (sourceRegistry == null)
- {
- sourceRegistry = new DasSourceRegistry();
- }
- return sourceRegistry;
- }
-
/**
* Set the specified value, or remove it if null or empty. Does not save the
* properties file.