@Test public void testOnMouseDown() { final int clientX = 1; final int clientY = 2; final int x = 3; final int y = 4; widget.initialize(item, shapeFactory, itemMouseDownCallback); widget.onMouseDown(clientX, clientY, x, y); verify(itemMouseDownCallback, times(1)).accept(itemMouseEventCaptor.capture()); assertEquals(ITEM_ID, itemMouseEventCaptor.getValue().getId()); assertEquals(clientX, itemMouseEventCaptor.getValue().getMouseX(), 0); assertEquals(clientY, itemMouseEventCaptor.getValue().getMouseY(), 0); assertEquals(x, itemMouseEventCaptor.getValue().getItemX(), 0); assertEquals(y, itemMouseEventCaptor.getValue().getItemY(), 0); }
@Override public void onMouseDown(final int clientX, final int clientY, final int x, final int y) { if (itemMouseDownCallback != null) { itemMouseDownCallback.accept(new PaletteItemMouseEvent(item.getId(), clientX, clientY, x, y)); } }
CollapsedDefinitionPaletteItemWidget implements CollapsedDefinitionPaletteItemWidgetView.Presenter { @Override public void onMouseDown(final int clientX, final int clientY, final int x, final int y) { if (itemMouseDownCallback != null) { itemMouseDownCallback.accept(new PaletteItemMouseEvent(item.getId(), clientX, clientY, x, y)); } } }
CollapsedDefinitionPaletteItemWidget implements CollapsedDefinitionPaletteItemWidgetView.Presenter { @Override public void onMouseDown(final int clientX, final int clientY, final int x, final int y) { if (itemMouseDownCallback != null) { itemMouseDownCallback.accept(new PaletteItemMouseEvent(item.getId(), clientX, clientY, x, y)); } } @Inject  CollapsedDefinitionPaletteItemWidget(final CollapsedDefinitionPaletteItemWidgetView view); }
CollapsedDefinitionPaletteItemWidget implements CollapsedDefinitionPaletteItemWidgetView.Presenter { @Override public void onMouseDown(final int clientX, final int clientY, final int x, final int y) { if (itemMouseDownCallback != null) { itemMouseDownCallback.accept(new PaletteItemMouseEvent(item.getId(), clientX, clientY, x, y)); } } @Inject  CollapsedDefinitionPaletteItemWidget(final CollapsedDefinitionPaletteItemWidgetView view); @PostConstruct void setUp(); @PreDestroy void destroy(); @Override void initialize(final CollapsedDefaultPaletteItem item,
                           final ShapeFactory<?, ?> shapeFactory,
                           final Consumer<PaletteItemMouseEvent> itemMouseDownCallback); @Override CollapsedDefaultPaletteItem getItem(); @Override void onMouseDown(final int clientX,
                            final int clientY,
                            final int x,
                            final int y); @Override HTMLElement getElement(); }
CollapsedDefinitionPaletteItemWidget implements CollapsedDefinitionPaletteItemWidgetView.Presenter { @Override public void onMouseDown(final int clientX, final int clientY, final int x, final int y) { if (itemMouseDownCallback != null) { itemMouseDownCallback.accept(new PaletteItemMouseEvent(item.getId(), clientX, clientY, x, y)); } } @Inject  CollapsedDefinitionPaletteItemWidget(final CollapsedDefinitionPaletteItemWidgetView view); @PostConstruct void setUp(); @PreDestroy void destroy(); @Override void initialize(final CollapsedDefaultPaletteItem item,
                           final ShapeFactory<?, ?> shapeFactory,
                           final Consumer<PaletteItemMouseEvent> itemMouseDownCallback); @Override CollapsedDefaultPaletteItem getItem(); @Override void onMouseDown(final int clientX,
                            final int clientY,
                            final int x,
                            final int y); @Override HTMLElement getElement();  }