Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

HELP PLEASE !!!!!

Thread view: 
soup_or_power@yahoo.com - 21 Nov 2005 15:12 GMT
I am trying to XML'fy the path info. The XML looks good. But am not
able to recreate the path. Can someone please help?

Enumeration expanded = getExpansionState(treeTable.getTree());

   if (expanded != null) {

       while (expanded.hasMoreElements()) {

           TreePath treePath = (TreePath) expanded.nextElement();

           String strarr = treePath.toString();

           StringBuffer sb = new StringBuffer();

           for (int i=0; i < strarr.length() ; i++)

           {

               char c=strarr.charAt(i);

               if (c != '[' && c != ']') sb.append(c);

           }

           StringTokenizer st = new StringTokenizer(sb.toString(),
",");

           while(st != null && st.hasMoreTokens()) {

               ttsDefaults.addPathList(st.nextToken());

           //tree.expandPath(treePath);

           }

       }

public static Enumeration getExpansionState(JTree tree) {

     return tree.getExpandedDescendants(new
TreePath(tree.getModel().getRoot()));

 }
//MG

       Vector pathList = ttsDefaults.getPathList(); //read from XML

       for (Enumeration e = pathList.elements(); e.hasMoreElements();)
{

           TreeDataObject name = ( TreeDataObject )( e.nextElement());

           TreeDataObject  root =
(TreeDataObject)treeTableModel.getMainTreeNode();

           TreePath path = TreeDataObject.getPathFromRoot(root, name);

           System.out.println("TreePath:"+path.toString());

           //select the path in the tree

           treeTable.getTree().expandPath(path);

          

       }
Andrew Thompson - 21 Nov 2005 16:20 GMT
> I am trying ..

Yes, yes.  Some people are, especially when they make three posts in
the space of 90 minutes in ever rising tones of desperation.

This is not a help desk to sort your problems, it is a discussion
forum.  If you have a desperate and urgent need to get detailed
help with a problem, you may well have to go somewhere else
to find that help(, and probably pay money).

Signature

Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew
Currently accepting short and long term contracts - on Earth.

pit.grinja@gmx.de - 22 Nov 2005 07:21 GMT
Hi,
> I am trying to XML'fy the path info. The XML looks good.
What XML? I don´t see any.
> But am not able to recreate the path. Can someone please help?
> Enumeration expanded = getExpansionState(treeTable.getTree());
1. What is "treeTable"? Anyways, treeTable.getTree() seems to return a
JTree

>     if (expanded != null) {
>         while (expanded.hasMoreElements()) {
[quoted text clipped - 9 lines]
>             while(st != null && st.hasMoreTokens()) {
>                 ttsDefaults.addPathList(st.nextToken());
2. What is "ttsDefault" ?
>             //tree.expandPath(treePath);
>             }
[quoted text clipped - 5 lines]
>
>         Vector pathList = ttsDefaults.getPathList(); //read from XML
2a. What is "ttsDefaults"?

>         for (Enumeration e = pathList.elements(); e.hasMoreElements();)
> {
>
>             TreeDataObject name = ( TreeDataObject )( e.nextElement());
3. What is a "TreeDataObject"?
>             TreeDataObject  root =
> (TreeDataObject)treeTableModel.getMainTreeNode();
[quoted text clipped - 3 lines]
>             treeTable.getTree().expandPath(path);
>         }
Too many uncertainties - ooooh, can´t help....
BW
Piet


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.