From: hansonr Date: Fri, 2 Nov 2018 06:50:46 +0000 (-0500) Subject: JAXB marshalling by JavaScript successfully unmarshalled in Java X-Git-Tag: Release_2_11_4_0~45^2~18^2~429 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d14b06cdb877e90cd67b96cb3e7b580992dd8dab;p=jalview.git JAXB marshalling by JavaScript successfully unmarshalled in Java JalviewJS session save JAXB; Jalview (Java app) drag drop. --- diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index 390e8cd..f244d14 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -338,7 +338,8 @@ public class FileLoader implements Runnable "IMPLEMENTATION ERROR: Cannot read consecutive Jalview XML projects from a stream."); // We read the data anyway - it might make sense. } - alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(file); + // BH 2018 switch to File object here instead of filename + alignFrame = new Jalview2XML(raiseGUI).loadJalviewAlign(selectedFile == null ? file : selectedFile); } else { diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index 42328b8..194cbf2 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -130,6 +130,7 @@ import java.awt.Color; import java.awt.Font; import java.awt.Rectangle; import java.io.BufferedReader; +import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; @@ -2478,7 +2479,7 @@ public class Jalview2XML * @param file * - HTTP URL or filename */ - public AlignFrame loadJalviewAlign(final String file) + public AlignFrame loadJalviewAlign(final Object file) { jalview.gui.AlignFrame af = null; @@ -2522,9 +2523,33 @@ public class Jalview2XML return af; } - private jarInputStreamProvider createjarInputStreamProvider( - final String file) throws MalformedURLException + @SuppressWarnings("unused") +private jarInputStreamProvider createjarInputStreamProvider( + final Object ofile) throws MalformedURLException { + + // BH 2018 allow for bytes already attached to File object + final String file = ofile.toString(); + byte[] bytes = /** @j2sNative ofile._bytes ||*/null; + if (bytes != null) { + + return new jarInputStreamProvider() + { + + @Override + public JarInputStream getJarInputStream() throws IOException + { + return new JarInputStream(new ByteArrayInputStream(bytes)); + } + + @Override + public String getFilename() + { + return file; + } + }; + + } URL url = null; errorMessage = null; uniqueSetSuffix = null; diff --git a/swingjs/SwingJS-site.zip b/swingjs/SwingJS-site.zip index c56ecfc..7774a16 100644 Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ diff --git a/swingjs/net.sf.j2s.core.jar b/swingjs/net.sf.j2s.core.jar index 4827b38..cbd218a 100644 Binary files a/swingjs/net.sf.j2s.core.jar and b/swingjs/net.sf.j2s.core.jar differ diff --git a/swingjs/timestamp b/swingjs/timestamp index d1276fe..38bba3f 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20181101203541 +20181105193243 diff --git a/swingjs/ver/3.2.4/SwingJS-site.zip b/swingjs/ver/3.2.4/SwingJS-site.zip index c56ecfc..7774a16 100644 Binary files a/swingjs/ver/3.2.4/SwingJS-site.zip and b/swingjs/ver/3.2.4/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.4/net.sf.j2s.core.jar b/swingjs/ver/3.2.4/net.sf.j2s.core.jar index 4827b38..cbd218a 100644 Binary files a/swingjs/ver/3.2.4/net.sf.j2s.core.jar and b/swingjs/ver/3.2.4/net.sf.j2s.core.jar differ diff --git a/swingjs/ver/3.2.4/timestamp b/swingjs/ver/3.2.4/timestamp index d1276fe..38bba3f 100644 --- a/swingjs/ver/3.2.4/timestamp +++ b/swingjs/ver/3.2.4/timestamp @@ -1 +1 @@ -20181101203541 +20181105193243 diff --git a/temp/jv11.5p.jvx b/temp/jv11.5p.jvx new file mode 100644 index 0000000..d238a46 Binary files /dev/null and b/temp/jv11.5p.jvx differ diff --git a/temp/site-bh-2018.08.26.zip b/temp/site-bh-2018.08.26.zip deleted file mode 100644 index 00fb985..0000000 Binary files a/temp/site-bh-2018.08.26.zip and /dev/null differ