[x3d-public] x3d java sai. Don't know how to add IMPORT and EXPORT to objects - fixed

Don Brutzman brutzman at nps.edu
Mon Jan 2 13:36:57 PST 2017


You are right, these objects are missing from allowed X3DChildrenNode typing required by addChildren methods.

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Networking/EXPORTObject.html

	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/java/Networking/IMPORTObject.html

There is a bit of an X3D Object Model issue here, how to make them compatible.  Distinctions: no DEF USE or cssClass, for example.

Probably best approach will be to handle them similarly to ROUTEObject.

Have added appropriate typing and also generated relevant run-time validation tests.

Tested sat in latest build.  Excerpts from updated HelloWorldProgram.java follow:

===================================
http://www.web3d.org/specifications/java/examples/HelloWorldProgram.java

String            inlineSceneDef = "inlineSceneDef";
InlineObject         inlineScene = new InlineObject(inlineSceneDef);
IMPORTObject     importStatement = new IMPORTObject();
EXPORTObject     exportStatement = new EXPORTObject();

// Inline/IMPORT/EXPORT validation testing (cannot be self-referential or may cause recursion error)
inlineScene.setUrl("someOtherScene.x3d");
importStatement.setInlineDEF(inlineSceneDef).setImportedDEF(worldInfoDEF).setAS(worldInfoDEF + "2"); // overloaded DEF test sat
exportStatement.setLocalDEF(worldInfoDEF);
scene.addChildren(inlineScene);
scene.addChildren(importStatement);
scene.addChildren(exportStatement);
===================================

this also led to some helpful thinking on X3D Security, issues posted separately.

	X3D Resources: Security
	http://www.web3d.org/x3d/content/examples/X3dResources.html#Security

Thanks as ever for the in-depth testing John.

On 1/2/2017 3:16 AM, yottzumm at gmail.com wrote:
> examples\Basic\development\ImportExportSyntax.java:125: error: no suitable method found for addChildren(IMPORTObject)
>
>                 Transform0_2_2.addChildren(IMPORT0_2_2_3);
>
>                               ^
>
>     method X3DGroupingNode.addChildren(X3DNode[]) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DNode[])
>
>     method Transform.addChildren(X3DNode[]) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DNode[])
>
>     method TransformObject.addChildren(X3DChildNode) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DChildNode)
>
>     method TransformObject.addChildren(X3DNode[]) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DNode[])
>
> examples\Basic\development\ImportExportSyntax.java:154: error: no suitable method found for addChildren(EXPORTObject)
>
>                 Scene0_2.addChildren(EXPORT0_2_18);
>
>                         ^
>
>     method SceneObject.addChildren(X3DChildNode) is not applicable
>
>       (argument mismatch; EXPORTObject cannot be converted to X3DChildNode)
>
>     method SceneObject.addChildren(X3DNode[]) is not applicable
>
>       (argument mismatch; EXPORTObject cannot be converted to X3DNode[])
>
> examples\Basic\development\ImportExportSyntax.java:159: error: no suitable method found for addChildren(IMPORTObject)
>
>                 Scene0_2.addChildren(IMPORT0_2_20);
>
>                         ^
>
>     method SceneObject.addChildren(X3DChildNode) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DChildNode)
>
>     method SceneObject.addChildren(X3DNode[]) is not applicable
>
>       (argument mismatch; IMPORTObject cannot be converted to X3DNode[])
>
> 3 errors
>


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