Has anyone ever used a JTree to assemble a structure that is in the Tree View?
Note: The picture is just to illustrate.
it's a little bit of programming but you can do this. I didn't have done that right now but you can read all features with J-Link, and you can programm a tree completly like you want it (also with drag n drop and so on).
I have done both seperately.
This is just one example, but I'm trying to do this way:
Here I can recover the code and the name of the item, but I can not recover the amount of each item.
I need to do two things from this code:
1) recover the quantity.
2) Insert the information into a JTree.
Uh that's not what you want.
You go through all models inside the session. Every model is only one time inside the session.
You need to get the current model.
Check if it is an ASM.
Then you get all Features from these ASM.
Check if it is a Component.
Change Component to Model if it is a part count it inside a Map, tree, whatever
if it is a asm count it inside a Map / Tree and call the function recursive.
You don't have circles inside of a tree so it never should be a problem.
If the model isn't a component you can ignore it. You also can filter it at the feature list option as far as I remember. But not sure about this.
The example code is just to try to recover the amount of the item. It is not being recursive nor entering the JTree.
I understand that it is necessary to be recursive when the item is an assembly.
The result should be this way in the JTree:
84139520 - COMMON NAME- 3
Yes you need to be recursive and the addition of standard values could happen inside of a HashTable or whatever ... but that's standard java.
Just count it up ^.^ You'll get 3 Features that all got the samte component inside.
So I don't know if it works right with pattern. If not you need to check out if there is a pattern and use the pattern API Commands to find out whats inside.
is there problems with tree structure?
some codes of my ProToolkit project for reference.