Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem with layouts (Read 5242 times)
Dunedan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Apr 14th, 2009
Problem with layouts
Jun 10th, 2014 at 4:07pm
Print Post  
Hi,
I have 3 questions:
- Is it possible to reduce the time of the AnnealLayout and TriangleLayout ? It takes a long time and I don't have seen any iteration parameter ?
- I have a bug with the GridLayout (with 500 nodes and 4500 links):
java.lang.IllegalArgumentException: Comparison method violates its general contract!
     at java.util.TimSort.mergeHi(Unknown Source)
     at java.util.TimSort.mergeAt(Unknown Source)
     at java.util.TimSort.mergeForceCollapse(Unknown Source)
     at java.util.TimSort.sort(Unknown Source)
     at java.util.TimSort.sort(Unknown Source)
     at java.util.Arrays.sort(Unknown Source)
     at java.util.Collections.sort(Unknown Source)
     at com.mindfusion.common.ExtendedArrayList.sort(Unknown Source)
     at com.mindfusion.diagramming.QuickRouter.a(Unknown Source)
     at com.mindfusion.diagramming.QuickRouter.RouteLinks(Unknown Source)
     at com.mindfusion.diagramming.Diagram.routeAllLinks(Unknown Source)
     at com.mindfusion.diagramming.GridLayout.arrange(Unknown Source)
Code (Java)
Select All
    	com.mindfusion.diagramming.GridLayout gridLayout = new com.mindfusion.diagramming.GridLayout();
	    	gridLayout.setGridSize(100);
	    	gridLayout.setIterations(19);
	    	gridLayout.setKeepGroupLayout(true);
	    	gridLayout.setRandomSeed(0);
	    	gridLayout.setXGap(12.5f);
	    	gridLayout.setYGap(12.5f);
	    	gridLayout.arrange(diagram);
 


One remark: I can have 2 links between 2 nodes.
- And one last question (not related to layouts): is it possible to have the nodes always displayed above the links ?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with layouts
Reply #1 - Jun 10th, 2014 at 7:54pm
Print Post  
Hi,

Quote:
Is it possible to reduce the time of the AnnealLayout and TriangleLayout ?


You can set AnnealLayout's Stages and IterationsPerStage properties.

TriangularLayout is designed for planar and close to planar graphs, and will waste a lot of time on a planarization step done for each non-planar link. A graph is planar only if num_links ≤ 3*num_nodes − 6, so you have at least 3000 non-planar links to process for the 500 nodes and 4500 links example. You might try setting IgnoreLayout = true for all links above the 3*nodes index in diagram.Links collection to make the processed graph sparser and closer to planar, and just reset them to straight lines after layout completes.

Quote:
I have a bug with the GridLayout


Could you attach the diagram that reproduces that saved as XML file?

Quote:
is it possible to have the nodes always displayed above the links


Set higher ZIndex value for nodes.

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


I love YaBB 1G - SP1!

Posts: 14
Joined: Apr 14th, 2009
Re: Problem with layouts
Reply #2 - Jun 11th, 2014 at 8:13am
Print Post  
Hi, I can't post the diagram (too large). I will send an email.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with layouts
Reply #3 - Jun 11th, 2014 at 8:34am
Print Post  
This worked in our test project with the GridLayout code from your post. Are you using latest version of the control, and what JRE version do you have installed?
  

Untitled_001.jpg ( 476 KB | 111 Downloads )
Untitled_001.jpg
Back to top
 
IP Logged
 
Dunedan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Apr 14th, 2009
Re: Problem with layouts
Reply #4 - Jun 11th, 2014 at 3:01pm
Print Post  
I am using official JDiagram 4.0.5.
I have tested with JRE 1.7 and 1.8. And I have the error with both.

I have:
diagram = new Diagram();
Rectangle2D bounds = new Rectangle(0,0,800,600);
diagram.setBounds(bounds);
diagram.setLinkShape(com.mindfusion.diagramming.LinkShape.Bezier);
diagram.setLinksRetainForm(true);
diagram.setShapeHandlesStyle(HandlesStyle.Custom);
diagram.setDefaultShape(Shape.fromId("Rectangle"));
diagram.setAlignToGrid(false);
diagram.setAllowLinksRepeat(true);
diagram.setAllowSplitLinks(true);
     diagram.setAutoResize(AutoResize.AllDirections);
diagram.setRestrictItemsToBounds(RestrictToBounds.Intersection);
diagram.setDynamicLinks(true);
diagram.setBackBrush(new SolidBrush(Color.white));
diagram.setShadowsStyle(ShadowsStyle.None);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with layouts
Reply #5 - Jun 11th, 2014 at 3:35pm
Print Post  
Ok, we were running it on Java 6 and reproduced the exception on Java 7. Our developer will investigate.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem with layouts
Reply #6 - Jun 12th, 2014 at 6:18am
Print Post  
Please try the version from PM page, linked from top of the forum.
  
Back to top
 
IP Logged
 
Dunedan
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Apr 14th, 2009
Re: Problem with layouts
Reply #7 - Jun 12th, 2014 at 10:14am
Print Post  
Yes, it is working now (java 7 and java 8).

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