X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FUserDefinedColours.java;h=6e3a68be104ad7bed96110cb40e435c82a587d07;hb=02e2fe79e8c9c2e5e751c33cf6aec4ae25e3c993;hp=4846049f7402db6caafbe70554eba2f01a597e27;hpb=577b0bf651763fe609eb6d6343754662023b3eac;p=jalview.git diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index 4846049..6e3a68b 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -69,8 +69,6 @@ public class UserDefinedColours extends GUserDefinedColours private static final Font VERDANA_BOLD_10 = new Font("Verdana", Font.BOLD, 10); - public static final String USER_DEFINED_COLOURS = "USER_DEFINED_COLOURS"; - private static final String LAST_DIRECTORY = "LAST_DIRECTORY"; private static final int MY_FRAME_HEIGHT = 440; @@ -448,7 +446,7 @@ public class UserDefinedColours extends GUserDefinedColours { if (isNoSelectionMade()) { - JvOptionPane.showMessageDialog(Desktop.desktop, + JvOptionPane.showMessageDialog(Desktop.getDesktopPane(), MessageManager .getString("label.no_colour_selection_in_scheme"), MessageManager.getString("label.no_colour_selection_warn"), @@ -503,7 +501,7 @@ public class UserDefinedColours extends GUserDefinedColours String[] options = new String[] { title, MessageManager.getString("label.dont_save_changes"), }; final String question = JvSwingUtils.wrapTooltip(true, message); - int response = JvOptionPane.showOptionDialog(Desktop.desktop, + int response = JvOptionPane.showOptionDialog(Desktop.getDesktopPane(), question, title, JvOptionPane.DEFAULT_OPTION, JvOptionPane.PLAIN_MESSAGE, null, options, options[0]); @@ -557,7 +555,7 @@ public class UserDefinedColours extends GUserDefinedColours { if (isNoSelectionMade()) { - JvOptionPane.showMessageDialog(Desktop.desktop, + JvOptionPane.showMessageDialog(Desktop.getDesktopPane(), MessageManager .getString("label.no_colour_selection_in_scheme"), MessageManager.getString("label.no_colour_selection_warn"), @@ -694,7 +692,7 @@ public class UserDefinedColours extends GUserDefinedColours /** * Loads the user-defined colour scheme from the first file listed in property - * "USER_DEFINED_COLOURS". If this fails, returns an all-white colour scheme. + * Preferences.USER_DEFINED_COLOURS. If this fails, returns an all-white colour scheme. * * @return */ @@ -702,7 +700,7 @@ public class UserDefinedColours extends GUserDefinedColours { UserColourScheme ret = null; - String colours = Cache.getProperty(USER_DEFINED_COLOURS); + String colours = Cache.getProperty(Preferences.USER_DEFINED_COLOURS); if (colours != null) { if (colours.indexOf("|") > -1) @@ -741,7 +739,7 @@ public class UserDefinedColours extends GUserDefinedColours String name = schemeName.getText().trim(); if (name.length() < 1) { - JvOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(), MessageManager .getString("label.user_colour_scheme_must_have_name"), MessageManager.getString("label.no_name_colour_scheme"), @@ -756,7 +754,7 @@ public class UserDefinedColours extends GUserDefinedColours * @j2sIgnore */ { - int reply = JvOptionPane.showInternalConfirmDialog(Desktop.desktop, + int reply = JvOptionPane.showInternalConfirmDialog(Desktop.getDesktopPane(), MessageManager.formatMessage( "label.colour_scheme_exists_overwrite", new Object[] { name, name }), @@ -814,7 +812,8 @@ public class UserDefinedColours extends GUserDefinedColours * update the delimited list of user defined colour files in * Jalview property USER_DEFINED_COLOURS */ - String defaultColours = Cache.getDefault(USER_DEFINED_COLOURS, + String defaultColours = Cache.getDefault( + Preferences.USER_DEFINED_COLOURS, filePath); if (defaultColours.indexOf(filePath) == -1) { @@ -824,7 +823,7 @@ public class UserDefinedColours extends GUserDefinedColours } defaultColours = defaultColours.concat(filePath); } - Cache.setProperty(USER_DEFINED_COLOURS, defaultColours); + Cache.setProperty(Preferences.USER_DEFINED_COLOURS, defaultColours); /* * construct and register the colour scheme