<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>JSON attached.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Sent: </b>Wednesday, February 15, 2017 5:25 PM<br><b>To: </b><a href="mailto:brutzman@nps.edu">Don Brutzman</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a>; <a href="mailto:roy.walmsley@ntlworld.com">Roy Walmsley</a><br><b>Subject: </b>Re: X3DJSAIL. Use of fields in ProtoInterface. addField() nolongerworks.</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>What I'm trying to do: add an MFNode or SFNode typed field to a ProtoInterface with addField().  If this is not the right thing to do, let me know.   Apparently, when you add the field, it validates it, then calls setValue.   SetValue is not the right thing to call for a SFNode or MFNode, afaik.   I am just reading the error message and not the X3DJSAIL code.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I hope this helps!</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>BTW, if you want to use my JavaSerializer.js, I should be able to give you any license you want.   It's currently licensed with a BSD license.   It does the job of DOM -> Java program   Obviously a rewrite in Java is desirable, especially the mapToMethod could be improved.  If you are going to write something using reflection, I encourage you to provide an output Java version for source code control.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Oh, and I heartily disagree with creating a Java version by hand :).  It will likely get blown away next time I convert from JSON.  I regularly remove all java files except the for those used by running the X3dToJson.xslt</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You probably have an attachment with abox.json in it, but I will try to provide a copy.</p></div><div><p class=MsoNormal>John</p><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Feb 15, 2017 12:32 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>On 2/14/2017 8:08 PM, <a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a> wrote:</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>Don,<br><br>Are you requiring the Java 8 syntax for X3DJSAIL application programmers?  Thanks!</p></blockquote><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>No restrictions.  The declarative approach is an interesting style and no backwards compatibility with classical programming practice is sacrificed.<br><br>also: Thank You for continuing reports such as the following, John.  i first need to get out of "tall grass" of DOM + Java Reflection but will keep getting back to these and sorting each one out, they are very important.</p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>*From: *<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a> <mailto:<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>*Sent: *Tuesday, February 14, 2017 11:00 PM<br>*To: *Don Brutzman <mailto:<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>>; Roy Walmsley <mailto:<a href="mailto:roy.walmsley@ntlworld.com" target="_blank">roy.walmsley@ntlworld.com</a>>; X3D Graphics public mailing list <mailto:<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>*Subject: *X3DJSAIL. Use of fields in ProtoInterface. addField() no longerworks.</p><div><p class=MsoNormal><br><br>Please provide example of calling setChildren() with multiple field objects, or perhaps allow addChildren().  Haven’t spent too much time on this, addChildren() may work.  Perhaps fix addField() to allow MFNode and SFNode, or remove from API??  Have validate call setChildren or addChildren for MFNodes and SFNodes?  Many choices here. Modify fieldObject to not throw an exception of addChildren() is called on fieldObject?</p></div></blockquote><p class=MsoNormal><br>preliminary answer: please see the HelloWorldProgram.java for many example invocations.<br><br>secondary answer:  the pre-existing Java SAI interfaces are sometimes more restrictive that we might hope.  Working document to keep track of issues at<br><br>        <a href="http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#SpecificationChanges" target="_blank">http://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#SpecificationChanges</a><br><br>        <a href="http://www.web3d.org/specifications/java/X3dJavaSpecificationChangesAndIssues.txt" target="_blank">http://www.web3d.org/specifications/java/X3dJavaSpecificationChangesAndIssues.txt</a><br><br>third answer: have been experimenting with JSAIL utility methods, such as pipelined addChild which can be easier to use sometimes.<br><br>        <a href="http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Grouping/GroupObject.html#addChild-org.web3d.x3d.sai.Core.X3DChildNode-" target="_blank">http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Grouping/GroupObject.html#addChild-org.web3d.x3d.sai.Core.X3DChildNode-</a><br><br>fourth answer: protos are especially tricky but definitely converging to meet use cases.  work in progress, let's keep pushing!!  8)</p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br><br></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>Abox.java (attached)<br><br>Exception in thread "main" org.web3d.x3d.sai.InvalidProtoException: field name='myShape' with type='MFNode' cannot have any simple-type value (newValue='').  Use setChildren() method instead.<br><br>        at org.web3d.x3d.jsail.Core.fieldObject.setValue(fieldObject.java:770)<br>        at org.web3d.x3d.jsail.Core.fieldObject.validate(fieldObject.java:1044)<br>        at org.web3d.x3d.jsail.Core.ProtoInterfaceObject.addField(ProtoInterfaceObject.java:466)<br>        at abox.main(abox.java:88)</p></blockquote><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>not quite understanding what you are trying to do here...<br><br>suggested approach:<br>- you will hopefully find an existing pattern (or TODO comment) in HelloWorldProgram<br>- show regular-encoding version of your goal scene for understanding (.x3d or .json or .x3dv or .wrl)<br>- let's build the java manually to match, once understood then go for the pattern</p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>I noted the change to the package structure.</p></blockquote><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>glad to hear, again thanks.<br><br>all the best, Don<span style='color:#888888'><br>-- <br>Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" target="_blank">+1.831.656.2149</a><br>X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" target="_blank">http://faculty.nps.edu/brutzman</a></span></p></blockquote></div></div></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>