Author: apodhrad
Date: 2012-10-03 12:00:34 -0400 (Wed, 03 Oct 2012)
New Revision: 44250
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gef/SWTBotGefFigure.java
Log:
Added computation for absolute position of a figure
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gef/SWTBotGefFigure.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gef/SWTBotGefFigure.java 2012-10-03
15:46:42 UTC (rev 44249)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/gef/SWTBotGefFigure.java 2012-10-03
16:00:34 UTC (rev 44250)
@@ -43,6 +43,15 @@
return getBounds(this.getFigure());
}
+ /**
+ * Return absolute figures bounds
+ */
+ public Rectangle getAbsoluteBounds() {
+ Rectangle rectangle = getBounds();
+ figure.translateToAbsolute(rectangle);
+ return rectangle;
+ }
+
private Rectangle getBounds(IFigure figure) {
final Rectangle bounds = figure.getBounds().getCopy();
return bounds;
@@ -128,7 +137,6 @@
throw new WidgetNotFoundException("Widget is not Label type");
}
-
private void getSubFigures(IFigure figure, List<IFigure> figures) {
@SuppressWarnings("unchecked")
List<IFigure> children = (List<IFigure>) figure.getChildren();
@@ -147,8 +155,7 @@
*/
public Point getCenter() {
Rectangle bounds = getBounds();
- return new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height
- / 2);
+ return new Point(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2);
}
}
Show replies by date