JAL-3141 re-order deletion of old files and check lastModified times with their repla...
[jalview.git] / src / jalview / jbgui / GPreferences.java
index dedcd10..c9e3629 100755 (executable)
@@ -536,9 +536,6 @@ public class GPreferences extends JPanel
     embbedBioJSON.setText(MessageManager.getString("label.embbed_biojson"));
     embbedBioJSON.setBounds(new Rectangle(228, 200, 250, 23));
 
-    TitledBorder backupFilesBorder = new TitledBorder(
-            MessageManager.getString("label.backup_files"));
-
     jPanel11.add(jLabel1);
     jPanel11.add(blcjv);
     jPanel11.add(clustaljv);
@@ -1766,7 +1763,6 @@ public class GPreferences extends JPanel
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean selected = enableBackupFiles.isSelected();
         // enable other options only when the first is checked
         backupsOptionsSetEnabled();
       }
@@ -1824,8 +1820,9 @@ public class GPreferences extends JPanel
     return backupsTab;
   }
 
-  private final int BACKUPFILESSCHEMECUSTOMISE = 0;
-  private final IntKeyStringValueEntry[] backupfilesPresetEntries = {
+  protected static final int BACKUPFILESSCHEMECUSTOMISE = 0;
+
+  private static final IntKeyStringValueEntry[] backupfilesPresetEntries = {
       new IntKeyStringValueEntry(1,
               MessageManager.getString("label.default")),
       new IntKeyStringValueEntry(2,
@@ -1835,14 +1832,17 @@ public class GPreferences extends JPanel
       new IntKeyStringValueEntry(4,
               MessageManager.getString("label.rolled_backups")),
       // ...
-      // new IntKeyStringValueEntry(255,
-      // MessageManager.getString("label.previously_saved_scheme")),
       // IMPORTANT, keep "Custom" entry with key 0 (even though it appears last)
       new IntKeyStringValueEntry(BACKUPFILESSCHEMECUSTOMISE,
               MessageManager.getString("label.customise")) };
 
-  private final Map<Integer, BackupFilesPresetEntry> backupfilesPresetEntriesValues = new HashMap<Integer, BackupFilesPresetEntry>()
+  private static final Map<Integer, BackupFilesPresetEntry> backupfilesPresetEntriesValues = new HashMap<Integer, BackupFilesPresetEntry>()
   {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 125L;
+
     {
       put(1, new BackupFilesPresetEntry(
               ".bak" + BackupFiles.NUM_PLACEHOLDER, 3, false, false, 3,
@@ -1972,7 +1972,7 @@ public class GPreferences extends JPanel
     updateBackupFilesExampleLabel();
   }
 
-  protected int getComboIntStringKey(JComboBox c)
+  protected int getComboIntStringKey(JComboBox<IntKeyStringValueEntry> c)
   {
     IntKeyStringValueEntry e = (IntKeyStringValueEntry) c.getSelectedItem();
     return e != null ? e.getKey() : 0;
@@ -1984,8 +1984,6 @@ public class GPreferences extends JPanel
     for (int i = 0; i < c.getItemCount(); i++)
     {
       IntKeyStringValueEntry e = c.getItemAt(i);
-      int k = e.getKey();
-      String v = e.getValue();
       if (e.getKey() == key)
       {
         c.setSelectedIndex(i);
@@ -2170,7 +2168,6 @@ public class GPreferences extends JPanel
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean selected = backupfilesKeepAll.isSelected();
         keepRollMaxOptionsEnabled();
         updateBackupFilesExampleLabel();
       }
@@ -2774,18 +2771,20 @@ class BackupFilesPresetEntry
 
 class BackupFilesPresetsComboBoxRenderer extends DefaultListCellRenderer
 {
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 88L;
+
   @Override
-  public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+  public Component getListCellRendererComponent(JList list, Object value,
+          int index, boolean isSelected, boolean cellHasFocus)
+  {
     super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
     
     try {
       IntKeyStringValueEntry e = (IntKeyStringValueEntry) value;
-      if (e.getKey() == 255)
-      {
-        // "Previously saved scheme" item
-        this.setFont(this.getFont().deriveFont(Font.ITALIC));
-      }
-      else if (e.getKey() == 0)
+      if (e.getKey() == GPreferences.BACKUPFILESSCHEMECUSTOMISE)
       {
         // "Customise" item
         this.setFont(this.getFont().deriveFont(Font.BOLD));