Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 238529

Summary: [Zest2] Missing feature for turning off animation on GraphViewer refresh.
Product: [Tools] GEF Reporter: Matthias Treitler <matthias.treitler>
Component: GEF-Legacy ZestAssignee: Ian Bull <irbull>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: bvitale3002, milesparker, nyssen, p.beauvoir, steeg, zoltan.ujhelyi
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Matthias Treitler CLA 2008-06-26 03:46:34 EDT
On every refresh of the GraphViewer an animation starts where the nodes and connections are layouted on the canvas. This is a nice-to-watch feature but can get annonying for the user when the viewer gets refreshed between short intervals.

Maybe a flag should be passed to the refresh() method of the Graphviewer that animates or not animates the refreshing process.
Comment 1 Fabian Steeg CLA 2012-11-23 17:13:29 EST
I've pushed a proposed fix for this to the GEF4 master:

http://git.eclipse.org/c/gef/org.eclipse.gef4.git/commit/?id=bdfa936

The basic idea is to pass ZestStyles.ANIMATION_DISABLED to graph constructors. See GraphTests#testZestGraphStyles, GraphJFaceSnippet1, and TreeLayoutExample.

I always liked the animations in Zest, but seeing the TreeLayoutExample with animations disabled makes me wonder if having animations disabled would be a more sensible default (it feels snappier and kind of to-the-point).

Leaving this open for now, any feedback welcome.
Comment 2 Miles Parker CLA 2012-11-23 17:15:04 EST
(In reply to comment #1)
> I always liked the animations in Zest, but seeing the TreeLayoutExample with
> animations disabled makes me wonder if having animations disabled would be a
> more sensible default (it feels snappier and kind of to-the-point).

+1 on disabled by default.
Comment 3 Phil Beauvoir CLA 2012-11-25 13:02:18 EST
+1 on this
Comment 4 Zoltan Ujhelyi CLA 2012-11-27 12:42:34 EST
(In reply to comment #1)
> 
> I always liked the animations in Zest, but seeing the TreeLayoutExample with
> animations disabled makes me wonder if having animations disabled would be a
> more sensible default (it feels snappier and kind of to-the-point).
> 

I really like the option to turn off animations. However, wouldn't it better if animations could be enabled/disabled using a setter instead of globally making the choice when the graph is instantiated?

On the other hand, I am indifferent to the default setting - if we need animations, we could always turn them on.
Comment 5 Miles Parker CLA 2012-11-27 12:49:57 EST
(In reply to comment #4)
> I really like the option to turn off animations. However, wouldn't it better
> if animations could be enabled/disabled using a setter instead of globally
> making the choice when the graph is instantiated?

+1. I've implemented just such an approach. I think it was pretty straightforward, but let me know if I can provide any help.
Comment 6 Fabian Steeg CLA 2012-12-23 11:22:29 EST
I was aiming at not making the API larger, but true, being able to turn 
animations on and off for a given graph is actually useful. I changed the 
default and replaced the style bits with a getter and setter:

http://git.eclipse.org/c/gef/org.eclipse.gef4.git/commit/?id=76f52d3

I've also added a checkbox to toggle the animation state in TreeLayoutExample.

Resolving as fixed - feel free to reopen if there are any issues. Thanks!