From 3c2d7328e3d4d086c0649b88102de8da259ffb6c Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 24 Jan 2019 15:56:58 +0000 Subject: [PATCH] JAL-3141 New layout and wording of Backups Preferences pane after consultation with SD. Seriously rationalised 'backupfiles...SetEnable' to allow for more complex widget enabling/disabling depending on other widget values. Fixed a buglet or two when there's an unusual selection of options (when suffix has no '%n' or is completely empty). --- resources/lang/Messages.properties | 22 +-- resources/lang/Messages_es.properties | 26 ++-- src/jalview/gui/Preferences.java | 28 +--- src/jalview/io/BackupFiles.java | 10 +- src/jalview/jbgui/GPreferences.java | 256 +++++++++++++++++++++++---------- 5 files changed, 210 insertions(+), 132 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 960e40f..1b239a3 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1366,18 +1366,18 @@ label.backupfiles_confirm_save_file = Confirm save file label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Something possibly went wrong with the backups of this file, write the new file anyway? label.backups = Backups label.backup_files = Backup Files -label.enable_backupfiles = Enable/disable backup files -label.suffix_format = Append to backup filenames -label.suffix_template = Append text (use %n to represent the backup number) -label.suffix_template_tooltip = %n in the text will be replaced by the backup number. The text will appear after the filename. -label.index_digits = Number of digits to use for the number (%n) -label.example_filenames = Summary of backup scheme +label.enable_backupfiles = Enable backup files +label.backup_filenames = Backup filenames +label.append_to_filename = Append to filename (%n is replaced by the backup number) +label.append_to_filename_tooltip = %n in the text will be replaced by the backup number. The text will appear after the filename. See the summary box above. +label.index_digits = Number of digits to use for the backup number (%n) +label.summary_of_backups_scheme = Summary of backup scheme label.increment_index = Increase appended text numbers - newest file has largest number. label.reverse_roll = "Roll" appended text numbers - newest backup file is always number 1. label.keep_files = Deleting old backup files label.keep_all_backup_files = Do not delete old backup files label.keep_only_this_number_of_backup_files = Keep only this number of most recent backup files -label.old_backup_files = Autodelete old backup files: +label.autodelete_old_backup_files = Autodelete old backup files: label.confirm_delete = Always ask label.auto_delete = Automatically delete label.filename = filename @@ -1385,9 +1385,11 @@ label.braced_oldest = (oldest) label.braced_newest = (most recent) label.configuration = Configuration label.configure_feature_tooltip = Click to configure variable colour or filters -label.presets = Presets -label.custom = Custom +label.schemes = Schemes +label.customise = Customise label.default = Default label.single_file = Single backup -label.keep_everything = Keep everything +label.keep_all_versions = Keep all versions label.rolled_backups = Rolled backup files +label.previously_saved_scheme = Previously saved scheme +label.no_backup_files = NO BACKUP FILES \ No newline at end of file diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index acadc8e..fe3b2a2 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -1365,20 +1365,20 @@ label.backupfiles_confirm_delete = Confirmar borrar label.backupfiles_confirm_delete_old_files = ¿Borrar los siguientes archivos? (ver la pestaña 'Copias' de la ventana de Preferencias para más opciones) label.backupfiles_confirm_save_file = Confirmar guardar archivo label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Posiblemente algo está mal con los archivos de copia de seguridad. ¿Guardar el nuevo archivo? -label.backups = Copias -label.backup_files = Copias de seguridad -label.enable_backupfiles = Habilitar/deshabilitar copias de seguridad -label.suffix_format = Adjuntar a los nombres de archivo -label.suffix_template = Adjuntar texto (usar %n para representar el número de respaldo) -label.suffix_template_tooltip = %n en el texto será reemplazado por el número de respaldo. El texto será después del nombre del archivo. -label.index_digits = Número de dígitos a utilizar para el número . -label.example_filenames = Resumen del esquema de copias de seguridad +label.backups = Respaldos +label.backup_files = Archivos de respaldos +label.enable_backupfiles = Habilitar archivos de respaldos +label.backup_filenames = Nombres de archivo de respaldos +label.append_to_filename = Adjuntar texto (%n es reemplazado por el número de respaldo) +label.append_to_filename_tooltip = %n en el texto será reemplazado por el número de respaldo. El texto será después del nombre del archivo. Vea el cuadro de resumen arriba. +label.index_digits = Número de dígitos a utilizar para el número de respaldo. +label.summary_of_backups_scheme = Resumen del esquema de copias de seguridad label.increment_index = Aumente los números de texto adjuntos: el archivo más nuevo tiene el número más grande label.reverse_roll = Ciclos de texto adjuntos: el respaldo más reciente es siempre el número 1 label.keep_files = Borrando los respaldos antiguos label.keep_all_backup_files = No borrar respaldos antiguas label.keep_only_this_number_of_backup_files = Mantenga solo este número de respaldos más recientes -label.old_backup_files = Borrer automáticamente respaldos antiguos: +label.autodelete_old_backup_files = Borrer automáticamente respaldos antiguos: label.confirm_delete = Pregunta siempre label.auto_delete = Borrer automáticamente label.filename = nombre_de_archivo @@ -1386,9 +1386,11 @@ label.braced_oldest = (mas antiguo) label.braced_newest = (mas nuevo) label.configuration = Configuración label.configure_feature_tooltip = Haga clic para configurar el color o los filtros -label.presets = Preconfiguración -label.custom = Personalizado +label.schemes = Esquemas +label.customise = Personalizado label.default = Defecto label.single_file = Solo uno respaldo -label.keep_everything = Mantenga todos +label.keep_all_versions = Mantener todas las versiones label.rolled_backups = Ciclos resaldos +label.previously_saved_scheme = Esquema previamente guardado +label.no_backup_files = NO ARCHIVOS DE RESPALDOS \ No newline at end of file diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index c8f8b25..ad3bfb5 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -552,33 +552,7 @@ public class Preferences extends GPreferences /* * Set Backups tab defaults */ - enableBackupFiles - .setSelected(Cache.getDefault(BackupFiles.ENABLED, true)); - suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX, - ".v" + BackupFiles.NUM_PLACEHOLDER)); - suffixDigitsSpinner - .setValue(Cache.getDefault(BackupFiles.SUFFIX_DIGITS, 3)); - suffixReverse.setSelected( - Cache.getDefault(BackupFiles.REVERSE_ORDER, false)); - backupfilesKeepAll - .setSelected(Cache.getDefault(BackupFiles.NO_MAX, false)); - backupfilesRollMaxSpinner - .setValue(Cache.getDefault(BackupFiles.ROLL_MAX, 4)); - backupfilesConfirmDelete.setSelected( - Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true)); - setComboIntStringKey(backupfilesPresetsCombo, Cache.getDefault(BackupFiles.NS+"_PRESET", 0)); - backupsOptionsSetEnabled(enableBackupFiles.isSelected()); - - updateBackupFilesExampleLabel(); - /* - suffixPanel.setPreferredSize( - new Dimension(width, suffixPanel.getHeight())); - keepfilesPanel.setPreferredSize( - new Dimension(width, keepfilesPanel.getHeight())); - exampleFilesPanel.setPreferredSize( - new Dimension(width, exampleFilesPanel.getHeight())); - */ - + loadLastSavedBackupsOptions(); } /** diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index e913fbc..71b31a7 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -93,7 +93,7 @@ public class BackupFiles // REVERSE_ORDER public BackupFiles(File file) { - this(file, ".v" + NUM_PLACEHOLDER, false, 4, 3, false); + this(file, ".bak" + NUM_PLACEHOLDER, false, 3, 3, false); } public BackupFiles(File file, String defaultSuffix, boolean defaultNoMax, @@ -208,15 +208,15 @@ public class BackupFiles public boolean rollBackupFiles() { - // file doesn't yet exist or backups are not enabled - if ((!file.exists()) || (!enabled) || (max < 0)) + // file doesn't yet exist or backups are not enabled or template is null or + // empty + if ((!file.exists()) || (!enabled) || max < 0 || suffix == null + || suffix.length() == 0) { // nothing to do return true; } - // split filename up to insert suffix template in the right place. template - // and backupMax can be set in .jalview_properties String dir = ""; File dirFile; try diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 43b521a..18dbcb4 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -20,6 +20,7 @@ */ package jalview.jbgui; +import jalview.bin.Cache; import jalview.fts.core.FTSDataColumnPreferences; import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource; import jalview.fts.service.pdb.PDBFTSRestClient; @@ -60,6 +61,7 @@ import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JLabel; +import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JScrollPane; @@ -1686,6 +1688,33 @@ public class GPreferences extends JPanel } /** + * Load the saved Backups options EXCEPT "Enabled" and "Scheme" + */ + + protected void loadLastSavedBackupsOptions() + { + enableBackupFiles + .setSelected(Cache.getDefault(BackupFiles.ENABLED, true)); + setComboIntStringKey(backupfilesPresetsCombo, + Cache.getDefault(BackupFiles.NS + "_PRESET", 1)); + suffixTemplate.setText(Cache.getDefault(BackupFiles.SUFFIX, + ".bak" + BackupFiles.NUM_PLACEHOLDER)); + suffixDigitsSpinner + .setValue(Cache.getDefault(BackupFiles.SUFFIX_DIGITS, 3)); + suffixReverse.setSelected( + Cache.getDefault(BackupFiles.REVERSE_ORDER, false)); + backupfilesKeepAll + .setSelected(Cache.getDefault(BackupFiles.NO_MAX, false)); + backupfilesRollMaxSpinner + .setValue(Cache.getDefault(BackupFiles.ROLL_MAX, 3)); + backupfilesConfirmDelete.setSelected( + Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true)); + + backupsOptionsSetEnabled(); + updateBackupFilesExampleLabel(); + } + + /** * Initialises the Backups tabbed panel. * * @return @@ -1719,7 +1748,7 @@ public class GPreferences extends JPanel { boolean selected = enableBackupFiles.isSelected(); // enable other options only when the first is checked - backupsOptionsSetEnabled(selected); + backupsOptionsSetEnabled(); } }); @@ -1747,24 +1776,18 @@ public class GPreferences extends JPanel // whole suffix panel next row gbc.gridx = 0; gbc.gridy = 2; - backupsTab.add(suffixPanel, gbc); + backupsTab.add(keepfilesPanel, gbc); // keep files panel gbc.gridy = 3; - backupsTab.add(keepfilesPanel, gbc); + backupsTab.add(suffixPanel, gbc); - /* - // whole examples panel next row - gbc.gridy = 3; - backupsTab.add(exampleFilesPanel, gbc); - // fill empty space gbc.gridy = 4; gbc.weighty = 1.0; backupsTab.add(new JPanel(), gbc); - */ - backupsOptionsSetEnabled(enableBackupFiles.isSelected()); + backupsOptionsSetEnabled(); return backupsTab; } @@ -1774,19 +1797,22 @@ public class GPreferences extends JPanel new IntKeyStringValueEntry(2, MessageManager.getString("label.single_file")), new IntKeyStringValueEntry(3, - MessageManager.getString("label.keep_everything")), + MessageManager.getString("label.keep_all_versions")), 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(0, - MessageManager.getString("label.custom")) }; + MessageManager.getString("label.customise")) }; private final Map backupfilesPresetEntriesValues = new HashMap() { { - put(1, new BackupFilesPresetEntry(".v" + BackupFiles.NUM_PLACEHOLDER, - 3, false, false, 4, false)); + put(1, new BackupFilesPresetEntry( + ".bak" + BackupFiles.NUM_PLACEHOLDER, 3, false, false, 3, + false)); put(2, new BackupFilesPresetEntry("~", 1, false, false, 1, false)); put(3, new BackupFilesPresetEntry(".v" + BackupFiles.NUM_PLACEHOLDER, 3, false, true, 10, true)); @@ -1799,13 +1825,18 @@ public class GPreferences extends JPanel private JPanel initBackupsTabPresetsPanel() { presetsPanel.setBorder( - new TitledBorder(MessageManager.getString("label.presets"))); + new TitledBorder(MessageManager.getString("label.schemes"))); for (int i = 0; i < backupfilesPresetEntries.length; i++) { backupfilesPresetsCombo.addItem(backupfilesPresetEntries[i]); } + // put "Previously saved scheme" item in italics (it's not really + // selectable, as such -- it deselects itself when selected) and + // "Customise" in bold + backupfilesPresetsCombo + .setRenderer(new BackupFilesPresetsComboBoxRenderer()); backupfilesPresetsCombo.addActionListener(new ActionListener() { @Override @@ -1825,11 +1856,21 @@ public class GPreferences extends JPanel .getSelectedItem(); int key = entry.getKey(); String value = entry.getValue(); - boolean custom = key == 0; + // 0 reserved for "Custom" and 255 reserved or "Previously saved scheme" + boolean special = key == 0 || key == 255; - if (custom) + if (special) { - // backupsSetCustomOptions(); + if (key == 0) + { + // backupsSetCustomOptions(); + } + else if (key == 255) + { + loadLastSavedBackupsOptions(); + // switch to "Customise" scheme? probably not + // setComboIntStringKey(backupfilesPresetsCombo, 0); + } } else { @@ -1839,12 +1880,12 @@ public class GPreferences extends JPanel } else { - System.out.println("Preset '" + value + "' not implemented yet"); + System.out.println("Preset '" + value + "' not implemented"); } } + backupfilesCustomOptionsSetEnabled(); updateBackupFilesExampleLabel(); - backupsCustomOptionsSetEnabled(custom); } protected int getComboIntStringKey(JComboBox c) @@ -1873,16 +1914,16 @@ public class GPreferences extends JPanel private JPanel initBackupsTabSuffixPanel() { suffixPanel.setBorder(new TitledBorder( - MessageManager.getString("label.suffix_format"))); + MessageManager.getString("label.backup_filenames"))); suffixPanel.setLayout(new GridBagLayout()); suffixTemplateLabel - .setText(MessageManager.getString("label.suffix_template")); + .setText(MessageManager.getString("label.append_to_filename")); suffixTemplateLabel.setHorizontalAlignment(SwingConstants.LEFT); suffixTemplateLabel.setFont(LABEL_FONT); final String tooltip = JvSwingUtils.wrapTooltip(true, - MessageManager.getString("label.suffix_template_tooltip")); + MessageManager.getString("label.append_to_filename_tooltip")); suffixTemplate.setToolTipText(tooltip); suffixTemplate.addActionListener(new ActionListener() { @@ -1890,6 +1931,7 @@ public class GPreferences extends JPanel public void actionPerformed(ActionEvent e) { updateBackupFilesExampleLabel(); + backupfilesCustomOptionsSetEnabled(); } }); @@ -1899,6 +1941,7 @@ public class GPreferences extends JPanel public void keyReleased(KeyEvent e) { updateBackupFilesExampleLabel(); + backupfilesCustomOptionsSetEnabled(); } @Override @@ -1906,14 +1949,14 @@ public class GPreferences extends JPanel { } - // disable use of ':' + // disable use of ':' or '/' or '\' @Override public void keyTyped(KeyEvent e) { char c = e.getKeyChar(); - if (c == ':') + if (c == ':' || c == '/' || c == '\\') { - // don't process ':' + // don't process ':' or '/' or '\' e.consume(); } } @@ -1991,12 +2034,6 @@ public class GPreferences extends JPanel return suffixPanel; } - private void backupfilesKeepAllEnabled(boolean enabled) - { - backupfilesKeepAll.setEnabled(enabled); - keepRollMaxOptionsEnabled(); - } - private JPanel initBackupsTabKeepFilesPanel() { keepfilesPanel.setBorder( @@ -2086,7 +2123,8 @@ public class GPreferences extends JPanel JPanel jp = new JPanel(); jp.setLayout(new FlowLayout()); oldBackupFilesLabel - .setText(MessageManager.getString("label.old_backup_files")); + .setText(MessageManager + .getString("label.autodelete_old_backup_files")); oldBackupFilesLabel.setFont(LABEL_FONT); oldBackupFilesLabel.setHorizontalAlignment(SwingConstants.LEFT); jp.add(oldBackupFilesLabel); @@ -2099,7 +2137,8 @@ public class GPreferences extends JPanel private JPanel initBackupsTabFilenameExamplesPanel() { - String title = MessageManager.getString("label.example_filenames"); + String title = MessageManager + .getString("label.summary_of_backups_scheme"); TitledBorder tb = new TitledBorder(title); // tb.setTitleFont(LABEL_FONT); exampleFilesPanel.setBorder(tb); @@ -2132,26 +2171,26 @@ public class GPreferences extends JPanel { int exampleindex = 12; String base = MessageManager.getString("label.filename"); - if (base == null || base.length() > 0) + if (base == null || base.length() == 0) { - base = "filename.fa"; + base = "file_name.fa"; } + boolean reverse = suffixReverse.isSelected(); + boolean keepAll = backupfilesKeepAll.isSelected(); + int rollMax = 4; String suffix = suffixTemplate.getText(); int digits = 3; - try - { - suffixDigitsSpinner.commitEdit(); - digits = (Integer) suffixDigitsSpinner.getValue(); - digits = digits < 1 ? 1 : digits; - } catch (Exception e) + + backupfilesExampleLabel.setFont(LABEL_FONT_ITALIC); + if (suffix == null || suffix.length() == 0) { - System.out.println( - "Failed casting (Integer) suffixTemplateSpinner.getValue()"); + backupfilesExampleLabel + .setText(MessageManager.getString("label.no_backup_files")); + backupfilesExampleLabel.setFont(LABEL_FONT_BOLD); + return; } - boolean reverse = suffixReverse.isSelected(); - boolean keepAll = backupfilesKeepAll.isSelected(); - int rollMax = 4; + try { backupfilesRollMaxSpinner.commitEdit(); @@ -2163,6 +2202,22 @@ public class GPreferences extends JPanel "Failed casting (Integer) backupfilesRollMaxSpinner.getValue()"); } + if (suffix.indexOf(BackupFiles.NUM_PLACEHOLDER) == -1) + { + rollMax = 1; + } + + try + { + suffixDigitsSpinner.commitEdit(); + digits = (Integer) suffixDigitsSpinner.getValue(); + digits = digits < 1 ? 1 : digits; + } catch (Exception e) + { + System.out.println( + "Failed casting (Integer) suffixTemplateSpinner.getValue()"); + } + int lowersurround = 2; int uppersurround = 0; StringBuilder exampleSB = new StringBuilder(); @@ -2323,55 +2378,74 @@ public class GPreferences extends JPanel return i; } - protected void keepRollMaxOptionsEnabled() + private void keepRollMaxOptionsEnabled() { - keepRollMaxOptionsEnabled(backupfilesKeepAll.isEnabled()); + boolean enabled = backupfilesKeepAll.isEnabled() + && !backupfilesKeepAll.isSelected(); + oldBackupFilesLabel.setEnabled(enabled); + backupfilesRollMaxSpinner.setEnabled(enabled); + backupfilesConfirmDelete.setEnabled(enabled); } - protected void keepRollMaxOptionsEnabled(boolean tryEnabled) + private void backupfilesKeepAllSetEnabled(boolean tryEnabled) { - boolean enabled = tryEnabled && !backupfilesKeepAll.isSelected(); + boolean enabled = tryEnabled && enableBackupFiles.isSelected() + && getComboIntStringKey(backupfilesPresetsCombo) == 0 + && suffixTemplate.getText() + .indexOf(BackupFiles.NUM_PLACEHOLDER) > -1; + keepfilesPanel.setEnabled(enabled); + backupfilesKeepAll.setEnabled(enabled); oldBackupFilesLabel.setEnabled(enabled); - backupfilesRollMaxSpinner.setEnabled(enabled); - backupfilesConfirmDelete.setEnabled(enabled); + keepRollMaxOptionsEnabled(); } - protected void backupsCustomOptionsSetEnabled(boolean enabled) + private void backupfilesSuffixTemplateDigitsSetEnabled() { - backupsOptionsSetEnabled(enabled, false); + boolean enabled = suffixTemplate.isEnabled() && suffixTemplate.getText() + .indexOf(BackupFiles.NUM_PLACEHOLDER) > -1; + suffixDigitsLabel.setEnabled(enabled); + suffixDigitsSpinner.setEnabled(enabled); + suffixReverse.setEnabled(enabled); } - protected void backupsOptionsSetEnabled(boolean enabled) + private void backupfilesSuffixTemplateSetEnabled(boolean tryEnabled) { - backupsOptionsSetEnabled(enabled, true); + boolean enabled = tryEnabled && enableBackupFiles.isSelected() + && getComboIntStringKey(backupfilesPresetsCombo) == 0; + suffixPanel.setEnabled(enabled); + suffixTemplateLabel.setEnabled(enabled); + suffixTemplate.setEnabled(enabled); + backupfilesSuffixTemplateDigitsSetEnabled(); } - protected void backupsOptionsSetEnabled(boolean enabled, boolean all) + protected void backupfilesCustomOptionsSetEnabled() { + int scheme = getComboIntStringKey(backupfilesPresetsCombo); + boolean enabled = scheme == 0 && enableBackupFiles.isSelected(); - if (all) - { - presetsPanel.setEnabled(enabled); - exampleFilesPanel.setEnabled(enabled); + backupfilesSuffixTemplateSetEnabled(enabled); + backupfilesKeepAllSetEnabled(enabled); + } - backupfilesPresetsCombo.setEnabled(enabled); - backupfilesExampleLabel.setEnabled(enabled); - } - suffixPanel.setEnabled(enabled); - keepfilesPanel.setEnabled(enabled); + private void backupfilesSummarySetEnabled() + { + boolean enabled = enableBackupFiles.isSelected(); + backupfilesExampleLabel.setEnabled(enabled); + exampleFilesPanel.setEnabled(enabled); + } - suffixTemplate.setEnabled(enabled); - suffixTemplateLabel.setEnabled(enabled); - suffixDigitsLabel.setEnabled(enabled); - suffixDigitsSpinner.setEnabled(enabled); - suffixReverse.setEnabled(enabled); - oldBackupFilesLabel.setEnabled(enabled); - backupfilesKeepAllEnabled(enabled); + private void backupfilesPresetsSetEnabled() + { + boolean enabled = enableBackupFiles.isSelected(); + presetsPanel.setEnabled(enabled); + backupfilesPresetsCombo.setEnabled(enabled); + } - if (enabled && all) - { - backupsTabUpdatePresets(); - } + protected void backupsOptionsSetEnabled() + { + backupfilesPresetsSetEnabled(); + backupfilesSummarySetEnabled(); + backupfilesCustomOptionsSetEnabled(); } protected void backupsSetOptions(String suffix, int digits, @@ -2632,3 +2706,29 @@ class BackupFilesPresetEntry this.confirmDelete = confirmDelete; } } + +class BackupFilesPresetsComboBoxRenderer extends DefaultListCellRenderer +{ + @Override + 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) + { + // "Customise" item + this.setFont(this.getFont().deriveFont(Font.BOLD)); + } + } catch (Exception e) { + return this; + } + + return this; + } +} \ No newline at end of file -- 1.7.10.2