From 5431cd565122d8baa2ca28e35500f2b5291e281f Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 26 May 2016 11:06:02 +0100 Subject: [PATCH] JAL-1911 bugfix - do not save i18n text in preference file --- src/jalview/bin/Cache.java | 2 +- src/jalview/gui/Preferences.java | 2 +- src/jalview/gui/TreePanel.java | 20 +++++++++++++++++++- src/jalview/io/HtmlSvgOutput.java | 3 ++- src/jalview/util/ImageMaker.java | 3 ++- src/jalview/ws/dbsources/Pdb.java | 10 +++++----- 6 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 7911cd5..38aa55f 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -426,7 +426,7 @@ public class Cache System.out .println("Jalview Version: " + codeVersion + codeInstallation); - Pdb.setCurrentDefaultFomart(jalview.bin.Cache.getDefault( + Pdb.setCurrentDefaultFormat(jalview.bin.Cache.getDefault( "DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT)); // jnlpVersion will be null if we're using InstallAnywhere // Dont do this check if running in headless mode diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 6b2d3c4..ea090a3 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -360,7 +360,7 @@ public class Preferences extends GPreferences * Set Output tab defaults */ epsRendering - .addItem(MessageManager.getString("label.prompt_each_time")); +.addItem("Prompt each time"); epsRendering.addItem(MessageManager.getString("label.lineart")); epsRendering.addItem(MessageManager.getString("action.text")); epsRendering.setSelectedItem(Cache.getDefault("EPS_RENDERING", diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index 9522144..ae73baa 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -161,6 +161,7 @@ public class TreePanel extends GTreePanel av.addPropertyChangeListener(new java.beans.PropertyChangeListener() { + @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals("alignment")) @@ -196,6 +197,7 @@ public class TreePanel extends GTreePanel } + @Override public void viewMenu_menuSelected() { buildAssociatedViewMenu(); @@ -231,6 +233,7 @@ public class TreePanel extends GTreePanel buttonGroup.add(item); item.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { treeCanvas.applyToAllViews = false; @@ -249,6 +252,7 @@ public class TreePanel extends GTreePanel itemf.setSelected(treeCanvas.applyToAllViews); itemf.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent evt) { treeCanvas.applyToAllViews = itemf.isSelected(); @@ -276,6 +280,7 @@ public class TreePanel extends GTreePanel } } + @Override public void run() { @@ -389,6 +394,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void textbox_actionPerformed(ActionEvent e) { CutAndPasteTransfer cap = new CutAndPasteTransfer(); @@ -434,6 +440,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void saveAsNewick_actionPerformed(ActionEvent e) { JalviewFileChooser chooser = new JalviewFileChooser( @@ -474,12 +481,14 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void printMenu_actionPerformed(ActionEvent e) { // Putting in a thread avoids Swing painting problems treeCanvas.startPrinting(); } + @Override public void originalSeqData_actionPerformed(ActionEvent e) { if (!tree.hasOriginalSequenceData()) @@ -547,6 +556,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void fitToWindow_actionPerformed(ActionEvent e) { treeCanvas.fitToWindow = fitToWindow.isSelected(); @@ -637,6 +647,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void font_actionPerformed(ActionEvent e) { if (treeCanvas == null) @@ -666,6 +677,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void distanceMenu_actionPerformed(ActionEvent e) { treeCanvas.setShowDistances(distanceMenu.isSelected()); @@ -677,6 +689,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void bootstrapMenu_actionPerformed(ActionEvent e) { treeCanvas.setShowBootstrap(bootstrapMenu.isSelected()); @@ -688,6 +701,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void placeholdersMenu_actionPerformed(ActionEvent e) { treeCanvas.setMarkPlaceholders(placeholdersMenu.isSelected()); @@ -699,6 +713,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void epsTree_actionPerformed(ActionEvent e) { boolean accurateText = true; @@ -708,7 +723,8 @@ public class TreePanel extends GTreePanel // If we need to prompt, and if the GUI is visible then // Prompt for EPS rendering style - if (renderStyle.equalsIgnoreCase("Prompt each time") + if (renderStyle.equalsIgnoreCase(MessageManager + .getString("label.prompt_each_time")) && !(System.getProperty("java.awt.headless") != null && System .getProperty("java.awt.headless").equals("true"))) { @@ -772,6 +788,7 @@ public class TreePanel extends GTreePanel * @param e * DOCUMENT ME! */ + @Override public void pngTree_actionPerformed(ActionEvent e) { int width = treeCanvas.getWidth(); @@ -828,6 +845,7 @@ public class TreePanel extends GTreePanel tree.applyToNodes(new NodeTransformI() { + @Override public void transform(BinaryNode node) { if (node instanceof SequenceNode diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index e554b8e..3bd175b 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -124,7 +124,8 @@ public class HtmlSvgOutput } } - if (renderStyle.equalsIgnoreCase("lineart")) + if (renderStyle.equalsIgnoreCase(MessageManager + .getString("label.lineart"))) { g1.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE, SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR); diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index b7aa4ca..9bc732b 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -272,7 +272,8 @@ MessageManager.formatMessage( } } - if (renderStyle.equalsIgnoreCase("lineart")) + if (renderStyle.equalsIgnoreCase(MessageManager + .getString("label.lineart"))) { ig2.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE, SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR); diff --git a/src/jalview/ws/dbsources/Pdb.java b/src/jalview/ws/dbsources/Pdb.java index 4a089f7..f41d86a 100644 --- a/src/jalview/ws/dbsources/Pdb.java +++ b/src/jalview/ws/dbsources/Pdb.java @@ -132,11 +132,11 @@ public class Pdb extends EbiFileRetrievedProxy stopQuery(); return null; } - String ext = getCurrentDefaultFomart().equalsIgnoreCase("mmcif") ? ".cif" + String ext = getCurrentDefaultFormat().equalsIgnoreCase("mmcif") ? ".cif" : ".xml"; EBIFetchClient ebi = new EBIFetchClient(); file = ebi.fetchDataAsFile("pdb:" + id, - getCurrentDefaultFomart().toLowerCase(), "raw", ext) + getCurrentDefaultFormat().toLowerCase(), "raw", ext) .getAbsolutePath(); stopQuery(); if (file == null) @@ -148,7 +148,7 @@ public class Pdb extends EbiFileRetrievedProxy pdbAlignment = new FormatAdapter().readFile(file, jalview.io.AppletFormatAdapter.FILE, - getCurrentDefaultFomart()); + getCurrentDefaultFormat()); if (pdbAlignment != null) { List toremove = new ArrayList(); @@ -263,12 +263,12 @@ public class Pdb extends EbiFileRetrievedProxy return 0; } - public static String getCurrentDefaultFomart() + public static String getCurrentDefaultFormat() { return currentDefaultFomart; } - public static void setCurrentDefaultFomart(String currentDefaultFomart) + public static void setCurrentDefaultFormat(String currentDefaultFomart) { Pdb.currentDefaultFomart = currentDefaultFomart; } -- 1.7.10.2