import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.datamodel.PDBEntry;
-import jalview.gui.UserDefinedColours;
+import jalview.gui.Preferences;
import jalview.schemes.ColourSchemeLoader;
import jalview.schemes.ColourSchemes;
import jalview.schemes.UserColourScheme;
import jalview.ws.sifts.SiftsSettings;
import java.awt.Color;
+import java.awt.Dimension;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
getDefault("sifts_cache_threshold_in_days",
DEFAULT_CACHE_THRESHOLD_IN_DAYS));
- IdOrgSettings.setUrl(getDefault("ID_ORG_HOSTURL",
+ IdOrgSettings.setUrl(getDefault(Preferences.ID_ORG_HOSTURL,
"http://www.jalview.org/services/identifiers"));
IdOrgSettings.setDownloadLocation(ID_ORG_FILE);
.println("Jalview Version: " + codeVersion + codeInstallation);
StructureImportSettings.setDefaultStructureFileFormat(jalview.bin.Cache
- .getDefault("PDB_DOWNLOAD_FORMAT", PDB_DOWNLOAD_FORMAT));
+ .getDefault(Preferences.PDB_DOWNLOAD_FORMAT, PDB_DOWNLOAD_FORMAT));
StructureImportSettings
.setDefaultPDBFileParser(DEFAULT_PDB_FILE_PARSER);
// StructureImportSettings
setProperty("VERSION", codeVersion);
// LOAD USERDEFINED COLOURS
- initUserColourSchemes(getProperty("USER_DEFINED_COLOURS"));
+ initUserColourSchemes(getProperty(Preferences.USER_DEFINED_COLOURS));
}
private void deleteBuildProperties()
}
/**
+ * retrieve a dimension, such as for Jmol
+ *
+ * @param property
+ * @param def
+ * @return
+ */
+ public static Dimension getDefaultDim(String property, Dimension def)
+ {
+ String s = getProperty(property);
+ if (s != null)
+ {
+ if (s.indexOf(',') < 0)
+ {
+ s = s.trim().replace(' ', ',');
+ if (s.indexOf(',') < 0)
+ {
+ s += "," + s;
+ }
+ }
+ try
+ {
+ int pt = s.indexOf(",");
+ return new Dimension(Integer.parseInt(s.substring(0, pt)),
+ Integer.parseInt(s.substring(pt + 1)));
+ } catch (NumberFormatException e)
+ {
+ System.out.println("Error parsing Dimension property '" + property
+ + "' with value '" + s + "'");
+ }
+ }
+ return def;
+ }
+
+ /**
* Answers the value of the given property, or the supplied default value if
* the property is not set
*/
{
if (coloursFound.toString().length() > 1)
{
- setProperty(UserDefinedColours.USER_DEFINED_COLOURS,
+ setProperty(Preferences.USER_DEFINED_COLOURS,
coloursFound.toString());
}
else
{
getInstance().applicationProperties
- .remove(UserDefinedColours.USER_DEFINED_COLOURS);
+ .remove(Preferences.USER_DEFINED_COLOURS);
}
}
}