[x3d-public] Patch for X3DJSAIL

John Carlson yottzumm at gmail.com
Mon Oct 2 02:52:05 PDT 2017


Comments below in red.

John
Sent from Mail for Windows 10

From: Don Brutzman
Sent: Sunday, October 1, 2017 10:44 PM
To: John Carlson
Cc: x3d-public at web3d.org
Subject: Re: Patch for X3DJSAIL

On 9/28/2017 8:11 PM, John Carlson wrote:
> Patch for CreateX3dSceneAccessInterfaceJava.xslt
> 
> Important things:
> 
>  1. <String>’s on line 340

OK have modified it to match your preferred form.  Not sure why though, prior 
construct didn't have any warnings.  Plus similar constructs exist for other 
types.  Is this a pyjnius transcoding issue?

340c340
< <xsl:text disable-output-escaping="yes">new 
ArrayList<>(Arrays.asList(</xsl:text><!-- ArrayList<> -->
---
> <xsl:text disable-output-escaping="yes">new 
ArrayList<String>(Arrays.<String>asList(</xsl:text><!-- ArrayList<> -->

I believe that I was getting warnings with findbugs or jsweet.

>  2. Imports

Please advise what this is for - perhaps add a more verbose comment as well?

For executing Nashorn script (additions for JavaScript output, to replace X3dToES5.xslt).  Required for additional patches. I believe all the rest of the patches are for X3DObject.java


Also please reconfirm class of interest, there have been some edits so I didn't 
want to put it in the wrong place.

762a763,766
> // Script operations
> import javax.script.ScriptEngineManager;
> import javax.script.ScriptEngine;
> import javax.script.ScriptException;
2958c2962

>  3. The rest would be nice to have, because I have to keep updating the
>     stylesheet, but I don’t have a “working” version yet.

Am reluctant to change directory structure, the entire build process depends on 
it and not sure why you need it:

This is just my diffs.  If you made it a parameter instead of a variable, it would work better for me.

41c41
< 	<xsl:variable name="saiPackageDirectorySource"> 
<xsl:text>src/org/web3d/x3d/sai</xsl:text></xsl:variable>
---
> 	<xsl:variable name="saiPackageDirectorySource"> 
<xsl:text>src/main/java/org/web3d/x3d/sai</xsl:text></xsl:variable>
46c46
< 	<xsl:variable name="concretePackageDirectorySource"> 
<xsl:text>src/org/web3d/x3d/jsail</xsl:text></xsl:variable>
---
> 	<xsl:variable name="concretePackageDirectorySource"> 
<xsl:text>src/main/java/org/web3d/x3d/jsail</xsl:text></xsl:variable>

The following change in X3DObject was superfluous and not needed:

	FILE_EXTENSION_JAVASCRIPT
to
	X3DObject.FILE_EXTENSION_JAVASCRIPT

> It does create an appropriate JavaScript file, butX3DJSAIL doesn’t work with this command:
> 
> $ java -cp 
> "target/X3DJSONLD-1.0-SNAPSHOT.jar;../pythonSAI/X3DJSAIL.3.3.full.jar;saxon9he.jar" 
> net.x3djsonld.data.abox js growl.js
> 
> [ growl.sh in X3DJSONLD ]

Last nights changes should fix any need to have saxon9he.jar in classpath.  Use 
X3DJSAIL.3.3.full.jar to test that out.  Don't miss the ant build changes in 
parent stylesheets/ directory, they are significant.  Online at

I have a separate build for X3DJSAIL using maven which does not use the fat jar. Hopefully I will be able to continue using that, and it will not be required that X3DJSAIL code be sealed.


https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/CreateX3dSceneAccessInterfaceJava.xslt

Updated today: added -validate switch and various improvements for CommandLine 
and X3DLoaderObject.  Also noted some missing min/max inclusive/inclusive values 
in X3D Unified Object Model; these are now listed in X3D XML Schemas (3.2 3.3 
4.0), the object model file, and corresponding X3DJSAIL validation methods.

I tried to apply your patch using Netbeans > Tools > Apply Diff Patch but it 
didn't work, probably because I had made too many changes.

Am hoping you can redo the patch or (likely better) just send me the plain code 
blocks and indicate class name(s) where to add them.

Sending the X3DObject.java attached. No diff available yet.

> Attached,
> 
> John

thanks, let's keep iterating please.  8)

p.s. just released: Java 9.  haven't tried it yet.

	https://docs.oracle.com/javase/9/whatsnew/toc.htm

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171002/7b85e75b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: X3DObject.java
Type: application/octet-stream
Size: 109251 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171002/7b85e75b/attachment-0001.obj>


More information about the x3d-public mailing list