🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #9845

Re: jbcl.control.TreeControl

#9845
From: Hycel
Date: Sat, 08 Jan 2000 00:00
61 lines
2372 bytes
Paul Furbacher,

I have made progress. But I am not yet there.  I found a method called,
"public void setSubFucus(GraphLocation subfocus)".  I tested it with the,
'Simple TreeControl Sample' and found it to work.  However, in the 'Simple
TreeControl Sample',  the nodes are inserted with text fields.  Thus the
search is done on a text field.

In my program, I am passing an object myTreeNode which looks like the
following:

public class myTreeNode implements Serializable
{
  public myNodeData nodeData;

  public int nodeID;
  public int nodeLevel;
  public int nodeOrder;
  public int numberOfChildren;

  public String nodeTitle;

  public myTreeNode parentNode;
  public myTreeNode rightSiblingNode;
  public myTreeNode leftSiblingNode;
  public myTreeNode firstChildNode;
  ...
  public String toString()
  {
    return this.nodeTitle;
  }
 ...
}

In my program, I created the following test code, to see if I could perform
a search and expand the tree at the found node.

Given: myTreeNode currentNode = the (myTreeNode) node to search for.

1)  GraphLocation temp = treeControl.find(currentNode);  // This line of
code works.

To make sure the temp has found the correct GraphLocation, I store the
result of what temp is pointing to in tempNode and then check
tempNode.nodeTitle during a debug session see that is the same as the given
currentNode.

2)  myTreeNode tempNode = (myTreeNode) treeControl.get(temp);  // This line
of code also works.

I then try to setSubfocus to, myTreeNode temp, to no avail.

3)   treeControl.setSubfocus(temp);  // This line of code does not work.

Question: Why can't I get line 3 to work?

I am almost there.  Any help would be much appreciated.

Hycel
hycel@mediaone.net
hycel@email.msn.com
Technical Details
Message-ID: <857pb9$sv119@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <852590$q6i2@bornews.borland.com> <3876BFC7.272A0E6E@bilbo.bio.purdue.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,83ae6506ed959249
X-Google-Attributes: gid111d45,public
From: "Hycel" <hycel@mediaone.net>
Subject: Re: jbcl.control.TreeControl
Date: 2000/01/08
Message-ID: <857pb9$sv119@bornews.borland.com>
X-Deja-AN: 570020039
References: <852590$q6i2@bornews.borland.com> <3876BFC7.272A0E6E@bilbo.bio.purdue.edu>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing