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

Bug 489671

Summary: Compute initial label positions after performing a layout pass.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF ZestAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) M6   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2016-03-15 12:41:21 EDT
Currently, the labels within GEF4 Zest are not necessarily associated with an initial position. This leads to special cases within the transform policies and related policies. In order to prevent these special cases, initial positions should be provided for labels after a layout pass is performed.
Comment 1 Matthias Wienand CLA 2016-03-16 06:07:40 EDT
I refactored (un-)scheduling of pre-/post-layout runnables to be done within GraphLayoutBehavior. There are now two types of post-layout runnables: 1) The post-layout runnables that are used to adapt the visualization to the result of a recent layout pass, and 2) post-layout runnables that are used to update the label positions. Consequently, an AbstractLayoutBehavior uses the GraphLayoutBehavior to schedule a "provide layout data" runnable, a "adapt to layout" runnable, and a "update labels" runnable. Updating the label positions is implemented in the AbstractLayoutBehavior and not overwritten by subclasses.

In order to be able to update the label positions, I added methods to AbstractLabelPart that can be used to compute the label position (computeLabelPosition()) and to set the stored label position (setStoredLabelPosition(Point)).

The code is published on the master branch, therefore, I resolve this ticket as fixed for 4.0.0 M6.