use of org.kie.workbench.common.stunner.client.lienzo.components.views.LienzoPanelFocusHandler in project kie-wb-common by kiegroup.
the class LienzoPanelMediators method init.
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;
}
use of org.kie.workbench.common.stunner.client.lienzo.components.views.LienzoPanelFocusHandler in project kie-wb-common by kiegroup.
the class LienzoPanelMediatorsTest method testDestroy.
@Test
public void testDestroy() {
tested.destroy();
LienzoPanelFocusHandler focusHandler = mock(LienzoPanelFocusHandler.class);
tested.focusHandler = focusHandler;
tested.destroy();
verify(focusHandler, times(1)).clear();
assertNull(tested.focusHandler);
}
Aggregations