Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [Zest](How to change the polar point for nodes?)
[Zest] [message #1746504] Mon, 31 October 2016 10:46 Go to next message
Christoph Broeter is currently offline Christoph BroeterFriend
Messages: 30
Registered: July 2015
Member
Hello.

First of all I am currently trying to implement an own layout algorithm using Zest for visualization purposes.
So far the algorithm works as intended but the transition to Zest is not working as desired. I think (not quite sure) that the main issue lies in the different handling of the polar point. Therefore I have 2 questions.


    1) Where is the polar point located in Zest for its components (mainly nodes)
    2) Is it possible to move the polar point for a custom ContentProvider?

      • otherwise I have to move the polar point (currently top, left) handled by every layout algorithm.

Re: [Zest] [message #1746639 is a reply to message #1746504] Wed, 02 November 2016 12:06 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
Hi Christoph,

I am unsure what you mean by polar point, can you give an example?

The center position and the size of the nodes can be specified via LayoutProperties (LOCATION_PROPERTY and SIZE_PROPERTY). These need to be computed from ZestProperties prior to running a layout pass, and they need to be transferred to ZestProperties after running a layout pass. The code for transferring the properties should already be present, so that your algorithm can use the LayoutProperties without caring about ZestProperties.

What exactly are the problems that you encounter?

Best regards,
Matthias
Re: [Zest] [message #1746646 is a reply to message #1746639] Wed, 02 November 2016 13:29 Go to previous messageGo to next message
Christoph Broeter is currently offline Christoph BroeterFriend
Messages: 30
Registered: July 2015
Member
Hi Matthias.

We've implemented a piece of software to visualize depended sets of data. The implementation started last year and we used GEF4/Zest 0.2.0 as foundation for that implementation. If you may ask why we used that version I would give the answer "Because it was the current version on the Eclipse marketplace". Later I figured out that there is a much newer version of Zest available, but due to the fact that the software (our software) grew in the meantime, we could not change to the newer version on the fly. It seems that a lot has changed since Zest version 0.2.0 up to today. We did shift to the newest Milestone because we did not want to implement everything again from the scratch.
The software makes use of graphViz dot and uses the application to layout calculation. The calculated graphViz layout is then used to position the nodes in Zest. A couple of days ago we changed the custom content provider along with the custom node content part extending NodeContentPart. Along with the change a drastic change in note position took place. We expect it to be a bug in our system based on the custom NodeContentPart and the related polar point of every node. Cause the regarding node a is in the vicinity to its position calculated by graphViz but not in place. We further argue that the issue might be related to the polar point of each component. With that I meant the the point(x=0, y=0) of a node.
Because I don't know if there is a fast solution for our circumstance , I thought asking the experts might help and spare some time.

I don't know if this answers all your questions. And I also don't know If you can help me (reason for that might be the use of the deprecated version 0.2.0).
I appreciate every possible support.

Greetings
Christoph
Re: [Zest] [message #1746708 is a reply to message #1746646] Thu, 03 November 2016 15:06 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
Hi Christoph,

it should be possible to circumvent the issue when providing/adapting layout properties, i.e. when reading the node's location to pass it to the layout algorithm and when writing the node's location that was computed by the layout algorithm, which is done within NodeLayoutBehavior. So you could try to override this behavior and provide logic that is suitable for your CustomNodePart. If you need assistance with this, it would be best if you could provide a small application that demonstrates the problems. Alternatively, you could log the dot input and dot output as well as the bounds-in-parent of the nodes prior to and after laying out to identify problems (origin, axis direction, scale factor when transferring coordinates to/from dot, etc.).

Btw, I have some experience with integrating Graphviz in a Zest-based application, too, and it is planned that a dot executable is contributed to Eclipse at some point [1]. Moreover, the 0.2.0 NodeContentPart was not so well written JavaFX, but a (relatively) thought-through replacement is planned to be shipped with GEF 5.0.0, together with some other Zest improvements (e.g. background layout). So if you encounter issues with the Graphviz integration, or if you have any questions regarding NodeContentPart, feel free to ask.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=491098

Best regards,
Matthias
Re: [Zest] [message #1746759 is a reply to message #1746708] Fri, 04 November 2016 10:04 Go to previous messageGo to next message
Christoph Broeter is currently offline Christoph BroeterFriend
Messages: 30
Registered: July 2015
Member
Thank you Matthias for your kind reply.
You are absolutely correct, when you say that the NodeContentProvider was not written very well in 0.2.0. But we got used to it...
Maybe we are willing to switch to the current Zest milestone. Is a 'eazy' migration possible?

If we came along other GraphViz issues we will definitely make use of your offer.
Thank you so much.

Btw. We fixed the issue. It was related to the correct placement of every single node (polar-point expectation vs real location).
Sadly the GraphVis layout calculation is way less performant than those of other libraries we make use of.
Re: [Zest] [message #1748249 is a reply to message #1746759] Mon, 21 November 2016 15:18 Go to previous messageGo to next message
Christoph Broeter is currently offline Christoph BroeterFriend
Messages: 30
Registered: July 2015
Member
Hello again!
How do layout algorithms get information on node sizes?
Issue is: On calling refresh on the ZestContentViewer object, nodes will be moved on the canvas without making changes on the selected layout algorithm. The same behavior occurs on shell minimization/maximization.
Re: [Zest] [message #1748270 is a reply to message #1748249] Mon, 21 November 2016 16:37 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
When the area changes in which a layout algorithm is allowed to place nodes and edges, then the layout-model -- its layout-bounds property to be specific -- is adjusted accordingly, and hence, a layout-pass is performed. This is controlled by GraphLayoutBehavior via listeners on the viewer bounds or the layout-bounds of a node containing a nested graph, respectively.

Currently, when calling ZestContentViewer#refresh() the current contents are replaced with new contents that are computed using the IContentProvider and ILabelProvider, thus losing all layout information.

Best regards,
Matthias
Previous Topic:[GEF4] Bad Performance on Scaling with larger amount of Nodes
Next Topic:How to set minimum size of column for GEF-Paletteviewer with ColumnsLayout?
Goto Forum:
  


Current Time: Sat Nov 17 09:09:47 GMT 2018

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

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

Back to the top