/*
* choice of what to colour by text (Label or attribute)
*/
- private JComboBox<String> colourByTextCombo;
+ private JComboBox<Object> colourByTextCombo;
/*
* choice of what to colour by range (Score or attribute)
*/
- private JComboBox<String> colourByRangeCombo;
+ private JComboBox<Object> colourByRangeCombo;
private JRadioButton andFilters;
* @param withRange
* @param withText
*/
- protected JComboBox<String> populateAttributesDropdown(
+ protected JComboBox<Object> populateAttributesDropdown(
List<String[]> attNames, boolean withRange, boolean withText)
{
- List<String> displayAtts = new ArrayList<>();
+ List<Object> displayAtts = new ArrayList<>();
List<String> tooltips = new ArrayList<>();
if (withText)
tooltips.add(desc == null ? "" : desc);
}
- JComboBox<String> attCombo = JvSwingUtils
+ JComboBox<Object> attCombo = JvSwingUtils
.buildComboWithTooltips(displayAtts, tooltips);
return attCombo;
* drop-down choice of attribute, with description as a tooltip
* if we can obtain it
*/
- JComboBox<String> attCombo = populateAttributesDropdown(attNames, true,
+ JComboBox<Object> attCombo = populateAttributesDropdown(attNames, true,
true);
String filterBy = setSelectedAttribute(attCombo, filter);
* @param attCombo
* @param filter
*/
- private String setSelectedAttribute(JComboBox<String> attCombo,
+ private String setSelectedAttribute(JComboBox<Object> attCombo,
FeatureMatcherI filter)
{
String item = null;
* @param valueField
* @param filterIndex
*/
- protected boolean updateFilter(JComboBox<String> attCombo,
+ protected boolean updateFilter(JComboBox<Object> attCombo,
JComboBox<Condition> condCombo, JTextField valueField,
int filterIndex)
{
}
private static boolean actuallyDeleteTmpFiles = true;
- private static String testDir = "examples";
+
+ private static String testDir = "test/jalview/io";
private static String testBasename = "backupfilestest";
private static String suffix = "_BACKUPTEST-%n";
- private static int digits = 8;
+ private static int digits = 6;
private static int rollMax = 2;
}
// check 10 backup files
- HashMap correctindexmap = new HashMap();
- correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-00000001");
- correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
- correctindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-00000003");
- correctindexmap.put(4, "backupfilestestTemp.fa_BACKUPTEST-00000004");
- correctindexmap.put(5, "backupfilestestTemp.fa_BACKUPTEST-00000005");
- correctindexmap.put(6, "backupfilestestTemp.fa_BACKUPTEST-00000006");
- correctindexmap.put(7, "backupfilestestTemp.fa_BACKUPTEST-00000007");
- correctindexmap.put(8, "backupfilestestTemp.fa_BACKUPTEST-00000008");
- correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-00000009");
- correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-00000010");
- HashMap wrongindexmap = new HashMap();
+ HashMap<Integer, String> correctindexmap = new HashMap<>();
+ correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-000001");
+ correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-000002");
+ correctindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-000003");
+ correctindexmap.put(4, "backupfilestestTemp.fa_BACKUPTEST-000004");
+ correctindexmap.put(5, "backupfilestestTemp.fa_BACKUPTEST-000005");
+ correctindexmap.put(6, "backupfilestestTemp.fa_BACKUPTEST-000006");
+ correctindexmap.put(7, "backupfilestestTemp.fa_BACKUPTEST-000007");
+ correctindexmap.put(8, "backupfilestestTemp.fa_BACKUPTEST-000008");
+ correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-000009");
+ correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-000010");
+ HashMap<Integer, String> wrongindexmap = new HashMap<>();
wrongindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-1");
- wrongindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
- wrongindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-00000003");
- wrongindexmap.put(4, "backupfilestestTemp.fa_BACKUPTEST-00000004");
- wrongindexmap.put(5, "backupfilestestTemp.fa_BACKUPTEST-00000005");
- wrongindexmap.put(6, "backupfilestestTemp.fa_BACKUPTEST-00000006");
- wrongindexmap.put(7, "backupfilestestTemp.fa_BACKUPTEST-00000007");
- wrongindexmap.put(8, "backupfilestestTemp.fa_BACKUPTEST-00000008");
- wrongindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-00000009");
- wrongindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-00000010");
+ wrongindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-000002");
+ wrongindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-000003");
+ wrongindexmap.put(4, "backupfilestestTemp.fa_BACKUPTEST-000004");
+ wrongindexmap.put(5, "backupfilestestTemp.fa_BACKUPTEST-000005");
+ wrongindexmap.put(6, "backupfilestestTemp.fa_BACKUPTEST-000006");
+ wrongindexmap.put(7, "backupfilestestTemp.fa_BACKUPTEST-000007");
+ wrongindexmap.put(8, "backupfilestestTemp.fa_BACKUPTEST-000008");
+ wrongindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-000009");
+ wrongindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-000010");
int[] indexes2 = { 3, 4, 5, 6, 7, 8, 9, 10 };
int[] indexes3 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
Assert.assertTrue(checkBackupFiles(correctindexmap));
// check there are "rollMax" backup files and they are all saved correctly
// check 10 backup files
- HashMap correctindexmap = new HashMap();
- correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-00000009");
- correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-00000010");
+ HashMap<Integer, String> correctindexmap = new HashMap<>();
+ correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-000009");
+ correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-000010");
int[] indexes2 = { 10 };
int[] indexes3 = { 8, 9, 10 };
Assert.assertTrue(checkBackupFiles(correctindexmap));
// check there are "rollMax" backup files and they are all saved correctly
// check 10 backup files
- HashMap correctindexmap = new HashMap();
- correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-00000001");
- correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
+ HashMap<Integer, String> correctindexmap = new HashMap<>();
+ correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-000001");
+ correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-000002");
int[] indexes2 = { 1 };
int[] indexes3 = { 1, 2, 3 };
Assert.assertTrue(checkBackupFiles(correctindexmap));
{
Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ BackupFilesPresetEntry bfpe = new BackupFilesPresetEntry(suffix, digits,
+ reverse, noMax, rollMax, false);
+
+ Cache.setPropertyNoSave(BackupFiles.ENABLED,
+ Boolean.toString(enabled));
+ Cache.setPropertyNoSave(
+ BackupFilesPresetEntry.SAVEDCONFIG, bfpe.toString());
+ /*
Cache.setPropertyNoSave(BackupFiles.ENABLED,
Boolean.toString(enabled));
Cache.setPropertyNoSave(BackupFiles.SUFFIX, suffix);
Integer.toString(rollMax));
Cache.setPropertyNoSave(BackupFiles.CONFIRM_DELETE_OLD,
"false");
+ */
}
private void save()