@Test @SuppressWarnings("unchecked") public void testInit() { ArgumentCaptor<Supplier> canvasSupplier = ArgumentCaptor.forClass(Supplier.class); verify(mediators, times(1)).init(canvasSupplier.capture()); assertEquals(canvas, canvasSupplier.getValue().get()); verify(selector, times(1)).init(canvasSupplier.capture()); assertEquals(canvas, canvasSupplier.getValue().get()); verify(selector, times(1)).setZoomFactor(eq(LienzoPanelMediators.ZOOM_FACTOR)); verify(mediators, times(1)).setZoomFactor(eq(LienzoPanelMediators.ZOOM_FACTOR)); verify(selector, times(1)).setMinScale(eq(LienzoPanelMediators.MIN_SCALE)); verify(mediators, times(1)).setMinScale(eq(LienzoPanelMediators.MIN_SCALE)); verify(selector, times(1)).setMaxScale(eq(LienzoPanelMediators.MAX_SCALE)); verify(mediators, times(1)).setMaxScale(eq(LienzoPanelMediators.MAX_SCALE)); verify(selector, times(1)).show(); }
public LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas) { CanvasPanel panel = canvas.get().getView().getPanel(); if (panel instanceof LienzoPanel) { focusHandler = new LienzoPanelFocusHandler() .listen((LienzoPanel) canvas.get().getView().getPanel(), this::enable, this::disable); mediators.init(canvas); selector.init(canvas); setZoomFactor(ZOOM_FACTOR); setMinScale(MIN_SCALE); setMaxScale(MAX_SCALE); enable(); } return this; }
LienzoPanelMediators { public LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas) { CanvasPanel panel = canvas.get().getView().getPanel(); if (panel instanceof LienzoPanel) { focusHandler = new LienzoPanelFocusHandler() .listen((LienzoPanel) canvas.get().getView().getPanel(), this::enable, this::disable); mediators.init(canvas); selector.init(canvas); setZoomFactor(ZOOM_FACTOR); setMinScale(MIN_SCALE); setMaxScale(MAX_SCALE); enable(); } return this; } }
LienzoPanelMediators { public LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas) { CanvasPanel panel = canvas.get().getView().getPanel(); if (panel instanceof LienzoPanel) { focusHandler = new LienzoPanelFocusHandler() .listen((LienzoPanel) canvas.get().getView().getPanel(), this::enable, this::disable); mediators.init(canvas); selector.init(canvas); setZoomFactor(ZOOM_FACTOR); setMinScale(MIN_SCALE); setMaxScale(MAX_SCALE); enable(); } return this; } @Inject  LienzoPanelMediators(final LienzoCanvasMediators mediators,
                                final ZoomLevelSelectorPresenter selector); }
LienzoPanelMediators { public LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas) { CanvasPanel panel = canvas.get().getView().getPanel(); if (panel instanceof LienzoPanel) { focusHandler = new LienzoPanelFocusHandler() .listen((LienzoPanel) canvas.get().getView().getPanel(), this::enable, this::disable); mediators.init(canvas); selector.init(canvas); setZoomFactor(ZOOM_FACTOR); setMinScale(MIN_SCALE); setMaxScale(MAX_SCALE); enable(); } return this; } @Inject  LienzoPanelMediators(final LienzoCanvasMediators mediators,
                                final ZoomLevelSelectorPresenter selector); LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas); LienzoPanelMediators setMinScale(final double minScale); LienzoPanelMediators setMaxScale(final double maxScale); LienzoPanelMediators setZoomFactor(final double factor); void enable(); void disable(); @PreDestroy void destroy(); }
LienzoPanelMediators { public LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas) { CanvasPanel panel = canvas.get().getView().getPanel(); if (panel instanceof LienzoPanel) { focusHandler = new LienzoPanelFocusHandler() .listen((LienzoPanel) canvas.get().getView().getPanel(), this::enable, this::disable); mediators.init(canvas); selector.init(canvas); setZoomFactor(ZOOM_FACTOR); setMinScale(MIN_SCALE); setMaxScale(MAX_SCALE); enable(); } return this; } @Inject  LienzoPanelMediators(final LienzoCanvasMediators mediators,
                                final ZoomLevelSelectorPresenter selector); LienzoPanelMediators init(final Supplier<LienzoCanvas> canvas); LienzoPanelMediators setMinScale(final double minScale); LienzoPanelMediators setMaxScale(final double maxScale); LienzoPanelMediators setZoomFactor(final double factor); void enable(); void disable(); @PreDestroy void destroy();  }