git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f8e4180
)
Plartform update
author
BobHanson
<hansonr@stolaf.edu>
Mon, 8 Jun 2020 21:59:00 +0000
(16:59 -0500)
committer
BobHanson
<hansonr@stolaf.edu>
Mon, 8 Jun 2020 21:59:00 +0000
(16:59 -0500)
src/jalview/util/Platform.java
patch
|
blob
|
history
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
728110e
..
eec1e2a
100644
(file)
--- 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.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;
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;
import swingjs.api.JSUtilI;
+////////THIS FILE IS NOW OUTDATED /////////////
+
/**
* System platform information used by Applet and Application
*
/**
* System platform information used by Applet and Application
*
@@
-639,7
+643,7
@@
public class Platform
String key = "";
String value = "";
@SuppressWarnings("unused")
String key = "";
String value = "";
@SuppressWarnings("unused")
- Object info = jsutil.getAppletAttribute("__Info");
+ Object info = getAppletInfo(null);
/**
* @j2sNative for (key in info) { value = info[key];
*/
/**
* @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<String, Object>) 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);
+ }
+
}
}