JGraph layout algorithm

hi,i developed a program which represents a struts-tree with a hard-coded root elementanyway, are there any pre-defined algorithm for representing a-bit-more-complex-than-trees graphs using with jgraph?thxbye--spid
[256 byte] By [spidey_a] at [2007-9-29 16:32:16]
# 1

There are! Although almost any *good* implementation of such an algorithm is provided by commercial products (automatic graph layout is an active research area). AFAIK almost all of them allow you to use your own view component (JGraph in your case). Try the following Webstart program and have a look at the different layout algorithms which are available from the layout menu:

Free Java Graph Editor "yEd" (Webstart)

http://www.yworks.com/products/yed/demo/yed.jnlp

If you don't have Webstart installed on your machine take a look at the gallery:

http://www.yworks.com/en/products_yfiles_practicalinfo_gallery.htm

or a tiny userguide concerning some of the major layout styles:

http://www.yworks.com/products/yfiles/doc/userguide/layout/major.html

Using the API

(http://www.yworks.com/products/yfiles/doc/api-gif/index.html)

it is easy to automatically layout graphs for any kind of view, if you don't want to use yFiles' (that's the product's name) viewer component.

For some other (mostly unaffordable :D ) automatic layout algorithms google for "java graph layout".

Regards, Sebastian Mueller

SebastianMa at 2007-7-15 14:53:44 > top of Java-index,Other Topics,Algorithms...
# 2
Ha, Sebastain is working at YWorks :) Actually it IS a good product.Gil
gilroittoa at 2007-7-15 14:53:44 > top of Java-index,Other Topics,Algorithms...
# 3

Hi,

I am right now working on struts technology.I have created screens to add,retrieve data from the database.My requirement is i need to create the tree in struts.when i click on a menu the tree should be displayed.since you have already done some work on developing tree can you help me?

scott35a at 2007-7-15 14:53:44 > top of Java-index,Other Topics,Algorithms...
# 4
Hi,JGraph now does have a set of commercial-grade java graph layout packages that work. See http://www.jgraph.com and click on the link to Layout Pro.Kind Regards,David
davidjgrapha at 2007-7-15 14:53:44 > top of Java-index,Other Topics,Algorithms...
# 5

Hi Sebastian,

I have to do auto routing of connections into our graphical editor.

I have tried to use the OrthogonalEdgeRouter for that purpose with the following way:

OrthogonalEdgeRouter orthogonalEdgeRouter = new OrthogonalEdgeRouter();

orthogonalEdgeRouter.setSphereOfAction(OrthogonalEdgeRouter.ROUTE_ALL_EDGES);

orthogonalEdgeRouter.setMinimumDistanceToNode(10);

orthogonalEdgeRouter.setCoupledDistances(true);

orthogonalEdgeRouter.setMinimumDistance(5);

orthogonalEdgeRouter.setGridSpacing(2);

orthogonalEdgeRouter.setCenterToSpaceRatio(0.5);

orthogonalEdgeRouter.setGridRoutingEnabled(true);

orthogonalEdgeRouter.setReroutingEnabled(true);

orthogonalEdgeRouter.setCrossingCost(2.0);

orthogonalEdgeRouter.setLocalCrossingMinimizationEnabled(true);

BufferedLayouter bufferedLayouter = new BufferedLayouter(orthogonalEdgeRouter);

bufferedLayouter.doLayout(graph);

Unfortunately this code does not layout the connections into our diagram in orthogonal way, but changed the connections to direct connections(straight lines) between nodes.

I changed a lot of upper mentioned method invocations, but without success.

BTW: version of yFiles is 2.0.0.7

Do you have any ideas where I am wrong?

Thanks in advance,

Aleksandar

anajdenova at 2007-7-15 14:53:44 > top of Java-index,Other Topics,Algorithms...