GenericJTabbedDialog gd = new GenericJTabbedDialog("Set image pair",1500,1000);
for (int i = 0; i <edits.length; i++) {
String key = keys.get(i);
String v1 = properties1.getProperty(key);
String v2 = properties2.getProperty(key);
gd.addCheckbox (key+": "+"\""+v1+"\" -> \""+v2+"\"", edits[i], "Replace old value of the \""+key+"\" property of the file2 with the value from file1");
}
gd.addMessage ("--- Select/Deselect all changes, reopen dialog ---");
gd.addCheckbox ("Select all", select_all, "Select all changes to apply, reopen dialog.");
gd.addCheckbox ("Deselect all", select_none, "Deselect all changes to apply, reopen dialog.");
gd.addStringField ("Save path", save_path, 250, "Where to save modified second file.");
String [] labels = {"OK", "Apply", "Cancel"};
String [] actions = {"OK", "_Apply", "Cancel"};
String [] tooltips = labels;
gd.addButtons(labels, actions, tooltips);
gd.showDialog();
if (gd.wasCanceled()) {
done = true;
break;
}
for (int i = 0; i <edits.length; i++) {
edits[i] = gd.getNextBoolean();
}
select_all = gd.getNextBoolean();
select_none = gd.getNextBoolean();
path1 = gd.getNextString();
if (select_all) {
Arrays.fill(edits, true);
continue;
}
if (select_none) {
Arrays.fill(edits, false);
continue;
}
for (int i = 0; i <edits.length; i++) if (edits[i]){
String key = keys.get(i);
String v1 = properties1.getProperty(key);
if (v1==null) {
properties2.remove(key);
} else {
properties2.setProperty(key, v1);
}
}
// re-evaluate all properties:
keys = new ArrayList<String>();
num_diff = 0;
for (@SuppressWarnings("unchecked")
Enumeration<String> e = (Enumeration<String>) properties1.propertyNames(); e.hasMoreElements();) {
String key = e.nextElement();
String v1 = properties1.getProperty(key);
String v2 = properties2.getProperty(key);
if (!v1.equals(v2)) {
if (exclude_source_paths && key.contains("CORRECTION_PARAMETERS.sourcePath")) {