Source:
<code>private void checkExpected(DiagramEditPart diagramPart) { SWTBotUtils.waitAllUiEvents(); SWTBotGefEditPart bottomEditPart = editor.getEditPart("E"); TestsUtil.waitUntil(new ICondition() { private int distanceBetweenPartAndDecoratorOnXaxis; private int distanceBetweenPartAndDecoratorOnYaxis; @Override public boolean test() throws Exception { int viewportWidth = diagramPart.getViewport().getHorizontalRangeModel().getMaximum(); int viewportHeight = diagramPart.getViewport().getVerticalRangeModel().getMaximum(); int bottomEditPartXPosition = ((GraphicalEditPart) bottomEditPart.part()).getFigure().getBounds().x; int bottomEditPartYPosition = ((GraphicalEditPart) bottomEditPart.part()).getFigure().getBounds().y; distanceBetweenPartAndDecoratorOnXaxis = viewportWidth - bottomEditPartXPosition; distanceBetweenPartAndDecoratorOnYaxis = viewportHeight - bottomEditPartYPosition; if (distanceBetweenPartAndDecoratorOnXaxis < <START> 1100 && <END> distanceBetweenPartAndDecoratorOnYaxis < 210) { return true; } return false; } @Override public String getFailureMessage() { return "viewport after zoom is not correct. Synchronization decorator could have impacted the computing. Width is " + diagramPart.getViewport().getHorizontalRangeModel().getMaximum() + ". And y is " + diagramPart.getViewport().getVerticalRangeModel().getMaximum() + ". Distance between E part and the decorator on x position is: " + distanceBetweenPartAndDecoratorOnXaxis + " but should be lower. Distance between E part and the decorator on y position is: " + distanceBetweenPartAndDecoratorOnYaxis + " but should be lower"; } }); }</code><technical_language>I constants explained</technical_language>

Target:
private void checkExpected(DiagramEditPart diagramPart) { SWTBotUtils.waitAllUiEvents(); SWTBotGefEditPart bottomEditPart = editor.getEditPart("E"); TestsUtil.waitUntil(new ICondition() { private int distanceBetweenPartAndDecoratorOnXaxis; private int distanceBetweenPartAndDecoratorOnYaxis; @Override public boolean test() throws Exception { int viewportWidth = diagramPart.getViewport().getHorizontalRangeModel().getMaximum(); int viewportHeight = diagramPart.getViewport().getVerticalRangeModel().getMaximum(); int bottomEditPartXPosition = ((GraphicalEditPart) bottomEditPart.part()).getFigure().getBounds().x; int bottomEditPartYPosition = ((GraphicalEditPart) bottomEditPart.part()).getFigure().getBounds().y; distanceBetweenPartAndDecoratorOnXaxis = viewportWidth - bottomEditPartXPosition; distanceBetweenPartAndDecoratorOnYaxis = viewportHeight - bottomEditPartYPosition; if (distanceBetweenPartAndDecoratorOnXaxis < MAX_DISTANCE_X && distanceBetweenPartAndDecoratorOnYaxis < MAX_DISTANCE_Y) { return true; } return false; } @Override public String getFailureMessage() { return "viewport after zoom is not correct. Synchronization decorator could have impacted the computing. Width is " + diagramPart.getViewport().getHorizontalRangeModel().getMaximum() + ". And y is " + diagramPart.getViewport().getVerticalRangeModel().getMaximum() + ". Distance between E part and the decorator on x position is: " + distanceBetweenPartAndDecoratorOnXaxis + " but should be lower. Distance between E part and the decorator on y position is: " + distanceBetweenPartAndDecoratorOnYaxis + " but should be lower"; } }); }