if (value == JalviewFileChooser.APPROVE_OPTION)
{
File file = chooser.getSelectedFile();
- addNewColourScheme(file.getPath());
+ UserColourScheme updatedScheme = addNewColourScheme(file.getPath());
saveToFile(file);
/*
* changes saved - apply to alignment if we are changing
- * the currently selected colour scheme
+ * the currently selected colour scheme; also make the updated
+ * colours the 'backout' scheme on Cancel
*/
if (oldColourScheme != null
&& name.equals(oldColourScheme.getSchemeName()))
{
+ oldColourScheme = updatedScheme;
applyButton_actionPerformed();
}
}
* the colour scheme.
*
* @param filePath
+ * @return
*/
- protected void addNewColourScheme(String filePath)
+ protected UserColourScheme addNewColourScheme(String filePath)
{
/*
* update the delimited list of user defined colour files in
{
ap.alignFrame.buildColourMenu();
}
+
+ return ucs;
}
/**