@Test public void testShowProxy() throws Exception { tested.show(glyphDragItem, 11, 33, mock(Callback.class)); ArgumentCaptor<Layer> layerArgumentCaptor = ArgumentCaptor.forClass(Layer.class); verify(proxyPanel, times(1)).add(layerArgumentCaptor.capture()); Layer layer = layerArgumentCaptor.getValue(); assertEquals(glyphGroup, layer.getChildNodes().get(0)); verify(proxyStyle, times(1)).setCursor(eq(Style.Cursor.AUTO)); verify(proxyStyle, times(1)).setPosition(eq(Style.Position.ABSOLUTE)); verify(proxyStyle, times(1)).setLeft(eq(11d), eq(Style.Unit.PX)); verify(proxyStyle, times(1)).setTop(eq(33d), eq(Style.Unit.PX)); verify(rootPanel, times(1)).add(eq(proxyPanel)); }
public ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item, final int x, final int y, final ShapeGlyphDragHandler.Callback Callback) { final Layer dragProxyLayer = new Layer(); this.dragProxyPanel = lienzoPanelBuilder.apply(item); dragProxyPanel.add(dragProxyLayer); attachHandlers(Callback); dragProxyLayer.add(glyphLienzoGlyphRenderer .render(item.getShape(), item.getWidth(), item.getHeight()) .setX(0) .setY(0)); moveProxyTo(x, y); rootPanelSupplier.get().add(dragProxyPanel); return this; }
ShapeGlyphDragHandler { public ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item, final int x, final int y, final ShapeGlyphDragHandler.Callback Callback) { final Layer dragProxyLayer = new Layer(); this.dragProxyPanel = lienzoPanelBuilder.apply(item); dragProxyPanel.add(dragProxyLayer); attachHandlers(Callback); dragProxyLayer.add(glyphLienzoGlyphRenderer .render(item.getShape(), item.getWidth(), item.getHeight()) .setX(0) .setY(0)); moveProxyTo(x, y); rootPanelSupplier.get().add(dragProxyPanel); return this; } }
ShapeGlyphDragHandler { public ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item, final int x, final int y, final ShapeGlyphDragHandler.Callback Callback) { final Layer dragProxyLayer = new Layer(); this.dragProxyPanel = lienzoPanelBuilder.apply(item); dragProxyPanel.add(dragProxyLayer); attachHandlers(Callback); dragProxyLayer.add(glyphLienzoGlyphRenderer .render(item.getShape(), item.getWidth(), item.getHeight()) .setX(0) .setY(0)); moveProxyTo(x, y); rootPanelSupplier.get().add(dragProxyPanel); return this; } @Inject  ShapeGlyphDragHandler(final LienzoGlyphRenderers glyphLienzoGlyphRenderer);   ShapeGlyphDragHandler(final LienzoGlyphRenderer<Glyph> glyphLienzoGlyphRenderer,
                          final List<HandlerRegistration> handlerRegistrations,
                          final Supplier<AbsolutePanel> rootPanelSupplier,
                          final Function<ShapeGlyphDragHandler.Item, LienzoPanel> lienzoPanelBuilder,
                          final BiConsumer<Command, Integer> timer); }
ShapeGlyphDragHandler { public ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item, final int x, final int y, final ShapeGlyphDragHandler.Callback Callback) { final Layer dragProxyLayer = new Layer(); this.dragProxyPanel = lienzoPanelBuilder.apply(item); dragProxyPanel.add(dragProxyLayer); attachHandlers(Callback); dragProxyLayer.add(glyphLienzoGlyphRenderer .render(item.getShape(), item.getWidth(), item.getHeight()) .setX(0) .setY(0)); moveProxyTo(x, y); rootPanelSupplier.get().add(dragProxyPanel); return this; } @Inject  ShapeGlyphDragHandler(final LienzoGlyphRenderers glyphLienzoGlyphRenderer);   ShapeGlyphDragHandler(final LienzoGlyphRenderer<Glyph> glyphLienzoGlyphRenderer,
                          final List<HandlerRegistration> handlerRegistrations,
                          final Supplier<AbsolutePanel> rootPanelSupplier,
                          final Function<ShapeGlyphDragHandler.Item, LienzoPanel> lienzoPanelBuilder,
                          final BiConsumer<Command, Integer> timer); ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item,
                                      final int x,
                                      final int y,
                                      final ShapeGlyphDragHandler.Callback Callback); void clear(); void destroy(); }
ShapeGlyphDragHandler { public ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item, final int x, final int y, final ShapeGlyphDragHandler.Callback Callback) { final Layer dragProxyLayer = new Layer(); this.dragProxyPanel = lienzoPanelBuilder.apply(item); dragProxyPanel.add(dragProxyLayer); attachHandlers(Callback); dragProxyLayer.add(glyphLienzoGlyphRenderer .render(item.getShape(), item.getWidth(), item.getHeight()) .setX(0) .setY(0)); moveProxyTo(x, y); rootPanelSupplier.get().add(dragProxyPanel); return this; } @Inject  ShapeGlyphDragHandler(final LienzoGlyphRenderers glyphLienzoGlyphRenderer);   ShapeGlyphDragHandler(final LienzoGlyphRenderer<Glyph> glyphLienzoGlyphRenderer,
                          final List<HandlerRegistration> handlerRegistrations,
                          final Supplier<AbsolutePanel> rootPanelSupplier,
                          final Function<ShapeGlyphDragHandler.Item, LienzoPanel> lienzoPanelBuilder,
                          final BiConsumer<Command, Integer> timer); ShapeGlyphDragHandler show(final ShapeGlyphDragHandler.Item item,
                                      final int x,
                                      final int y,
                                      final ShapeGlyphDragHandler.Callback Callback); void clear(); void destroy();  }