@Test public void testDecisionComponentItemMouseDown() { final MouseDownEvent mouseDownEvent = mock(MouseDownEvent.class); final Callback proxy = mock(Callback.class); final DRGElement drgElement = mock(DRGElement.class); final DMNShapeFactory factory = mock(DMNShapeFactory.class); final ShapeGlyphDragHandler.Item item = mock(ShapeGlyphDragHandler.Item.class); final Glyph glyph = mock(Glyph.class); final int x = 10; final int y = 20; when(dmnShapeSet.getShapeFactory()).thenReturn(factory); when(presenter.getDrgElement()).thenReturn(drgElement); when(factory.getGlyph(any())).thenReturn(glyph); when(mouseDownEvent.getX()).thenReturn(x); when(mouseDownEvent.getY()).thenReturn(y); doReturn(proxy).when(view).makeDragProxyCallbackImpl(drgElement, factory); doReturn(item).when(view).makeDragHandler(glyph); view.decisionComponentItemMouseDown(mouseDownEvent); verify(shapeGlyphDragHandler).show(item, x, y, proxy); }
@EventHandler("decision-component-item") public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) { final DRGElement drgElement = presenter.getDrgElement(); final ShapeFactory factory = dmnShapeSet.getShapeFactory(); final Glyph glyph = factory.getGlyph(drgElement.getClass().getName()); final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph); final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory); shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy); }
DecisionComponentsItemView implements DecisionComponentsItem.View { @EventHandler("decision-component-item") public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) { final DRGElement drgElement = presenter.getDrgElement(); final ShapeFactory factory = dmnShapeSet.getShapeFactory(); final Glyph glyph = factory.getGlyph(drgElement.getClass().getName()); final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph); final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory); shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy); } }
DecisionComponentsItemView implements DecisionComponentsItem.View { @EventHandler("decision-component-item") public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) { final DRGElement drgElement = presenter.getDrgElement(); final ShapeFactory factory = dmnShapeSet.getShapeFactory(); final Glyph glyph = factory.getGlyph(drgElement.getClass().getName()); final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph); final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory); shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy); } @Inject  DecisionComponentsItemView(final HTMLImageElement icon,
                                      final @Named("h5") HTMLHeadingElement name,
                                      final HTMLParagraphElement file,
                                      final DMNShapeSet dmnShapeSet,
                                      final SessionManager sessionManager,
                                      final ShapeGlyphDragHandler shapeGlyphDragHandler,
                                      final Event<BuildCanvasShapeEvent> buildCanvasShapeEvent,
                                      final HTMLDivElement decisionComponentItem,
                                      final Event<NotificationEvent> notificationEvent,
                                      final ClientTranslationService clientTranslationService); }
DecisionComponentsItemView implements DecisionComponentsItem.View { @EventHandler("decision-component-item") public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) { final DRGElement drgElement = presenter.getDrgElement(); final ShapeFactory factory = dmnShapeSet.getShapeFactory(); final Glyph glyph = factory.getGlyph(drgElement.getClass().getName()); final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph); final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory); shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy); } @Inject  DecisionComponentsItemView(final HTMLImageElement icon,
                                      final @Named("h5") HTMLHeadingElement name,
                                      final HTMLParagraphElement file,
                                      final DMNShapeSet dmnShapeSet,
                                      final SessionManager sessionManager,
                                      final ShapeGlyphDragHandler shapeGlyphDragHandler,
                                      final Event<BuildCanvasShapeEvent> buildCanvasShapeEvent,
                                      final HTMLDivElement decisionComponentItem,
                                      final Event<NotificationEvent> notificationEvent,
                                      final ClientTranslationService clientTranslationService); @Override void init(final DecisionComponentsItem presenter); @Override void setIcon(final String iconURI); @Override void setName(final String name); @Override void setFile(final String file); @Override void setIsImported(final boolean imported); @EventHandler("decision-component-item") void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent); }
DecisionComponentsItemView implements DecisionComponentsItem.View { @EventHandler("decision-component-item") public void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent) { final DRGElement drgElement = presenter.getDrgElement(); final ShapeFactory factory = dmnShapeSet.getShapeFactory(); final Glyph glyph = factory.getGlyph(drgElement.getClass().getName()); final ShapeGlyphDragHandler.Item item = makeDragHandler(glyph); final Callback proxy = makeDragProxyCallbackImpl(drgElement, factory); shapeGlyphDragHandler.show(item, mouseDownEvent.getX(), mouseDownEvent.getY(), proxy); } @Inject  DecisionComponentsItemView(final HTMLImageElement icon,
                                      final @Named("h5") HTMLHeadingElement name,
                                      final HTMLParagraphElement file,
                                      final DMNShapeSet dmnShapeSet,
                                      final SessionManager sessionManager,
                                      final ShapeGlyphDragHandler shapeGlyphDragHandler,
                                      final Event<BuildCanvasShapeEvent> buildCanvasShapeEvent,
                                      final HTMLDivElement decisionComponentItem,
                                      final Event<NotificationEvent> notificationEvent,
                                      final ClientTranslationService clientTranslationService); @Override void init(final DecisionComponentsItem presenter); @Override void setIcon(final String iconURI); @Override void setName(final String name); @Override void setFile(final String file); @Override void setIsImported(final boolean imported); @EventHandler("decision-component-item") void decisionComponentItemMouseDown(final MouseDownEvent mouseDownEvent);  }