[x3d-public] X3DGroupingNode interface has no method setIS in X3DJSAIL, FYI
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Thu Jan 17 05:27:52 PST 2019
On 1/14/2019 12:32 PM, John Carlson wrote:
> I there any desire to add methods on the fly in Java, instead of having them in a declared API? See Java Proxy class.
Indeed there is a lot of capability in Java for this kind of thing, it's called reflection. Proxy is part of that.
The Java™ Tutorials ,Trail: The Reflection API
https://docs.oracle.com/javase/tutorial/reflect
This is quite involved, both powerful and brittle if content being reflected into object classes and methods is imperfect. I found the following book to be excellent and essential:
Java Reflection in Action
Ira R. Forman and Nate Forman, October 2004
https://www.manning.com/books/java-reflection-in-action
Reflection is used in X3DLoaderObjectclass, which parses an XML document using DOM and then traverses to create X3DJSAIL objects.
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/X3DLoaderObject.html
This was one of the harder parts of X3DJSAIL development. I thought it was pretty good until we started pushing the 300+ X3D Examples Archives scenes through it, that uncovered a lot of overlooked cases which were then fixable.
As we add nodes and fields to X3Dv4 (such as HAnimMotion) support needs to be included through manual programming. Given the extreme craft needed for that class, there is no way we want to expose it to end users.
That said, X3DJSAIL is strictly Plain Old Java Objects (POJO) so Java programmers can do anything they want. X3D simply becomes a utility library capability.
Have fun with X3D and Java!
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
More information about the x3d-public
mailing list