From: kiramt Date: Wed, 30 Aug 2017 12:22:47 +0000 (+0100) Subject: JAL-2527 Added default setting/resetting and first pass at Spanish X-Git-Tag: Release_2_10_3b1~142^2~2^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=547480978230204efda55a1ec533b7b25be2a06f;p=jalview.git JAL-2527 Added default setting/resetting and first pass at Spanish --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 754bc03..28fbfd5 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1318,4 +1318,5 @@ label.ov_show_hide_default = Show hidden regions when opening overview label.hidden_colour = Hidden colour: label.select_gap_colour = Select gap colour label.select_hidden_colour = Select hidden colour -label.overview = Overview \ No newline at end of file +label.overview = Overview +label.reset_to_defaults = Reset to defaults \ No newline at end of file diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index e8187f5..bb26212 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -1311,11 +1311,12 @@ label.togglehidden = Mostrar regiones ocultas label.show_experimental = Habilitar funciones experimentales label.show_experimental_tip = Habilitar funciones nuevas y experimentales (ver Latest Release Notes para más detalles) label.warning_hidden = Advertencia: {0} {1} está actualmente oculto -label.overview_settings = Overview settings -label.ov_legacy_gap = Use legacy gap colouring (gaps are white) -label.gap_colour = Gap colour: -label.ov_show_hide_default = Show hidden regions when opening overview -label.hidden_colour = Hidden colour: -label.select_gap_colour = Select gap colour -label.select_hidden_colour = Select hidden colour -label.overview = Overview \ No newline at end of file +label.overview_settings = Configuración por resumen +label.ov_legacy_gap = Utilizar el color heredado de huecos (huecos son blancas) +label.gap_colour = Color de huecos: +label.ov_show_hide_default = Mostrar regiones ocultas al abrir resumen +label.hidden_colour = Color de las regiones ocultas: +label.select_gap_colour = Seleccionar color de huecos +label.select_hidden_colour = Seleccionar color de las regiones ocultas +label.overview = Resumen +label.reset_to_defaults = Restablecen a los predeterminados \ No newline at end of file diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 3ea5e9b..301387b 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -128,10 +128,11 @@ public class OverviewCanvas extends JComponent setPreferredSize(new Dimension(od.getWidth(), od.getHeight())); boolean useLegacy = Cache.getDefault("USE_LEGACY_GAP", false); - Color gapCol = Cache.getDefaultColour("GAP_COLOUR", new Color(240, 240, 240)); + Color gapCol = Cache.getDefaultColour("GAP_COLOUR", Color.lightGray); Color hiddenCol = Cache.getDefaultColour("HIDDEN_COLOUR", Color.DARK_GRAY.darker()); OverviewResColourFinder cf = new OverviewResColourFinder(useLegacy, gapCol, hiddenCol); + or = new OverviewRenderer(fr, od, av.getAlignment(), av.getResidueShading(), cf); miniMe = or.draw(od.getRows(av.getAlignment()), diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index e8dc07c..3c0faab 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -117,6 +117,13 @@ public class Preferences extends GPreferences private static final int MAX_FONT_SIZE = 30; + private static final Color OVERVIEW_DEFAULT_GAP = Color.lightGray; + + private static final Color OVERVIEW_DEFAULT_LEGACY_GAP = Color.white; + + private static final Color OVERVIEW_DEFAULT_HIDDEN = Color.darkGray + .darker(); + /** * Holds name and link separated with | character. Sequence ID must be * $SEQUENCE_ID$ or $SEQUENCE_ID=/.possible | chars ./=$ @@ -316,9 +323,10 @@ public class Preferences extends GPreferences * Set overview panel defaults */ gapColour.setBackground( - Cache.getDefaultColour("GAP_COLOUR", Color.lightGray)); + Cache.getDefaultColour("GAP_COLOUR", OVERVIEW_DEFAULT_GAP)); hiddenColour.setBackground( - Cache.getDefaultColour("HIDDEN_COLOUR", Color.darkGray)); + Cache.getDefaultColour("HIDDEN_COLOUR", + OVERVIEW_DEFAULT_HIDDEN)); useLegacyGap.setSelected(Cache.getDefault("USE_LEGACY_GAP", false)); gapLabel.setEnabled(!useLegacyGap.isSelected()); gapColour.setEnabled(!useLegacyGap.isSelected()); @@ -1091,6 +1099,31 @@ public class Preferences extends GPreferences } @Override + protected void useLegacyGaps_actionPerformed(ActionEvent e) + { + boolean enabled = useLegacyGap.isSelected(); + if (enabled) + { + gapColour.setBackground(OVERVIEW_DEFAULT_LEGACY_GAP); + } + else + { + gapColour.setBackground(OVERVIEW_DEFAULT_GAP); + } + gapColour.setEnabled(!enabled); + gapLabel.setEnabled(!enabled); + } + + @Override + protected void resetOvDefaults_actionPerformed(ActionEvent e) + { + useLegacyGap.setSelected(false); + useLegacyGaps_actionPerformed(null); + showHiddenAtStart.setSelected(true); + hiddenColour.setBackground(OVERVIEW_DEFAULT_HIDDEN); + } + + @Override protected void userIdWidth_actionPerformed() { try diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index f8fd47b..fa45769 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -195,6 +195,8 @@ public class GPreferences extends JPanel protected JLabel gapLabel; + protected JButton resetButton; + /* * Connections tab components */ @@ -1091,10 +1093,30 @@ public class GPreferences extends JPanel c6.insets = new Insets(0, 0, 0, 15); overviewPanel.add(hiddenColour, c6); + resetButton = new JButton( + MessageManager.getString("label.reset_to_defaults")); + + resetButton.addActionListener(new ActionListener() + { + @Override + public void actionPerformed(ActionEvent e) + { + resetOvDefaults_actionPerformed(e); + } + }); + + GridBagConstraints c7 = new GridBagConstraints(); + c7.fill = GridBagConstraints.NONE; + c7.gridx = 0; + c7.gridy = 2; + c7.insets = new Insets(10, 0, 0, 0); + c7.anchor = GridBagConstraints.WEST; + overviewPanel.add(resetButton, c7); + // Add padding so the panel doesn't look ridiculous JPanel spacePanel = new JPanel(); overviewPanel.add(spacePanel, - new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, + new GridBagConstraints(0, 3, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); @@ -1649,13 +1671,10 @@ public class GPreferences extends JPanel protected void useLegacyGaps_actionPerformed(ActionEvent e) { - boolean enabled = useLegacyGap.isSelected(); - if (enabled) - { - gapColour.setBackground(Color.WHITE); - } - gapColour.setEnabled(!enabled); - gapLabel.setEnabled(!enabled); + } + + protected void resetOvDefaults_actionPerformed(ActionEvent e) + { } /** diff --git a/src/jalview/renderer/OverviewResColourFinder.java b/src/jalview/renderer/OverviewResColourFinder.java index b28aa27..8fa0e23 100644 --- a/src/jalview/renderer/OverviewResColourFinder.java +++ b/src/jalview/renderer/OverviewResColourFinder.java @@ -38,7 +38,7 @@ public class OverviewResColourFinder extends ResidueColourFinder public OverviewResColourFinder() { - GAP_COLOUR = new Color(240, 240, 240); + GAP_COLOUR = Color.lightGray; // new Color(240, 240, 240); RESIDUE_COLOUR = Color.white; HIDDEN_COLOUR = Color.DARK_GRAY.darker(); } @@ -49,7 +49,7 @@ public class OverviewResColourFinder extends ResidueColourFinder if (useLegacyColouring) { GAP_COLOUR = Color.white; - RESIDUE_COLOUR = new Color(240, 240, 240); + RESIDUE_COLOUR = Color.lightGray; HIDDEN_COLOUR = hiddenCol; } else