@Test public void testConfigure() { final AbstractCanvasHandler canvasHandler = mock(AbstractCanvasHandler.class); final AbstractCanvas canvas = mock(AbstractCanvas.class); final AbstractCanvas.CanvasView canvasView = mock(AbstractCanvas.CanvasView.class); final Transform transform = mock(Transform.class); when(canvasHandler.getCanvas()).thenReturn(canvas); when(canvasHandler.getAbstractCanvas()).thenReturn(canvas); when(canvas.getTransform()).thenReturn(transform); when(canvas.getView()).thenReturn(canvasView); when(canvasView.getAbsoluteLocation()).thenReturn(new Point2D(220d, 50.5d)); final CanvasDefinitionTooltip t = tested.configure(canvasHandler); assertEquals(tested, t); verify(textTooltip, times(1)).setTransform(eq(transform)); final ArgumentCaptor<Point2D> pointCaptor = ArgumentCaptor.forClass(Point2D.class); verify(textTooltip, times(1)).setCanvasLocation(pointCaptor.capture()); final Point2D point = pointCaptor.getValue(); assertEquals(220d, point.getX(), 0); assertEquals(50.5d, point.getY(), 0); }
public CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler) { setTransform(canvasHandler.getCanvas().getTransform()); final Point2D location = canvasHandler.getAbstractCanvas().getView().getAbsoluteLocation(); setCanvasLocation(location); return this; }
CanvasDefinitionTooltip implements CanvasTooltip<CanvasDefinitionTooltip.DefinitionIdContent> { public CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler) { setTransform(canvasHandler.getCanvas().getTransform()); final Point2D location = canvasHandler.getAbstractCanvas().getView().getAbsoluteLocation(); setCanvasLocation(location); return this; } }
CanvasDefinitionTooltip implements CanvasTooltip<CanvasDefinitionTooltip.DefinitionIdContent> { public CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler) { setTransform(canvasHandler.getCanvas().getTransform()); final Point2D location = canvasHandler.getAbstractCanvas().getView().getAbsoluteLocation(); setCanvasLocation(location); return this; } @Inject  CanvasDefinitionTooltip(final DefinitionManager definitionManager,
                                   final DefinitionsCacheRegistry registry,
                                   final CanvasTooltip<String> textTooltip);   CanvasDefinitionTooltip(final CanvasTooltip<String> textTooltip,
                            final Function<String, String> titleProvider); }
CanvasDefinitionTooltip implements CanvasTooltip<CanvasDefinitionTooltip.DefinitionIdContent> { public CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler) { setTransform(canvasHandler.getCanvas().getTransform()); final Point2D location = canvasHandler.getAbstractCanvas().getView().getAbsoluteLocation(); setCanvasLocation(location); return this; } @Inject  CanvasDefinitionTooltip(final DefinitionManager definitionManager,
                                   final DefinitionsCacheRegistry registry,
                                   final CanvasTooltip<String> textTooltip);   CanvasDefinitionTooltip(final CanvasTooltip<String> textTooltip,
                            final Function<String, String> titleProvider); CanvasDefinitionTooltip setPrefix(final String value); CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler); @Override void setCanvasLocation(final Point2D location); @Override void setTransform(Transform transform); @Override void show(final DefinitionIdContent content,
                     final Point2D location); void show(final String definitionId,
                     final Point2D location); @Override void hide(); void destroy(); }
CanvasDefinitionTooltip implements CanvasTooltip<CanvasDefinitionTooltip.DefinitionIdContent> { public CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler) { setTransform(canvasHandler.getCanvas().getTransform()); final Point2D location = canvasHandler.getAbstractCanvas().getView().getAbsoluteLocation(); setCanvasLocation(location); return this; } @Inject  CanvasDefinitionTooltip(final DefinitionManager definitionManager,
                                   final DefinitionsCacheRegistry registry,
                                   final CanvasTooltip<String> textTooltip);   CanvasDefinitionTooltip(final CanvasTooltip<String> textTooltip,
                            final Function<String, String> titleProvider); CanvasDefinitionTooltip setPrefix(final String value); CanvasDefinitionTooltip configure(final AbstractCanvasHandler canvasHandler); @Override void setCanvasLocation(final Point2D location); @Override void setTransform(Transform transform); @Override void show(final DefinitionIdContent content,
                     final Point2D location); void show(final String definitionId,
                     final Point2D location); @Override void hide(); void destroy();  }