Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Where are arrows connected? (Read 13867 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Where are arrows connected?
May 15th, 2007 at 12:57pm
Print Post  
I wrote a simple program that creates 4 boxes and connects with arrows.
After creating all boxes and arrows, I did this:

SpringLayout spring = new SpringLayout();
spring.setIterations(100);
spring.setMinimizeCrossings(true);
spring.arrange(diagram);

a) sometimes the arrows are connected to the center of the boxes, sometimes to the edges - it's inconsistent (changes every time I run the program). What can I do to allways attach them to the boxes?
b) I'm not sure SpringLayout is what I need the most. I need to join all boxes together to show a map of a network. This means - best distribution, minimal crossings. How cna I do that?

Thanks!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #1 - May 15th, 2007 at 1:28pm
Print Post  
I guess the nodes will be linked to their centers if they intersect. Is that what happens? You can call the SpringLayout.setNodeDistance to set larger distance between the nodes and prevent them from intersecting.

On a side node, we are ready with the Table.resizetoFitText method we've promised you and will upload a preview build of version 1.2 tomorrow. JDiagram 1.2 also contains a new layout algorithm, AnnealLayout, that lets you set costs for the different layout criteria, e.g. node distribution, link crossings etc, so you will be able to customize it to meet the layout criteria you need.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #2 - May 15th, 2007 at 1:53pm
Print Post  
Thanks for the update about 1.2, I'm really waiting for it. Will it include the Overview feature?

About the arrows - they do not intersect and still this happens.
http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200751518491...
Do you know why?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #3 - May 15th, 2007 at 4:24pm
Print Post  
That's what I figured - it seems the arrows are drawn between the box centers when the boxes intersect. Otherwise the arrows would be drawn between the closest points from the box borders. Using a bigger SpringLayout.NodeDistance value should fix that.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #4 - May 16th, 2007 at 5:28am
Print Post  
Oh, this is what you meant. I looked for intersection in the arrows and not in the boxes.
Isn't there a layout I can use that automatically does a do-not-intersect computation on the boxes?

Thanks!
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #5 - May 16th, 2007 at 5:37am
Print Post  
Unfortunately, at this time the layout classes just let you set grid size or layer / node distance parameters. I guess these distances are measured between the node centers, so if there are nodes larger than the distances, they might intersect.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #6 - May 16th, 2007 at 5:41am
Print Post  
Ok. So I assume that if I set the NodeDistance parameter to be larger than the distance btween one center to another center - it won't happen.
Is this correct?

Meaning:
NodeDistance > sqrt((width)^2 + (height)^2)

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #7 - May 16th, 2007 at 5:51am
Print Post  
I guess so, at least if there isn't some very densely linked part of the graph, because in SpringLayout the links pull the nodes closer to each other.
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #8 - May 16th, 2007 at 5:52am
Print Post  
I see.
Thanks!
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #9 - May 16th, 2007 at 1:27pm
Print Post  
This is our daily build of version 1.2:
http://www.mindfusion.org/_temp/JDiagram.jar

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #10 - May 16th, 2007 at 1:43pm
Print Post  
Thanks - I'll give it a try.
Does it include Overview?
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #11 - May 16th, 2007 at 2:26pm
Print Post  
About the intersecting nodes:
I've set the NodeDistance to a really large distance, and what I got was this:

http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200751619161...

It seems that one node is hiding another. I think the NodeDistance parameter speaks only of adjacent nodes. But waht If I want to spread all nodes evenly?
In the Demo it looks like the spread is great - but I don't find the code that does it.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #12 - May 16th, 2007 at 3:45pm
Print Post  
I guess this happens because the control only checks the center coordinates and ignores the sizes. We will change this to use the distance between the node borders, and not the one between their centers. Could you post here the code that setups the boxes and the SpringLayout?

Thank you,
Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Where are arrows connected?
Reply #13 - May 17th, 2007 at 3:38am
Print Post  
No problems.
And please tell me when it will be fixed. I want to make good impressions with the JDiargam testing...  8)

The java file is here:
ftp://ftp.support.veritas.com/pub/support/outgoing/ymoran/
(use anonymous login)

The class that builds the FlowChart is DiagramFile, that is used to read an XML file with the diagram structure.
I've attached Diagram class that extends FlowChart so you'll see if I've made nothing there that may cause the error.

Thanks!
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Where are arrows connected?
Reply #14 - May 17th, 2007 at 6:14am
Print Post  
Thank you, it should be ready by tomorrow.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint