git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3691 toUpperCase(Locale.ROOT) for all standard file format operations
[jalview.git]
/
src
/
jalview
/
util
/
Platform.java
diff --git
a/src/jalview/util/Platform.java
b/src/jalview/util/Platform.java
index
ade9d87
..
71d798d
100644
(file)
--- a/
src/jalview/util/Platform.java
+++ b/
src/jalview/util/Platform.java
@@
-52,7
+52,7
@@
public class Platform
false;
private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
false;
private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null,
- isWin = null;
+ isWin = null, isLinux = null;
private static Boolean isHeadless = null;
private static Boolean isHeadless = null;
@@
-81,6
+81,18
@@
public class Platform
}
/**
}
/**
+ * added to check LaF for Linux
+ *
+ * @return
+ */
+ public static boolean isLinux()
+ {
+ return (isLinux == null
+ ? (isLinux = (System.getProperty("os.name").indexOf("Linux") >= 0))
+ : isLinux);
+ }
+
+ /**
*
* @return true if HTML5 JavaScript
*/
*
* @return true if HTML5 JavaScript
*/
@@
-337,7
+349,7
@@
public class Platform
public static byte[] getFileBytes(File f)
{
public static byte[] getFileBytes(File f)
{
- return /** @j2sNative f && f._bytes || */
+ return /** @j2sNative f && swingjs.JSUtil.getFileBytes$java_io_File(f) || */
null;
}
null;
}
@@
-375,8
+387,10
@@
public class Platform
}
@SuppressWarnings("unused")
byte[] bytes = getFileAsBytes(urlstring);
}
@SuppressWarnings("unused")
byte[] bytes = getFileAsBytes(urlstring);
+ // TODO temporary doubling of 秘bytes and _bytes;
+ // just remove _bytes when new transpiler has been installed
/**
/**
- * @j2sNative f._bytes = bytes;
+ * @j2sNative f.\u79d8bytes = f._bytes = bytes;
*/
return true;
}
*/
return true;
}
@@
-428,10
+442,8
@@
public class Platform
public static String getUniqueAppletID()
{
public static String getUniqueAppletID()
{
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
/**
/**
- * @j2sNative return g.html5Applet._uniqueId;
+ * @j2sNative return swingjs.JSUtil.getApplet$()._uniqueId;
*
*/
return null;
*
*/
return null;
@@
-452,13
+464,12
@@
public class Platform
{
return;
}
{
return;
}
- @SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
String id = getUniqueAppletID();
String key = "", value = "";
/**
String id = getUniqueAppletID();
String key = "", value = "";
/**
- * @j2sNative var info = g.html5Applet.__Info || {}; for (var key in info) {
- * if (key.indexOf(prefix) == 0) { value = "" + info[key];
+ * @j2sNative var info = swingjs.JSUtil.getApplet$().__Info || {}; for (var
+ * key in info) { if (key.indexOf(prefix) == 0) { value = "" +
+ * info[key];
*/
System.out.println(
*/
System.out.println(
@@
-544,23
+555,22
@@
public class Platform
* @param is
* @param outFile
* @throws IOException
* @param is
* @param outFile
* @throws IOException
- * if the file cannot be created or there is a problem reading the
- * input stream.
+ * if the file cannot be created or there is a problem
+ * reading the input stream.
*/
public static void streamToFile(InputStream is, File outFile)
throws IOException
{
*/
public static void streamToFile(InputStream is, File outFile)
throws IOException
{
+ if (isJS() && /**
+ * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) &&
+ */
+ true)
+ {
+ return;
+ }
FileOutputStream fio = new FileOutputStream(outFile);
try
{
FileOutputStream fio = new FileOutputStream(outFile);
try
{
- if (isJS()
- && /**
- * @j2sNative outFile.setBytes$O && outFile.setBytes$O(is) &&
- */
- true)
- {
- return;
- }
byte[] bb = new byte[32 * 1024];
int l;
while ((l = is.read(bb)) > 0)
byte[] bb = new byte[32 * 1024];
int l;
while ((l = is.read(bb)) > 0)