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 (parent:
f6d94f4
)
JAL-3560 Platform fixes.
author
BobHanson
<hansonr@stolaf.edu>
Sat, 21 Mar 2020 23:39:59 +0000
(18:39 -0500)
committer
BobHanson
<hansonr@stolaf.edu>
Sat, 21 Mar 2020 23:39:59 +0000
(18:39 -0500)
src/jalview/util/Platform.java
patch
|
blob
|
history
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
8498e7f
..
b779c20
100644
(file)
--- a/
src/jalview/util/Platform.java
+++ b/
src/jalview/util/Platform.java
@@
-452,8
+452,10
@@
public class Platform
public static void addJ2SBinaryType(String ext)
{
public static void addJ2SBinaryType(String ext)
{
-
- jsutil.addBinaryFileType(ext);
+ if (isJS())
+ {
+ jsutil.addBinaryFileType(ext);
+ }
}
/**
}
/**
@@
-510,8
+512,7
@@
public class Platform
public static Object parseJSON(String json) throws ParseException
{
public static Object parseJSON(String json) throws ParseException
{
- return (isJS() ? JSON.parse(json)
- : new JSONParser().parse(json));
+ return (isJS() ? JSON.parse(json) : new JSONParser().parse(json));
}
public static Object parseJSON(Reader r)
}
public static Object parseJSON(Reader r)
@@
-627,22
+628,20
@@
public class Platform
public static void ensureJmol()
{
public static void ensureJmol()
{
- if (!isJS())
+ if (isJS())
{
{
- return;
+ jsutil.loadResourceIfClassUnknown("core/core_jvjmol.z.js",
+ "org.jmol.viewer.Viewer");
}
}
- jsutil.loadResourceIfClassUnknown("core/core_jvjmol.z.js",
- "org.jmol.viewer.Viewer");
}
public static void ensureRegex()
{
}
public static void ensureRegex()
{
- if (!isJS())
+ if (isJS())
{
{
- return;
- }
jsutil.loadResourceIfClassUnknown("core/core_stevesoft.z.js",
"com.stevesoft.pat.Regex");
jsutil.loadResourceIfClassUnknown("core/core_stevesoft.z.js",
"com.stevesoft.pat.Regex");
+ }
}
public static Regex newRegex(String searchString, String replaceString)
}
public static Regex newRegex(String searchString, String replaceString)
@@
-756,7
+755,7
@@
public class Platform
*
* @return Map for static singleton classes unique to a given applet
*/
*
* @return Map for static singleton classes unique to a given applet
*/
- public static HashMap<?,?> getJSSingletons()
+ public static HashMap<?, ?> getJSSingletons()
{
return (isJS() ? jsutil.getJSContext("jssingletons") : null);
}
{
return (isJS() ? jsutil.getJSContext("jssingletons") : null);
}
@@
-772,7
+771,7
@@
public class Platform
{
return new HashSet<>(16, 0.75f);
}
{
return new HashSet<>(16, 0.75f);
}
-
+
/**
* Switch the flag in SwingJS to use or not use the JavaScript Map object in
* any Hashtable, HashMap, or HashSet. Default is enabled.
/**
* Switch the flag in SwingJS to use or not use the JavaScript Map object in
* any Hashtable, HashMap, or HashSet. Default is enabled.