N
Nop.Lists
G'day,
I would be very grateful for insights considering modeling a JTree.
Background
=========
I am learning swing and try to build various kinds of trees.
One kind of tree I am dealing with is the filesystem tree (where my
underlying objects are java.io.File).
Another kind are XML files (where the underlying objects are e.g.
org.jdom.Entity).
Yet another kinds are trees of user defined objects.
The Question
==========
I have experienced with 3 methods for building the trees:
1. Use DefaultMutualTreeNode and put your object in teh UserNode
2. Define an overlying structure that extends the
DefaultMutualTreeNode and mirrors my domain.
Example: have a XMLEntity, XMLComment, XMLPI etc. wich correspond
to the entities of JDom.
3. Define a model over my domain (in the example of a filesystem tree
my model is based on java.io.File). I define all operations on the
model.
What would you consider as the best way and why?
Thank you very much for your insights!
nop.lists
I would be very grateful for insights considering modeling a JTree.
Background
=========
I am learning swing and try to build various kinds of trees.
One kind of tree I am dealing with is the filesystem tree (where my
underlying objects are java.io.File).
Another kind are XML files (where the underlying objects are e.g.
org.jdom.Entity).
Yet another kinds are trees of user defined objects.
The Question
==========
I have experienced with 3 methods for building the trees:
1. Use DefaultMutualTreeNode and put your object in teh UserNode
2. Define an overlying structure that extends the
DefaultMutualTreeNode and mirrors my domain.
Example: have a XMLEntity, XMLComment, XMLPI etc. wich correspond
to the entities of JDom.
3. Define a model over my domain (in the example of a filesystem tree
my model is based on java.io.File). I define all operations on the
model.
What would you consider as the best way and why?
Thank you very much for your insights!
nop.lists