@Test public void testOnCanvasFocusedSelectionEvent() { final SessionPresenterView view = spy(new SessionPresenterView()); final CanvasFocusedShapeEvent event = mock(CanvasFocusedShapeEvent.class); final com.google.gwt.user.client.Element element = mock(com.google.gwt.user.client.Element.class); final int eventX = 101; final int eventY = 110; when(event.getX()).thenReturn(eventX); when(event.getY()).thenReturn(eventY); when(sessionContainer.getElement()).thenReturn(element); doReturn(sessionContainer).when(view).getSessionContainer(); view.onCanvasFocusedSelectionEvent(event); verify(element).setScrollLeft(eventX); verify(element).setScrollTop(eventY); }
void onCanvasFocusedSelectionEvent(final @Observes CanvasFocusedShapeEvent event) { getSessionContainer().getElement().setScrollLeft(event.getX()); getSessionContainer().getElement().setScrollTop(event.getY()); }
SessionPresenterView extends Composite implements SessionPresenter.View { void onCanvasFocusedSelectionEvent(final @Observes CanvasFocusedShapeEvent event) { getSessionContainer().getElement().setScrollLeft(event.getX()); getSessionContainer().getElement().setScrollTop(event.getY()); } }
SessionPresenterView extends Composite implements SessionPresenter.View { void onCanvasFocusedSelectionEvent(final @Observes CanvasFocusedShapeEvent event) { getSessionContainer().getElement().setScrollLeft(event.getX()); getSessionContainer().getElement().setScrollTop(event.getY()); }  }
SessionPresenterView extends Composite implements SessionPresenter.View { void onCanvasFocusedSelectionEvent(final @Observes CanvasFocusedShapeEvent event) { getSessionContainer().getElement().setScrollLeft(event.getX()); getSessionContainer().getElement().setScrollTop(event.getY()); }  @PostConstruct void init(); @Override IsWidget getCanvasWidget(); @Override IsWidget getToolbarWidget(); @Override IsWidget getSessionHeaderContainer(); @Override IsWidget getPaletteWidget(); @Override ScrollType getContentScrollType(); @Override SessionPresenterView setToolbarWidget(final IsWidget widget); @Override SessionPresenterView setSessionHeaderContainer(final IsWidget widget); @Override SessionPresenterView setPaletteWidget(final PaletteWidget<PaletteDefinition> paletteWidget); @Override SessionPresenterView setCanvasWidget(final IsWidget widget); @Override void setContentScrollType(final ScrollType type); @Override SessionPresenterView showError(final String message); @Override void showSessionHeaderContainer(final int sessionHeaderHeight); @Override void hideSessionHeaderContainer(); @Override SessionPresenter.View showWarning(final String message); @Override SessionPresenterView showMessage(final String message); @Override SessionPresenterView showLoading(final boolean loading); @Override void onResize(); void destroy(); }
SessionPresenterView extends Composite implements SessionPresenter.View { void onCanvasFocusedSelectionEvent(final @Observes CanvasFocusedShapeEvent event) { getSessionContainer().getElement().setScrollLeft(event.getX()); getSessionContainer().getElement().setScrollTop(event.getY()); }  @PostConstruct void init(); @Override IsWidget getCanvasWidget(); @Override IsWidget getToolbarWidget(); @Override IsWidget getSessionHeaderContainer(); @Override IsWidget getPaletteWidget(); @Override ScrollType getContentScrollType(); @Override SessionPresenterView setToolbarWidget(final IsWidget widget); @Override SessionPresenterView setSessionHeaderContainer(final IsWidget widget); @Override SessionPresenterView setPaletteWidget(final PaletteWidget<PaletteDefinition> paletteWidget); @Override SessionPresenterView setCanvasWidget(final IsWidget widget); @Override void setContentScrollType(final ScrollType type); @Override SessionPresenterView showError(final String message); @Override void showSessionHeaderContainer(final int sessionHeaderHeight); @Override void hideSessionHeaderContainer(); @Override SessionPresenter.View showWarning(final String message); @Override SessionPresenterView showMessage(final String message); @Override SessionPresenterView showLoading(final boolean loading); @Override void onResize(); void destroy();  }