From: James Procter Date: Fri, 26 May 2023 14:11:28 +0000 (+0100) Subject: JAL-4134 internationalise popup menu entries and show a ‘tree calculation in progress... X-Git-Tag: Release_2_11_3_0~14^2~3^2^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b25d6f028eaea9c382500355b5d118cd40799a8e;p=jalview.git JAL-4134 internationalise popup menu entries and show a ‘tree calculation in progress’ progress bar in align panel. --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index d20f63c..4200a46 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1452,4 +1452,12 @@ label.choose_tempfac_type = Choose Temperature Factor type label.interpret_tempfac_as = Interpret Temperature Factor as label.add_pae_matrix_file = Add PAE matrix file label.nothing_selected = Nothing selected -label.working_ellipsis = Working ... \ No newline at end of file +label.working_ellipsis = Working ... +action.show_groups_on_matrix = Show groups on matrix +action.show_groups_on_matrix_tooltip = When enabled, clusters defined on the matrix's associated tree or below the assigned threshold are shown as different colours on the matrix annotation row +action.show_tree_for_matrix = Show tree for matrix +action.show_tree_for_matrix_tooltip = Opens a tree viewer to display the average distance tree for the matrix +action.cluster_matrix = Cluster matrix +action.clustering_matrix_for = Calculating tree for matrix {0} and clustering at {1} +action.cluster_matrix_tooltip = Computes an average distance tree for the matrix and displays it + diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 4148998..6b82a37 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -485,7 +485,8 @@ public class AnnotationLabels extends JPanel if (cm.hasGroups()) { - JCheckBoxMenuItem chitem = new JCheckBoxMenuItem("Show Groups on Matrix"); + JCheckBoxMenuItem chitem = new JCheckBoxMenuItem(MessageManager.getString("action.show_groups_on_matrix")); + chitem.setToolTipText(MessageManager.getString("action.show_groups_on_matrix_tooltip")); boolean showGroups = alignmentAnnotation.isShowGroupsForContactMatrix(); final AlignmentAnnotation sel_row=alignmentAnnotation; chitem.setState(showGroups); @@ -504,7 +505,8 @@ public class AnnotationLabels extends JPanel } if (cm.hasTree()) { - item = new JMenuItem("Show Tree for Matrix"); + item = new JMenuItem(MessageManager.getString("action.show_tree_for_matrix")); + item.setToolTipText(MessageManager.getString("action.show_tree_for_matrix_tooltip")); item.addActionListener(new ActionListener() { @@ -520,10 +522,10 @@ public class AnnotationLabels extends JPanel } else { - item = new JMenuItem("Calculate Tree for Matrix"); + item = new JMenuItem(MessageManager.getString("action.cluster_matrix")); + item.setToolTipText(MessageManager.getString("action.cluster_matrix_tooltip")); item.addActionListener(new ActionListener() { - // TODO - refactor to analysis background thread @Override public void actionPerformed(ActionEvent e) { @@ -532,9 +534,11 @@ public class AnnotationLabels extends JPanel @Override public void run() { - AlignmentAnnotation alan = alignmentAnnotation; + final long progBar; + ap.alignFrame.setProgressBar(MessageManager.formatMessage("action.clustering_matrix_for",cm.getAnnotDescr(),5f), progBar = System.currentTimeMillis()); cm.setGroupSet(GroupSet.makeGroups(cm, 5f, true)); - ap.alignFrame.showContactMapTree(alan, cm); + ap.alignFrame.showContactMapTree(alignmentAnnotation, cm); + ap.alignFrame.setProgressBar(null, progBar); } }).start(); }