Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) TreeLayout (Read 14723 times)
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: TreeLayout
Reply #15 - Sep 30th, 2015 at 6:27pm
Print Post  
The problem is when I load a diagram and from the diagram I want to understand if a node belongs to a tree layout, if I put the tag, it lost it when I save and then reload after. I want a way to know if a node is part of a tree or not.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout
Reply #16 - Oct 1st, 2015 at 11:04am
Print Post  
A graph node is always a part of some sub-tree, you cannot determine what you need by just inspecting nodes and links. You will have to explicitly mark ones that were arranged by TreeLayout. Tag serialization works fine in my test; check if you aren't resetting Tag value to null at some point:

Code
Select All
ShapeNode sn = diagram.getFactory().createShapeNode(50, 10, 20, 20);
sn.setTag(true);
try
{
	diagram.saveTo("temp", this);
	diagram.clearAll();
	diagram.loadFrom("temp", this);
	ShapeNode loaded = (ShapeNode)diagram.getNodes().get(0);
	Boolean tag = (Boolean)loaded.getTag();
	loaded.setText(tag.toString());
}
catch (FileNotFoundException e)
{
	e.printStackTrace();
}
catch (IOException e)
{
	e.printStackTrace();
} 

  
Back to top
 
IP Logged
 
Silvia88
Full Member
***
Offline


I Love MindFusion!

Posts: 121
Joined: Aug 31st, 2015
Re: TreeLayout
Reply #17 - Oct 1st, 2015 at 12:22pm
Print Post  
Ok, thank you very much  Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint