Question

I'm currently working on a software allowing the creation of gamebooks, and I'm trying to add a graph view. I create a graph where the vertices are the paragraphs and the edges the links between them.

The gamebook I created has over 100 paragraphs, and all of them are extremely interwoven. First I tried to use JGraphX, but the result was a mush after application of the layout. Since help and examples for JGraphX are sparse I couldn't solve it, so I tried my luck with JGraph 5.13, because it had facade (couldn't find the JGraphX equivalent).

My problem is that the facade works pretty well for the first 87 edges I add to it. When I add just one more, I get this exception :

Exception in thread "main" java.lang.IllegalArgumentException: Comparison method violates its general contract!

at java.util.ComparableTimSort.mergeHi(Unknown Source)
at java.util.ComparableTimSort.mergeAt(Unknown Source)
at java.util.ComparableTimSort.mergeForceCollapse(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.ComparableTimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at com.jgraph.layout.hierarchical.JGraphMedianHybridCrossingReduction.medianRank(Unknown Source)
at com.jgraph.layout.hierarchical.JGraphMedianHybridCrossingReduction.weightedMedian(Unknown Source)
at com.jgraph.layout.hierarchical.JGraphMedianHybridCrossingReduction.run(Unknown Source)
at com.jgraph.layout.hierarchical.JGraphHierarchicalLayout.run(Unknown Source)

I'm not sure what to do next. Is JGraph 5.13 not made for making such a chaotic graph? Is there some JGraphX facade equivalent I could use? Am I missing something?

Was it helpful?

Solution

There is a comparator in 1 or 2 stages of the hierarchical layout that worked with Java 6, but Java 7 started enforcing that they must be must be transitive. We'll look into getting it fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top