use of org.kie.workbench.common.stunner.client.lienzo.shape.view.ViewEventHandlerManager in project kie-wb-common by kiegroup.
the class LienzoLayer method initialize.
@Override
public LienzoLayer initialize(final Object view) {
this.layer = (com.ait.lienzo.client.core.shape.Layer) view;
this.eventHandlerManager = new ViewEventHandlerManager(layer, SUPPORTED_EVENT_TYPES);
return this;
}
use of org.kie.workbench.common.stunner.client.lienzo.shape.view.ViewEventHandlerManager in project kie-wb-common by kiegroup.
the class LienzoCanvasTest method testEventHandling.
@Test
public void testEventHandling() {
CanvasPanel panel = mock(CanvasPanel.class);
CanvasSettings settings = mock(CanvasSettings.class);
ViewEventHandlerManager eventHandler = mock(ViewEventHandlerManager.class);
tested.initialize(panel, settings, eventHandler);
tested.supports(ViewEventType.DRAG);
verify(eventHandler, times(1)).supports(eq(ViewEventType.DRAG));
tested.enableHandlers();
verify(eventHandler, times(1)).enable();
tested.disableHandlers();
verify(eventHandler, times(1)).disable();
DragHandler dragHandler = mock(DragHandler.class);
tested.addHandler(ViewEventType.DRAG, dragHandler);
verify(eventHandler, times(1)).addHandler(eq(ViewEventType.DRAG), eq(dragHandler));
tested.removeHandler(dragHandler);
verify(eventHandler, times(1)).removeHandler(eq(dragHandler));
}
use of org.kie.workbench.common.stunner.client.lienzo.shape.view.ViewEventHandlerManager in project kie-wb-common by kiegroup.
the class LienzoCanvasTest method testDestroy.
@Test
public void testDestroy() {
CanvasPanel panel = mock(CanvasPanel.class);
CanvasSettings settings = mock(CanvasSettings.class);
ViewEventHandlerManager eventHandler = mock(ViewEventHandlerManager.class);
tested.initialize(panel, settings, eventHandler);
tested.destroy();
verify(eventHandler, times(1)).destroy();
verify(view, times(1)).destroy();
}
use of org.kie.workbench.common.stunner.client.lienzo.shape.view.ViewEventHandlerManager in project kie-wb-common by kiegroup.
the class WiresConnectorViewExt method init.
protected void init(final ViewEventType[] supportedEventTypes) {
this.label = createLabel("");
this.textRotationDegrees = 0;
this.eventHandlerManager = new ViewEventHandlerManager(getLine().asShape(), getLine().asShape(), supportedEventTypes);
}
Aggregations