JPanel singleColour = new JPanel();
- private JPanel minColour = new JPanel();
+ JPanel minColour = new JPanel();
- private JPanel maxColour = new JPanel();
+ JPanel maxColour = new JPanel();
- private JComboBox<String> threshold = new JComboBox<>();
+ private JComboBox<Object> threshold = new JComboBox<>();
- private JSlider slider = new JSlider();
+ JSlider slider = new JSlider();
- private JTextField thresholdValue = new JTextField(20);
+ JTextField thresholdValue = new JTextField(20);
private JCheckBox thresholdIsMin = new JCheckBox();
/*
* Set Backups tab defaults
*/
-- loadLastSavedBackupsOptions();
++ if (!Platform.isJS())
++ {
++ loadLastSavedBackupsOptions();
++ }
+ }
+
+ /**
+ * A helper method that sets the items and initial selection in a character
+ * rendering option list (Prompt each time/Lineart/Text)
+ *
+ * @param comboBox
+ * @param propertyKey
+ */
+ protected void setupOutputCombo(JComboBox<Object> comboBox,
+ String propertyKey)
+ {
+ comboBox.addItem(promptEachTimeOpt);
+ comboBox.addItem(lineArtOpt);
+ comboBox.addItem(textOpt);
+
+ /*
+ * JalviewJS doesn't support Lineart so force it to Text
+ */
+ String defaultOption = Platform.isJS() ? "Text"
+ : Cache.getDefault(propertyKey, "Prompt each time");
+ if (defaultOption.equalsIgnoreCase("Text"))
+ {
+ comboBox.setSelectedItem(textOpt);
+ }
+ else if (defaultOption.equalsIgnoreCase("Lineart"))
+ {
+ comboBox.setSelectedItem(lineArtOpt);
+ }
+ else
+ {
+ comboBox.setSelectedItem(promptEachTimeOpt);
+ }
}
/**
import jalview.gui.StructureViewer.ViewerType;
import jalview.io.BackupFilenameParts;
import jalview.io.BackupFiles;
+ import jalview.io.BackupFilesPresetEntry;
+ import jalview.io.IntKeyStringValueEntry;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.BorderLayout;
import java.awt.Color;
tabbedPane.add(initConnectionsTab(),
MessageManager.getString("label.connections"));
- if (!Platform.isJS())
- {
- tabbedPane.add(initBackupsTab(),
- MessageManager.getString("label.backups"));
- }
- tabbedPane.add(initBackupsTab(),
- MessageManager.getString("label.backups"));
++ if (!Platform.isJS())
++ {
++ tabbedPane.add(initBackupsTab(),
++ MessageManager.getString("label.backups"));
++ }
tabbedPane.add(initLinksTab(),
MessageManager.getString("label.urllinks"));
protected void loadLastSavedBackupsOptions()
{
+ BackupFilesPresetEntry savedPreset = BackupFilesPresetEntry
+ .getSavedBackupEntry();
enableBackupFiles
- .setSelected(Cache.getDefault(BackupFiles.ENABLED, !Platform.isJS()));
- .setSelected(Cache.getDefault(BackupFiles.ENABLED, true));
++ .setSelected(Cache.getDefault(BackupFiles.ENABLED,
++ !Platform.isJS()));
+
+ BackupFilesPresetEntry backupfilesCustomEntry = BackupFilesPresetEntry
+ .createBackupFilesPresetEntry(Cache
+ .getDefault(BackupFilesPresetEntry.CUSTOMCONFIG, null));
+ if (backupfilesCustomEntry == null)
+ {
+ backupfilesCustomEntry = BackupFilesPresetEntry.backupfilesPresetEntriesValues
+ .get(BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT);
+ }
+ BackupFilesPresetEntry.backupfilesPresetEntriesValues.put(
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM,
+ backupfilesCustomEntry);
+
setComboIntStringKey(backupfilesPresetsCombo,
- Cache.getDefault(BackupFiles.NS + "_PRESET", 1));
- suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX,
- ".bak" + BackupFiles.NUM_PLACEHOLDER));
- suffixDigitsSpinner
- .setValue(Cache.getDefault(BackupFiles.SUFFIX_DIGITS, 3));
- suffixReverse.setSelected(
- Cache.getDefault(BackupFiles.REVERSE_ORDER, false));
- backupfilesKeepAll
- .setSelected(Cache.getDefault(BackupFiles.NO_MAX, false));
- backupfilesRollMaxSpinner
- .setValue(Cache.getDefault(BackupFiles.ROLL_MAX, 3));
- backupfilesConfirmDelete.setSelected(
- Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true));
+ Cache.getDefault(BackupFiles.NS + "_PRESET",
+ BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT));
+
+ backupsSetOptions(savedPreset);
backupsOptionsSetEnabled();
updateBackupFilesExampleLabel();