No Support for GEF Zoom?

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

No Support for GEF Zoom?

Postby 3061 » Wed Apr 01, 2009 7:02 am

When editing large diagrams that are bigger than the canvas, the standard GEF Zoom function can make things appear bigger or smaller.

The GUI Tests work fine, but when the Zoom factor is anything else but 100%, the NamedFigureLocators reflect where the GEF Figures would be at 100% Zoom thus clicking in the wrong location.
3061
 
Posts: 42
Joined: Mon Feb 23, 2009 12:43 am

Re: No Support for GEF Zoom?

Postby Phil Quitslund » Thu Apr 02, 2009 9:12 am

Interesting...

When are you setting the zoom? Before or after you find the figures? Could you post some pseudo code? I'll have to take a look at how scaling is handled by the editor but first I want to rule out that you are accessing stale values (e.g., figure bounds that have been calculated before the zoom).

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: No Support for GEF Zoom?

Postby 3061 » Fri Apr 03, 2009 12:14 am

Here's some actual code:

The context is a UML Sequence Diagram, the "Caller" Class is always there per default. The test inserts Class1 to the right of Caller, the Clicks Caller and Class 2. The it clicks on "Auto Zoom", then clicks Caller and Figure again.

I used WindowTester's recorder and copied the ui.click commands. During recording, auto zoom resized the diagram to fit the canvas nicely and then I clicked the center of Caller and Class1. However when playing back that code, the mouse clicks in the same locations before and after zooming.

Code: Select all
createClassesAfterCaller(1, "Class1");
      
ui.click(new NamedFigureLocator("ClassFigureLabelFigure_Caller"));
ui.click(new NamedFigureLocator("ClassFigureLabelFigure_Class1"));
ui.pause(3000);
ui.click(new ContributedToolItemLocator("Auto Zoom"));
ui.pause(3000);
ui.click(new NamedFigureLocator("ClassFigureLabelFigure_Caller"));
ui.click(new NamedFigureLocator("ClassFigureLabelFigure_Class1"));


The recorder output didn't produce nested Locator Classes because clocked GEF Figures (Caller and Class1) implement getFigureId() and have unique names (ClassFigureLabelFigure_Caller and ClassFigureLabelFigure_Class1 respectively)

So the namedFigureLocator finds the figure and doesn't give any errors when clicking it. However, in the diagram, the mouse pointer is way off and selectiong stuff or drag and drop won't work.
Attachments
Caller Class1.PNG
Caller Class1.PNG (3.07 KiB) Viewed 649 times
3061
 
Posts: 42
Joined: Mon Feb 23, 2009 12:43 am

Re: No Support for GEF Zoom?

Postby Phil Quitslund » Mon Apr 06, 2009 7:53 am

Thanks for the additional details. It looks like the old figure bounds are getting cached. The question (obviously) is why they are not getting updated properly... I dug into the GEF ZoomManager to see if anything popped out at me but nothing did so I've opened a ticket in our issue tracker and we'll investigate further and get back to you. In the meantime, if you have any more insights, please share them.

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: No Support for GEF Zoom?

Postby 3061 » Mon Apr 20, 2009 1:30 am

Quick Update:

The same thing happens when an existing Rectangle (GEF Figure) is resized. The Ifigure.getBounds() Methods still have the old values. I think this is more of an GEF Issue.
3061
 
Posts: 42
Joined: Mon Feb 23, 2009 12:43 am

Re: No Support for GEF Zoom?

Postby Phil Quitslund » Mon Apr 20, 2009 10:10 am

Thanks. This is my thought too. The question is how to work-around it... Still investigating.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest