From: Jim Procter Date: Fri, 1 Oct 2021 16:36:35 +0000 (+0100) Subject: JAL-3616 show name of structure viewer in ‘new view’ button X-Git-Tag: Release_2_11_2_1~76 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fa8a0ce92e350f285da4e02da130e2cc1ffee85a;p=jalview.git JAL-3616 show name of structure viewer in ‘new view’ button --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 555bfbf..46ebb73 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -118,6 +118,7 @@ action.paste_annotations = Paste Annotations action.format = Format action.select = Select action.new_view = New View +action.new_structure_view_with = Open new structure view with {0} action.close = Close action.add = Add action.save_as = Save as... diff --git a/src/jalview/gui/StructureViewer.java b/src/jalview/gui/StructureViewer.java index 617706a..7b1864b 100644 --- a/src/jalview/gui/StructureViewer.java +++ b/src/jalview/gui/StructureViewer.java @@ -80,6 +80,7 @@ public class StructureViewer return sv; } + @Override public String toString() { @@ -89,7 +90,11 @@ public class StructureViewer } return "New View"; } - public ViewerType getViewerType() + /** + * + * @return ViewerType for currently configured structure viewer + */ + public static ViewerType getViewerType() { String viewType = Cache.getDefault(Preferences.STRUCTURE_DISPLAY, ViewerType.JMOL.name()); @@ -366,6 +371,7 @@ public class StructureViewer return viewer; } + public boolean isBusy() { if (sview != null) diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index ccccfb4..70d99c1 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -465,7 +465,9 @@ public abstract class GStructureChooser extends JPanel } }); - btn_newView = new JButton(MessageManager.getString("action.new_view")); + btn_newView = new JButton( + MessageManager.formatMessage("action.new_structure_view_with", + StructureViewer.getViewerType().toString())); btn_newView.setFont(VERDANA_12); btn_newView.addActionListener(new java.awt.event.ActionListener() { @@ -486,6 +488,8 @@ public abstract class GStructureChooser extends JPanel } } }); + + // TODO: JAL-3898 - get list of available external programs to view structures with btn_add = new JButton(MessageManager.getString("action.add")); btn_add.setFont(VERDANA_12);