public static void addJ2SBinaryType(String ext)
{
-
- jsutil.addBinaryFileType(ext);
+ if (isJS())
+ {
+ jsutil.addBinaryFileType(ext);
+ }
}
/**
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 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()
{
- if (!isJS())
+ if (isJS())
{
- return;
- }
jsutil.loadResourceIfClassUnknown("core/core_stevesoft.z.js",
"com.stevesoft.pat.Regex");
+ }
}
public static Regex newRegex(String searchString, String replaceString)
*
* @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 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.