Blog Home  Home Feed your aggregator (RSS 2.0)  
Debugging trees - Manuel Abadia's ASP.NET stuff
 
# Saturday, December 2, 2006

I couldn’t resist to improve StructsViz in order to add support for trees. Even if everybody has his own tree implementation, we can come up with a common agreement:

A tree is a collection of nodes, where each node has zero or more child nodes. Each node has zero or one parent. The only node that doesn’t have a parent is the root node.

So based on the previous definition, I have defined this interface that is mandatory to implement in order to visualize a tree node in StructsViz:

public interface ITreeNode<T>

{

    T Value { get; set; }

    ITreeNode<T> Parent { get; set; }

    bool HasChildren { get; }

    ICollection<ITreeNode<T>> Children { get; }

}

 

I think that any tree node implementation can easily implement this interface.

With that interface implemented, StructsViz will be able to draw your tree node.

I have been playing a bit with automatic layout positioning for trees, and with different kind of connections:





 

The pictures show debug information of the subtree areas needed to position the elements properly using a recursive algorithm. For example, the rectangle labeled as ST 2, is the subtree area for node 2, and it is calculated based on the ST 6 and ST 7 (subtree areas for node 6 and 7 respectively). With ST 1, ST 2 and ST 3, we can properly position node 0.

I’m giving the final touches to this and it will be included in the next StructsViz version.

Saturday, December 2, 2006 5:17:59 PM (Romance Standard Time, UTC+01:00)  #    Comments [2]   ASP.NET | Microsoft .NET Framework  | 
Wednesday, December 6, 2006 4:06:13 PM (Romance Standard Time, UTC+01:00)
Hi Manuel,

I've been reading your blog for a while. It has been very usefull. But I've not found any informatio about ObjectDataSource and Reporting Tools. What Do you know about this ? Could you send me some information ?

Congratulations, thanks and Best Regards,


Renato Guarilha
CM Soluções Informática
Rio de Janeiro - Brasil
Renato Guarilha
Thursday, December 7, 2006 11:19:13 AM (Romance Standard Time, UTC+01:00)
Renato,

unfortunately I haven't used reporting tools with the ObjectDataSource or another DataSourceControl so I can't help.

Best regards,
Manu.
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview
Copyright © 2020 Manuel Abadia. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.