tree-nodes

javascript framework for relationship visualization [duplicate]

自作多情 提交于 2020-01-01 05:01:08
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Graph visualization code in javascript? I need to create a dynamic visualization for nodes and their relationships in Javascript. What's the best framework to use? This is what I've briefly reviewed so far: Flare - it's Flash and hasn't been updated in almost 2 years. JavaScript InfoVis Toolkit - interaction seems a little slow, maybe that's on purpose in the demos Protovis - documentation looks great, doesn't

Extend ANTLR3 AST's

余生颓废 提交于 2019-12-19 04:05:48
问题 With ANTLR2, you could define something like this in grammar definition file: options { language = "CSharp"; namespace = "Extended.Tokens"; } tokens { TOKEN<AST=Extended.Tokens.TokenNode>; } And then, you could create a class: public class TokenNode: antlr.BaseAST { ... } Any ideea if something like this can be used (delegate class creation to AST factory instead of me doing the tree replication manually)? It's not working just by simple grammar definition copy from old to new format, and I

Adding and removing nodes from a JTree

若如初见. 提交于 2019-12-04 16:45:24
问题 I have a very basic JTree . As I am on a rush, I'd prefer not to use TreeModel if it is not needed. I wrote a SSCCE to expose the problem: Sometimes I add a node. Other times I remove them. When I push Add , a node is correctly added. When I push Remove , it is supposed to remove the node, but it doesn't. Also, if I try adding more than one node, the tree stays with just the first node I added. I wrote an update method for the JTree , where I first erase all the nodes hanging from the root

javascript framework for relationship visualization [duplicate]

血红的双手。 提交于 2019-12-03 14:05:11
This question already has answers here : Graph visualization library in JavaScript (5 answers) Possible Duplicate: Graph visualization code in javascript? I need to create a dynamic visualization for nodes and their relationships in Javascript. What's the best framework to use? This is what I've briefly reviewed so far: Flare - it's Flash and hasn't been updated in almost 2 years. JavaScript InfoVis Toolkit - interaction seems a little slow, maybe that's on purpose in the demos Protovis - documentation looks great, doesn't work in IE at all (can I get it to work with some kind of IE SVG

Adding and removing nodes from a JTree

徘徊边缘 提交于 2019-12-03 09:51:23
I have a very basic JTree . As I am on a rush, I'd prefer not to use TreeModel if it is not needed. I wrote a SSCCE to expose the problem: Sometimes I add a node. Other times I remove them. When I push Add , a node is correctly added. When I push Remove , it is supposed to remove the node, but it doesn't. Also, if I try adding more than one node, the tree stays with just the first node I added. I wrote an update method for the JTree , where I first erase all the nodes hanging from the root node, and then I look at which nodes and sub-nodes I have to create. What I am doing wrong here, apart

Extend ANTLR3 AST's

こ雲淡風輕ζ 提交于 2019-11-30 23:24:42
With ANTLR2, you could define something like this in grammar definition file: options { language = "CSharp"; namespace = "Extended.Tokens"; } tokens { TOKEN<AST=Extended.Tokens.TokenNode>; } And then, you could create a class: public class TokenNode: antlr.BaseAST { ... } Any ideea if something like this can be used (delegate class creation to AST factory instead of me doing the tree replication manually)? It's not working just by simple grammar definition copy from old to new format, and I tried to search their site and samples for somthing similar. Any hints? EDIT I'm not trying to create

How to get a list of all child nodes in a TreeView in .NET

时光怂恿深爱的人放手 提交于 2019-11-30 08:39:12
I have a TreeView control in my WinForms .NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of all the nodes beneith that parent node? For example, I started off with this: Dim nodes As List(Of String) For Each childNodeLevel1 As TreeNode In parentNode.Nodes For Each childNodeLevel2 As TreeNode In childNodeLevel1.Nodes For Each childNodeLevel3 As TreeNode In childNodeLevel2.Nodes nodes.Add(childNodeLevel3.Text) Next Next Next The

How to get a list of all child nodes in a TreeView in .NET

不问归期 提交于 2019-11-29 11:37:40
问题 I have a TreeView control in my WinForms .NET application that has multiple levels of childnodes that have childnodes with more childnodes, with no defined depth. When a user selects any parent node (not necessarily at the root level), how can I get a list of all the nodes beneith that parent node? For example, I started off with this: Dim nodes As List(Of String) For Each childNodeLevel1 As TreeNode In parentNode.Nodes For Each childNodeLevel2 As TreeNode In childNodeLevel1.Nodes For Each

How to search for a node in a tree and return it?

瘦欲@ 提交于 2019-11-29 03:54:09
I'm trying to search for a node in a binary tree and return in case it's there, otherwise, return null. By the way, the node class has a method name() that return a string with it's name...What I have so far is: private Node search(String name, Node node){ if(node != null){ if(node.name().equals(name)){ return node; } else{ search(name, node.left); search(name, node.right); } } return null; } Is this correct?? You need to make sure your recursive calls to search return if the result isn't null. Something like this should work... private Node search(String name, Node node){ if(node != null){ if

How to search for a node in a tree and return it?

不羁的心 提交于 2019-11-27 17:51:40
问题 I'm trying to search for a node in a binary tree and return in case it's there, otherwise, return null. By the way, the node class has a method name() that return a string with it's name...What I have so far is: private Node search(String name, Node node){ if(node != null){ if(node.name().equals(name)){ return node; } else{ search(name, node.left); search(name, node.right); } } return null; } Is this correct?? 回答1: You need to make sure your recursive calls to search return if the result isn