Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic how to get all the nodes on graph ? (Read 2228 times)
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
how to get all the nodes on graph ?
Mar 9th, 2009 at 10:53am
Print Post  
Hi stoyo,

            I have created various nodes on graph,some are connected, some nodes in the graph are not connected, some do not have out links. etc.

           Now i want to check which nodes in the graph are not connected, which are not having out links. For this purpose i need all the nodes present in the graph.
But I did not find any thing to get all the nodes present in graph.

How can I iterate through all the nodes present in graph.

Thank you.
  
Back to top
 
IP Logged
 
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
Re: how to get all the nodes on graph ?
Reply #1 - Mar 9th, 2009 at 12:28pm
Print Post  
Hi,
   
    Routing all the graph nodes from root could be achieved but it would work for connected nodes only,
but for getting all the connected and unconnected node of graph, i did not find any method in API.

Thank you..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: how to get all the nodes on graph ?
Reply #2 - Mar 9th, 2009 at 2:30pm
Print Post  
Hi Jay,

for (DiagramNode node : diagram.getNodes())
{
     if (node.getIncomingLinks().size() == 0 &&
           node.getOutgoingLinks().size() == 0)
     {
           // unconnected node
     }
}

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
jay
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 59
Joined: Feb 4th, 2009
Re: how to get all the nodes on graph ?
Reply #3 - Mar 10th, 2009 at 6:09am
Print Post  
Hi stoyo,


            Thank you, it worked for me.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint