Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » new javadoc for Zest2??
icon1.gif  new javadoc for Zest2?? [message #901735] Tue, 14 August 2012 12:13 Go to next message
Mark Fenbers is currently offline Mark Fenbers
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
I recently upgraded to Zest 2 before realizing just this morning that Zest 2 is not the latest supported stable/release version. Nonetheless, I prefer to use it, if I can.

Zest 2 has broken my code. I have a sketchy understanding of how the layouts work in Zest 1, but I did manage to get my implementation working through heavy reliance on examples. For Zest 2, however, according to http://wiki.eclipse.org/Zest, "In Zest 2, the layout API has been reworked. Most code should be working fine. ... In a few cases, however, code changes are required." Well, I must be the minority, because I have new errors I cannot get past. The wiki also says to consult the deprecated API for documentation on migrating to the new API. But I cannot find anything anywhere on the migration changes I need. Most examples I find and all documentation I find are still referring to the old (Zest 1) way of doing things. Can someone with Zest 2 experience throw me a link or two that will be helpful regarding what code changes I need to make for my Zest Layouts??

Thanks in advance for the help!

Mark
Re: new javadoc for Zest2?? [message #901737 is a reply to message #901735] Tue, 14 August 2012 12:21 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 221
Registered: July 2009
Senior Member
Sadly, the layout changes are not documented very well (partly because Zest 2.0 is not officially released yet). However, the change is reasonably simple:

The Zest 1.0 layout code arranges explicitely the nodes in the graph, while Zest 2.0 presents a new element called LayoutContext. From this context you can ask for all nodes in the graph, and do all the layouting on the returned data structure.

The main reason for the change (as far as I know) is to decouple the layouts from the graph widgets, allowing re-use in different scenarios (e.g. to lay out GEF nodes in the future).

I hope, I helped a bit. If not, feel free to ask,
Zoltán
Re: new javadoc for Zest2?? [message #901781 is a reply to message #901737] Tue, 14 August 2012 15:03 Go to previous messageGo to next message
Mark Fenbers is currently offline Mark Fenbers
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
I found one example for version 3.8 on the eclipse.org/gef/ site called GraphSnippet8.java which I have not had the opportunity to study in great detail, yet, but I do not see a LayoutContext class used in the sample code. Does this mean this is not a good example to work from to show me the new way of doing things? Is there a more appropriate snippet?

My code uses HorizontalTreeLayoutAlgorithm, and this seems to have disappeared from the Zest2.0 Jar files. Has something else replaced this?

Mark
Re: new javadoc for Zest2?? [message #901784 is a reply to message #901781] Tue, 14 August 2012 15:07 Go to previous messageGo to next message
Zoltan Ujhelyi is currently offline Zoltan Ujhelyi
Messages: 221
Registered: July 2009
Senior Member
The example you have checked is still for Zest 1.x... As I said before, Zest 2.0 was not released.

On the other hand, the Zest wiki you have already found lists a single layout algorithm in the end, with the link to an example code: http://git.eclipse.org/c/gef/org.eclipse.zest.git/tree/org.eclipse.zest.examples/src/org/eclipse/zest/examples/swt/CustomLayout.java

Instead of separate horizontal and vertical tree layout algorithms, there is a combined TreeLayoutAlgorithm available that uses the direction as a constructor parameter. See http://git.eclipse.org/c/gef/org.eclipse.zest.git/tree/org.eclipse.zest.layouts/src/org/eclipse/zest/layouts/algorithms/TreeLayoutAlgorithm.java for the entire code.

I hope, I was more helpful this time,
Zoltán
Re: new javadoc for Zest2?? [message #901970 is a reply to message #901784] Wed, 15 August 2012 11:10 Go to previous message
Mark Fenbers is currently offline Mark Fenbers
Messages: 48
Registered: July 2009
Location: Ohio, USA
Member
Yes, Zoltan, your reply was more helpful. Even though I found these links on my own and was able to use them to get my code working again (using 2.0), your assertion of my suspicions gives me confidence that I'm doing things properly.

Mark
Previous Topic:[ZEST] Center view on a selected node
Next Topic:Background Image - Poof!
Goto Forum:
  


Current Time: Wed Oct 22 09:59:43 GMT 2014

Powered by FUDForum. Page generated in 0.01779 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software