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.