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:
c2f5a22
)
JAL-3253 reconciled with Jalview-JS/develop (cosmetic changes)
Jalview-JS/JAL-3253-applet-SwingJS-3.2.9.v1e
author
BobHanson
<hansonr@stolaf.edu>
Wed, 8 Apr 2020 15:05:44 +0000
(10:05 -0500)
committer
BobHanson
<hansonr@stolaf.edu>
Wed, 8 Apr 2020 15:05:44 +0000
(10:05 -0500)
src/jalview/util/Platform.java
patch
|
blob
|
history
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
389768f
..
99c82a4
100644
(file)
--- a/
src/jalview/util/Platform.java
+++ b/
src/jalview/util/Platform.java
@@
-35,19
+35,19
@@
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.HashMap;
-import java.util.HashSet;
import java.util.Properties;
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 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;
import com.stevesoft.pat.Regex;
import swingjs.api.JSUtilI;
@@
-73,7
+73,7
@@
public class Platform
private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
isWin = null;
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)
/**
* added to group mouse events into Windows and nonWindows (mac, unix, linux)
@@
-130,18
+130,18
@@
public class Platform
return (isNoJSWin == null ? (isNoJSWin = !isJS && isWin()) : isNoJSWin);
}
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;
+ }
/**
*
/**
*
@@
-331,6
+331,9
@@
public class Platform
break;
}
}
break;
}
}
+
+ ////// jsutil additions, simplifications
+
public static void cacheFileData(String path, Object data)
{
if (isJS())
public static void cacheFileData(String path, Object data)
{
if (isJS())
@@
-505,7
+508,8
@@
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)
@@
-634,6
+638,9
@@
public class Platform
return p1.equals(p2);
}
return p1.equals(p2);
}
+ ///// new methods from applet branch only
+
+
public static URL getDocumentBase()
{
return (isJS() ? jsutil.getDocumentBase() : null);
public static URL getDocumentBase()
{
return (isJS() ? jsutil.getDocumentBase() : null);