Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layered Layout using Javascript versus ASP.NET (Read 4386 times)
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Layered Layout using Javascript versus ASP.NET
May 8th, 2010 at 12:47am
Print Post  
I have some diagramNodes that I am trying to layout using LayeredLayout approach.

I am creating each shapenode and specifying which AnchorPoints to use for each shapenode (for instance, rather than just middle points for a rectangle it uses all points) and then initiate layerdlayout. If some changes are made, I am trying to initiate a re-layout using javascript so that it is faster and does not require a postback.

When I do a re-layout using javascript, it does the following:

1. It ignores the specified anchorpoints and uses the default ones

2. With exactly same information, every time I do a re-layout with javascript, it gives a different layout.

Can you please let me know what I can do to prevent these issues?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layered Layout using Javascript versus ASP.NET
Reply #1 - May 10th, 2010 at 10:55am
Print Post  
1. Have you set the layout.Anchoring property to Keep? I think this works only if the nodes' AnchorPattern is set.

2. Our developer investigated this - it seems the list.Sort method in Java sets random order when the Comparator returns equality for two objects, while in .NET the sort order is consistent even if some objects are treated as equal. If you think it's important to apply the same order, we can add some additional sorting criteria for the next release, so that Comparator implements strict ordering.

Stoyan
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Layered Layout using Javascript versus ASP.NET
Reply #2 - May 10th, 2010 at 5:17pm
Print Post  
Stoyan,

For 1, I have tested using all three different type of layout.setAnchoring but all of them are returning same results.

I have set the AnchorPattern from the .NET side for each node. It this still accessible and recognized from Java side?

For 2, It would very much help if you can return same layout in order to reduce confusion.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layered Layout using Javascript versus ASP.NET
Reply #3 - May 10th, 2010 at 5:43pm
Print Post  
Is it one of the built-in AnchorPatterns or a custom instance?

If it's a custom one and has an id, the anchorpattern is serialized only through its id. When deserializing the node on the client side, an AnchorPattern with the loaded id must already exists (e.g. define it in the AppletStarted script using the corresponding ScriptHelper methods).

If you omit the id when creating AnchorPattern objects, the whole object will be serialized and should be loaded on the client without additional efforts by you. However this will require more bandwidth for transferring the anchor point definitions.

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


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Layered Layout using Javascript versus ASP.NET
Reply #4 - May 10th, 2010 at 6:20pm
Print Post  
Thank you. Based on your explaining I was able to confirm that the anchor points are consistent. However, the links, when using .NET, use these anchorpoints as starting and ending point for links but Java ignores them when LayeredLayout is performed.

Is there a setting that enforces this? I tried to find it but couldn't find it in the help menu.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layered Layout using Javascript versus ASP.NET
Reply #5 - May 11th, 2010 at 12:00pm
Print Post  
The setAnchoring(Keep) option should enforce it, but I can see now it doesn't. Our developer will check what happens.
  
Back to top
 
IP Logged
 
choohj70
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Sep 23rd, 2008
Re: Layered Layout using Javascript versus ASP.NET
Reply #6 - May 11th, 2010 at 1:55pm
Print Post  
I see. My goal is to have the layeredlayout use one of the specified anchorpoint per node based on optimal routing not the exact one that the link is attached to initially.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layered Layout using Javascript versus ASP.NET
Reply #7 - Jul 13th, 2010 at 5:49am
Print Post  
Hi,

Try LayeredLayout from this version:
https://mindfusion.eu/_beta/NetDiagram311.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint