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;
setProperty("VERSION", codeVersion);
// LOAD USERDEFINED COLOURS
- initUserColourSchemes(getProperty("USER_DEFINED_COLOURS"));
+ initUserColourSchemes(getProperty(Preferences.USER_DEFINED_COLOURS));
}
private void deleteBuildProperties()
{
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);
}
}
}
}
else
{
- if (Cache.getProperty("NOQUESTIONNAIRES") == null)
+ if (Cache.getProperty(Preferences.NOQUESTIONNAIRES) == null)
{
// Start the desktop questionnaire prompter with the specified
// questionnaire
static void updatePreferences()
{
StringBuilder coloursFound = new StringBuilder();
- String[] files = Cache.getProperty("USER_DEFINED_COLOURS").split("\\|");
+ String[] files = Cache.getProperty(Preferences.USER_DEFINED_COLOURS).split("\\|");
/*
* the property does not include the scheme name, it is in the file;
if (coloursFound.toString().length() > 1)
{
- Cache.setProperty("USER_DEFINED_COLOURS", coloursFound.toString());
+ Cache.setProperty(Preferences.USER_DEFINED_COLOURS, coloursFound.toString());
}
else
{
- Cache.removePropertyNoSave("USER_DEFINED_COLOURS");
+ Cache.removePropertyNoSave(Preferences.USER_DEFINED_COLOURS);
}
}
}
@SuppressWarnings("serial")
public class Preferences extends GPreferences
{
+
+ public static final String NOQUESTIONNAIRES = "NOQUESTIONNAIRES";
+
+ public static final String QUESTIONNAIRE = "QUESTIONNAIRE";
+
public static final String ANNOTATIONCOLOUR_MAX = "ANNOTATIONCOLOUR_MAX";
public static final String ANNOTATIONCOLOUR_MIN = "ANNOTATIONCOLOUR_MIN";
public static final String SHOW_OV_HIDDEN_AT_START = "SHOW_OV_HIDDEN_AT_START";
+ public static final String USER_DEFINED_COLOURS = "USER_DEFINED_COLOURS";
+
public static final String USE_LEGACY_GAP = "USE_LEGACY_GAP";
public static final String GAP_COLOUR = "GAP_COLOUR";
public static final List<String> groupURLLinks; // not implemented
+
static
{
// get links selected to be in the menu (SEQUENCE_LINKS)
usagestats.setSelected(Cache.getDefault("USAGESTATS", false));
// note antisense here: default is true
questionnaire
- .setSelected(Cache.getProperty("NOQUESTIONNAIRES") == null);
+ .setSelected(Cache.getProperty(NOQUESTIONNAIRES) == null);
versioncheck.setSelected(Cache.getDefault("VERSION_CHECK", true));
/*
}
if (!questionnaire.isSelected())
{
- Cache.setProperty("NOQUESTIONNAIRES", "true");
+ Cache.setProperty(NOQUESTIONNAIRES, "true");
}
else
{
// special - made easy to edit a property file to disable questionnaires
// by just adding the given line
- Cache.removeProperty("NOQUESTIONNAIRES");
+ Cache.removeProperty(NOQUESTIONNAIRES);
}
/*
private static final Font VERDANA_BOLD_10 = new Font("Verdana", Font.BOLD,
10);
- public static final String USER_DEFINED_COLOURS = "USER_DEFINED_COLOURS";
-
private static final String LAST_DIRECTORY = "LAST_DIRECTORY";
private static final int MY_FRAME_HEIGHT = 440;
/**
* Loads the user-defined colour scheme from the first file listed in property
- * "USER_DEFINED_COLOURS". If this fails, returns an all-white colour scheme.
+ * Preferences.USER_DEFINED_COLOURS. If this fails, returns an all-white colour scheme.
*
* @return
*/
{
UserColourScheme ret = null;
- String colours = Cache.getProperty(USER_DEFINED_COLOURS);
+ String colours = Cache.getProperty(Preferences.USER_DEFINED_COLOURS);
if (colours != null)
{
if (colours.indexOf("|") > -1)
* update the delimited list of user defined colour files in
* Jalview property USER_DEFINED_COLOURS
*/
- String defaultColours = Cache.getDefault(USER_DEFINED_COLOURS,
+ String defaultColours = Cache.getDefault(
+ Preferences.USER_DEFINED_COLOURS,
filePath);
if (defaultColours.indexOf(filePath) == -1)
{
}
defaultColours = defaultColours.concat(filePath);
}
- Cache.setProperty(USER_DEFINED_COLOURS, defaultColours);
+ Cache.setProperty(Preferences.USER_DEFINED_COLOURS, defaultColours);
/*
* construct and register the colour scheme
try
{
// First - check to see if wee have an old questionnaire/response id pair.
- String lastq = jalview.bin.Cache.getProperty("QUESTIONNAIRE");
+ String lastq = jalview.bin.Cache.getProperty(Preferences.QUESTIONNAIRE);
if (lastq == null)
{
prompt = checkresponse(new URL(url
if (qid != null && rid != null)
{
// Update our local property cache with latest qid and rid
- jalview.bin.Cache.setProperty("QUESTIONNAIRE", qid + ":" + rid);
+ jalview.bin.Cache.setProperty(Preferences.QUESTIONNAIRE, qid + ":" + rid);
}
if (prompt)
{
* if (value == JalviewFileChooser.APPROVE_OPTION) { File choice =
* chooser.getSelectedFile(); jalview.bin.Cache.setProperty("LAST_DIRECTORY",
* choice.getParent()); String defaultColours = jalview.bin.Cache.getDefault(
- * "USER_DEFINED_COLOURS", choice.getPath()); if
+ * Preferences.USER_DEFINED_COLOURS, choice.getPath()); if
* (defaultColours.indexOf(choice.getPath()) == -1) { defaultColours =
* defaultColours.concat("|") .concat(choice.getPath()); } (non-Javadoc)
*