Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arranging shapeNode(s) in containerNode(s) (Read 7026 times)
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Arranging shapeNode(s) in containerNode(s)
Apr 20th, 2012 at 11:03am
Print Post  
I'm currently attempting to arrange diagram nodes (JavaApplet) with javascript. I'm able to arrange the first level of layers but not any forward. I.E if I have a containerNode and within it shapeNode(s) and call a fucntion that arranges diagram (all the nodes). All other nodes in diagram are arranged except the ones inside the container node.

So what do I need to do to fix this... I've fixed it on server-side-sample, but in client-side: once again, I'm lost...
(a sample code, perhaps; no need for full code-sample, but the function itself)


Br. Henry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arranging shapeNode(s) in containerNode(s)
Reply #1 - Apr 20th, 2012 at 2:35pm
Print Post  
Hi,

What exactly are you doing on the server side that you need to do from client code too?

Stoyan
  
Back to top
 
IP Logged
 
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: Arranging shapeNode(s) in containerNode(s)
Reply #2 - Apr 23rd, 2012 at 7:09am
Print Post  
This may sound stupid, but I have reason for it (too difficult and long to explain). I'm currently keeping 2 separate "dataSet" of diagram. One on client-side and one on server-side.

I may have been wrong to even mention of the server-side functioning... (may get people confused).

But currently I'm having problems of arranging nodes inside containers on client-side with JavaApplet as ClientSideMode.

a) nodes gets to top of the caption "field"
b) if container is placed on diagram; lets say x= 200 & y=200; after arranging containers are moved to (x=20 & y=20) but nodes in this container are not: they stay in place where they were before...

I saw once a similar issue on one of the mindfusion users but I couldn't find the case thus the answer to my question.

Br. Henry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arranging shapeNode(s) in containerNode(s)
Reply #3 - Apr 23rd, 2012 at 10:20am
Print Post  
You might check the code from the following threads:
http://mindfusion.eu/Forum/YaBB.pl?num=1286496355/1#1
http://mindfusion.eu/Forum/YaBB.pl?num=1330644188/1#1

One problem I can see if you need to run it from the client side is that you won't be able to directly create a DiagramItemCollection from JavaScript (because it's not on the class_path as we discussed before and there's no method in ScriptHelper to create an instance). For now you can call diagram.getItems().clone() to get a new instance and then clear() it.

Stoyan
  
Back to top
 
IP Logged
 
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: Arranging shapeNode(s) in containerNode(s)
Reply #4 - Apr 24th, 2012 at 6:11am
Print Post  
That is problem to me indeed, but now I'm currently developing a workaround...

Thought this has come to a problem also.

Question: when I save diagramView to string does it include the "diagram" from in it?
Test result: as I tested just few minutes ago, I realized that if I save diagramView it doesn't include the "diagram" from it. For example (I set Font: Verdana, 25pt) and when I save diagramView the font is (Verdana, 8.257321...) and all other stuff like handles are also messed up.
Conclusion: It's required to save both, the diagramView and the "diagram" -itself.
Simple explain: You have a wall and you have a picture/paint... if you save the wall, you wont save the picture. If you save picture you wont save the wall. You need to save them separately.

Short question: Is the description above correct?

Br. Henry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arranging shapeNode(s) in containerNode(s)
Reply #5 - Apr 24th, 2012 at 7:51am
Print Post  
DiagramView.SaveTo* methods save the DiagramView.Diagram content too. Are you sure it's the same diagram you are looking at the client side (considering your earlier Diagram content in Session scenario)?

Stoyan
  
Back to top
 
IP Logged
 
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: Arranging shapeNode(s) in containerNode(s)
Reply #6 - Apr 24th, 2012 at 9:12am
Print Post  
Yes. I compared Base64 string together and before modifications (or the load) they were same, but after the load I noticed a difference and the diagramView content was same but its "diagram" -part settings was default or something really different..

I handled the save scenarios separately (sounds quite stupid, but it works now...) to 2 different Session object-strings.
Though I found out also that when a object (for example: ShapeNode) is modified from server-side its inherited properties will be overwritten... by this I mean that the default settings that you have set on Init scenario and/or in the ASPx control properties... will be overwritten.
--> In this case then the previous case shall be overwritten by this scenario.. (which would make sense)

Br. Henry
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arranging shapeNode(s) in containerNode(s)
Reply #7 - Apr 24th, 2012 at 10:09am
Print Post  
Apart from the different saved strings, were there any visual differences in the diagram? When the applet and the server exchange diagrams, some values might be converted to a different unit (e.g. there's no Unit property in java.awt.Font, so font sizes get converted to the diagram's unit) and this will lead to different string representations.
  
Back to top
 
IP Logged
 
henry k
Junior Member
**
Offline


I Love MindFusion!

Posts: 51
Location: Finland
Joined: Apr 4th, 2012
Re: Arranging shapeNode(s) in containerNode(s)
Reply #8 - Apr 24th, 2012 at 11:09am
Print Post  
Stoyo wrote on Apr 24th, 2012 at 10:09am:
Apart from the different saved strings, were there any visual differences in the diagram?

- No.

Stoyo wrote on Apr 24th, 2012 at 10:09am:
When the applet and the server exchange diagrams, some values might be converted to a different unit (e.g. there's no Unit property in java.awt.Font, so font sizes get converted to the diagram's unit) and this will lead to different string representations.

- True

In case of font I made a workaround with setting a static font variable in both case...
« Last Edit: Apr 27th, 2012 at 12:41pm by henry k »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint