Comming from an arcore issue, why is ARCore Node not a subclass of Java's DefaultMutableTreeNode?
Hi Thanks for the question,
DefaultMutableTreeNode is in the swing package.. we don't currently have a dependency on swing and we have to be very careful about any dependency we add so I don't see us adding a dependency on swing.
This class is meant to be used with Swing's JTree UI widget, it is much more generic than what Sceneform's Node intends to be. Is there any reason why you'd want Sceneform's Node to be a subclass of this Swing class?
@malik-at-work, It would only require the three classes DefaultMutableTreeNode, MutableTreeNode, and TreeNode from the swing package as dependency. Those three classes are standalone and have no other Java or Swing dependencies. Including the whole package would be too much on my opinion.
@romainguy The DefaultMutableTreeNode has a lot of tree specific code used thousand times in practice which is useful for a programmer. GetRoot, siblings, tree building, four build in traversals, a userObject, getLevel, various add and remove methods etc. just look at all the methods of the DefaultMutableTreeNode documentation. All that Sceneform has not except getParent, childCount, and getChildAt. I just wondered that ARCore uses the concept of nodes in trees but has this few tree related code when the code for a tree-concept is available for many years.
I build a anchor node with two transformable nodes in a tree with height of three. I had some difficulties in up and downward navigation in the build tree which are all resolved by implementing on my own what is already in DefaultMutableTreeNode. That is how I came to the question in the first place.
Why imitating Sceneform by ignoring other technology?
Months have passed, what is the sceneform development team statement on this subject?
I think the idea is interesting but right now we don't have plans to rework Node.
Thank you for your reply.