import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.Properties;
-import java.util.Set;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import com.stevesoft.pat.Regex;
import swingjs.api.JSUtilI;
private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
isWin = null;
- // private static Boolean isHeadless = null;
+ private static Boolean isHeadless = null;
/**
* added to group mouse events into Windows and nonWindows (mac, unix, linux)
return (isNoJSWin == null ? (isNoJSWin = !isJS && isWin()) : isNoJSWin);
}
- // /**
- // *
- // * @return true if we are running in non-interactive no UI mode
- // */
- // public static boolean isHeadless()
- // {
- // if (isHeadless == null)
- // {
- // isHeadless = "true".equals(System.getProperty("java.awt.headless"));
- // }
- // return isHeadless;
- // }
+ /**
+ *
+ * @return true if we are running in non-interactive no UI mode
+ */
+ public static boolean isHeadless()
+ {
+ if (isHeadless == null)
+ {
+ isHeadless = "true".equals(System.getProperty("java.awt.headless"));
+ }
+ return isHeadless;
+ }
/**
*
break;
}
}
+
+ ////// jsutil additions, simplifications
+
public static void cacheFileData(String path, Object data)
{
if (isJS())
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)
return p1.equals(p2);
}
+ ///// new methods from applet branch only
+
+
public static URL getDocumentBase()
{
return (isJS() ? jsutil.getDocumentBase() : null);