From: kiramt Date: Tue, 9 May 2017 08:09:55 +0000 (+0100) Subject: JAL-2388 Added checkbox to toggle hidden columns menu & updated text X-Git-Tag: Release_2_10_2~3^2~92^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e073a5187b948dd845d01dbdbbda3516911ef7f6;p=jalview.git JAL-2388 Added checkbox to toggle hidden columns menu & updated text --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 91295e8..b571a5b 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1302,7 +1302,7 @@ warn.name_cannot_be_duplicate = User-defined URL names must be unique and cannot label.invalid_name = Invalid Name ! label.output_seq_details = Output Sequence Details to list all database references label.urllinks = Links -label.togglehidden = Toggle hidden regions on/off +label.togglehidden = Show hidden regions label.quality_descr = Alignment Quality based on Blosum62 scores label.conservation_descr = Conservation of total alignment less than {0}% gaps label.consensus_descr = PID diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index 02bfbe7..5932698 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -1301,4 +1301,4 @@ warn.name_cannot_be_duplicate = Los nombres URL definidos por el usuario deben s label.invalid_name = Nombre inválido ! label.output_seq_details = Seleccionar Detalles de la secuencia para ver todas label.urllinks = Enlaces -label.togglehidden = Toggle hidden regions on/off \ No newline at end of file +label.togglehidden = Show hidden regions \ No newline at end of file diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 7750374..a6c3960 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -36,7 +36,7 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; -import javax.swing.JMenuItem; +import javax.swing.JCheckBoxMenuItem; import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; @@ -58,6 +58,8 @@ public class OverviewPanel extends JPanel implements Runnable private AlignmentPanel ap; + private JCheckBoxMenuItem displayToggle; + private boolean showHidden = true; /** @@ -156,12 +158,15 @@ public class OverviewPanel extends JPanel implements Runnable { // switch on/off the hidden columns view toggleHiddenColumns(); + displayToggle.setSelected(showHidden); } }; - JMenuItem item = new JMenuItem( + displayToggle = new JCheckBoxMenuItem( MessageManager.getString("label.togglehidden")); - popup.add(item); - item.addActionListener(menuListener); + displayToggle.setEnabled(true); + displayToggle.setSelected(showHidden); + popup.add(displayToggle); + displayToggle.addActionListener(menuListener); popup.show(this, e.getX(), e.getY()); }