From b25d6f028eaea9c382500355b5d118cd40799a8e Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 26 May 2023 15:11:28 +0100 Subject: [PATCH] =?utf8?q?JAL-4134=20internationalise=20popup=20menu=20entri?= =?utf8?q?es=20and=20show=20a=20=E2=80=98tree=20calculation=20in=20progress=E2?= =?utf8?q?=80=99=20progress=20bar=20in=20align=20panel.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- resources/lang/Messages.properties | 10 +++++++++- src/jalview/gui/AnnotationLabels.java | 16 ++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) 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(); } -- 1.7.10.2