On Mon, 23 Oct 2006 20:01:10 +0000, Ian Shef wrote:
Tony Burrows <to**@tonyburrows.comwrote in
news:pa****************************@tonyburrows.co m:
>I'm building an app which lets users drag and drop classes into a tree,
followed by code generation. For this, I need to have (a) a list of all
the classes which can be dragged and (b) for each class, which of the
others can be a parent in the tree.
All the relevant classes are in a jar file (j3dcore.jar) as well as
other abstract classes and there is standard generated documentation.
Any idea how I could extract the relevant data? Hand coding it would be
just too much.
Tony
I will have to make some assumptions here, because you:
Didn't describe what this tree represents.
Didn't describe what the parent/child relationship is in the tree.
Didn't describe what is in the jar file.
Didn't describe what "relevant data" means to you.
Thanks for that, though I finally got as far as using the JarFile class
yesterday.
I was trying to keep things as simple as possible in my query, wrongly.
The actual classes are Java3D ones to build a representation of a J3D
scenegraph, which is a tree (later I'll generate the matching code). The
main classes are all in j3dcore.jar, plus a couple of utility classes.
Other do exist but can't be connected to the scenegraph.
In fact, the classes descend from one of four parents, Group, Leaf,
NodeComponent or unspecified. Leaf nodes can be added to Group nodes so
once I extract the two types I can control what can be dropped where.
NodeComponent nodes can only be dropped on leaf nodes, with 1 exception,
but not all node components on all leaf nodes! The unspecified are
similar. What I've managed is to extract the nodes, but then manually had
to adjust which node components and unspecified objects can be added to
the other nodes, and the numbers allowed (that varies too).
I was trying to avoid the labour of hand coding it all, since the API is
still evolving, but I think it will have to be a blend of the two.
Tony