Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Re: Node is already exist (Read 2298 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Node is already exist
Nov 16th, 2010 at 4:03pm
Print Post  
You can create your own method that looks like this:

for (DiagramNode n : diagram.getNodes())
     if (searchString.equals(n.getTextToEdit()))
           return n;

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Node is already exist
Reply #1 - Nov 17th, 2010 at 7:58am
Print Post  
Where to pass name to check that node is already created or not..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Node is already exist
Reply #2 - Nov 17th, 2010 at 12:35pm
Print Post  
Try this:
Code
Select All
DiagramNode findNodeByText(String searchString)
{
	for (DiagramNode n : diagram.getNodes())
		if (searchString.equals(n.getTextToEdit()))
			return n;
	return null;
}

if (findNodeByText("test") != null)
{
	// already exists
} 

  
Back to top
 
IP Logged
 
Tima
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 25
Joined: Nov 10th, 2010
Re: Node is already exist
Reply #3 - Nov 20th, 2010 at 7:06am
Print Post  
Thx its working
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint