From 28a49b46297ea3228ae90bb86dbc4b73f5130fb5 Mon Sep 17 00:00:00 2001 From: BobHanson Date: Mon, 8 Jun 2020 16:59:00 -0500 Subject: [PATCH 1/1] Plartform update --- src/jalview/util/Platform.java | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index 728110e..eec1e2a 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -35,6 +35,8 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; +import java.util.Locale; +import java.util.Map; import java.util.Properties; import java.util.logging.ConsoleHandler; import java.util.logging.Level; @@ -49,6 +51,8 @@ import com.stevesoft.pat.Regex; import swingjs.api.JSUtilI; +////////THIS FILE IS NOW OUTDATED ///////////// + /** * System platform information used by Applet and Application * @@ -639,7 +643,7 @@ public class Platform String key = ""; String value = ""; @SuppressWarnings("unused") - Object info = jsutil.getAppletAttribute("__Info"); + Object info = getAppletInfo(null); /** * @j2sNative for (key in info) { value = info[key]; */ @@ -810,4 +814,22 @@ public class Platform } + @SuppressWarnings("unchecked") + public static Object getAppletInfo(String key) + { + return (isJS ? (Map) jsutil.getAppletInfo(key) : null); + } + + /** + * Option to avoid unnecessary seeking of nonexistent resources in JavaScript. + * Works in Java as well. + * + * @param loc + * @return + */ + public static Locale getLocaleOrNone(Locale loc) + { + return (isJS && loc.getCountry() == "en" ? new Locale("") : loc); + } + } -- 1.7.10.2