import jalview.bin.Cache;
import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.BackupFiles;
import jalview.io.FileFormatI;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
public static final String USE_LEGACY_GAP = "USE_LEGACY_GAP";
- private static final int MIN_FONT_SIZE = 1;
-
- private static final int MAX_FONT_SIZE = 30;
+ public static final String GAP_COLOUR = "GAP_COLOUR";
- private static final Color OVERVIEW_DEFAULT_GAP = Color.lightGray;
+ public static final String HIDDEN_COLOUR = "HIDDEN_COLOUR";
- private static final Color OVERVIEW_DEFAULT_LEGACY_GAP = Color.white;
+ private static final int MIN_FONT_SIZE = 1;
- private static final Color OVERVIEW_DEFAULT_HIDDEN = Color.darkGray
- .darker();
+ private static final int MAX_FONT_SIZE = 30;
/**
* Holds name and link separated with | character. Sequence ID must be
JInternalFrame frame;
- DasSourceBrowser dasSource;
-
private WsPreferences wsPrefs;
private OptionsParam promptEachTimeOpt = new OptionsParam(
super();
frame = new JInternalFrame();
frame.setContentPane(this);
- dasSource = new DasSourceBrowser();
- dasTab.add(dasSource, BorderLayout.CENTER);
wsPrefs = new WsPreferences();
wsTab.add(wsPrefs, BorderLayout.CENTER);
int width = 500, height = 450;
* Set overview panel defaults
*/
gapColour.setBackground(
- Cache.getDefaultColour("GAP_COLOUR", OVERVIEW_DEFAULT_GAP));
+ Cache.getDefaultColour(GAP_COLOUR,
+ jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP));
hiddenColour.setBackground(
- Cache.getDefaultColour("HIDDEN_COLOUR",
- OVERVIEW_DEFAULT_HIDDEN));
- useLegacyGap.setSelected(Cache.getDefault("USE_LEGACY_GAP", false));
+ Cache.getDefaultColour(HIDDEN_COLOUR,
+ jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_HIDDEN));
+ useLegacyGap.setSelected(Cache.getDefault(USE_LEGACY_GAP, false));
gapLabel.setEnabled(!useLegacyGap.isSelected());
gapColour.setEnabled(!useLegacyGap.isSelected());
showHiddenAtStart
- .setSelected(Cache.getDefault("SHOW_OV_HIDDEN_AT_START", true));
+ .setSelected(Cache.getDefault(SHOW_OV_HIDDEN_AT_START, false));
/*
* Set Structure tab defaults.
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
userIdWidth.setEnabled(!autoIdWidth.isSelected());
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
- Integer wi = Cache.getIntegerProperty("FIGURE_USERIDWIDTH");
+ Integer wi = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH");
userIdWidth.setText(wi == null ? "" : wi.toString());
+ // TODO: refactor to use common enum via FormatAdapter and allow extension
+ // for new flat file formats
blcjv.setSelected(Cache.getDefault("BLC_JVSUFFIX", true));
clustaljv.setSelected(Cache.getDefault("CLUSTAL_JVSUFFIX", true));
fastajv.setSelected(Cache.getDefault("FASTA_JVSUFFIX", true));
annotations_actionPerformed(null); // update the display of the annotation
// settings
+
+
+ /*
+ * Set Backups tab defaults
+ */
+ loadLastSavedBackupsOptions();
}
/**
/*
* Save Overview settings
*/
- Cache.setColourProperty("GAP_COLOUR", gapColour.getBackground());
- Cache.setColourProperty("HIDDEN_COLOUR", hiddenColour.getBackground());
+ Cache.setColourProperty(GAP_COLOUR, gapColour.getBackground());
+ Cache.setColourProperty(HIDDEN_COLOUR, hiddenColour.getBackground());
Cache.applicationProperties.setProperty(USE_LEGACY_GAP,
Boolean.toString(useLegacyGap.isSelected()));
Cache.applicationProperties.setProperty(SHOW_OV_HIDDEN_AT_START,
Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
Boolean.toString(autoIdWidth.isSelected()));
userIdWidth_actionPerformed();
- Cache.applicationProperties.setProperty("FIGURE_USERIDWIDTH",
+ Cache.applicationProperties.setProperty("FIGURE_FIXEDIDWIDTH",
userIdWidth.getText());
/*
Cache.applicationProperties.setProperty("PAD_GAPS",
Boolean.toString(padGaps.isSelected()));
- dasSource.saveProperties(Cache.applicationProperties);
wsPrefs.updateAndRefreshWsMenuConfig(false);
+
+ /*
+ * Save Backups settings
+ */
+ Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
+ Boolean.toString(backupfilesConfirmDelete.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+ Boolean.toString(enableBackupFiles.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.NO_MAX,
+ Boolean.toString(backupfilesKeepAll.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.REVERSE_ORDER,
+ Boolean.toString(suffixReverse.isSelected()));
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX,
+ suffixTemplate.getText());
+ Cache.applicationProperties.setProperty(BackupFiles.ROLL_MAX,
+ Integer.toString(getSpinnerInt(backupfilesRollMaxSpinner, 4)));
+ Cache.applicationProperties.setProperty(BackupFiles.SUFFIX_DIGITS,
+ Integer.toString(getSpinnerInt(suffixDigitsSpinner, 3)));
+ Cache.applicationProperties.setProperty(BackupFiles.NS+"_PRESET",
+ Integer.toString(getComboIntStringKey(backupfilesPresetsCombo)));
+
Cache.saveProperties();
Desktop.instance.doConfigureStructurePrefs();
try
boolean enabled = useLegacyGap.isSelected();
if (enabled)
{
- gapColour.setBackground(OVERVIEW_DEFAULT_LEGACY_GAP);
+ gapColour.setBackground(
+ jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_LEGACY_GAP);
}
else
{
- gapColour.setBackground(OVERVIEW_DEFAULT_GAP);
+ gapColour.setBackground(
+ jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP);
}
gapColour.setEnabled(!enabled);
gapLabel.setEnabled(!enabled);
{
useLegacyGap.setSelected(false);
useLegacyGaps_actionPerformed(null);
- showHiddenAtStart.setSelected(true);
- hiddenColour.setBackground(OVERVIEW_DEFAULT_HIDDEN);
+ showHiddenAtStart.setSelected(false);
+ hiddenColour.setBackground(
+ jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_HIDDEN);
}
@Override