use of org.kie.workbench.common.stunner.core.client.canvas.listener.CanvasElementListener in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkAddRegistrationListenerDelegatesToWrapped.
@Test
public void checkAddRegistrationListenerDelegatesToWrapped() {
final CanvasElementListener instance = mock(CanvasElementListener.class);
proxy.addRegistrationListener(instance);
verify(wrapped).addRegistrationListener(eq(instance));
}
use of org.kie.workbench.common.stunner.core.client.canvas.listener.CanvasElementListener in project kie-wb-common by kiegroup.
the class CanvasControlRegistrationHandler method initializeListeners.
private void initializeListeners() {
// Canvas listeners.
final C canvas = getCanvas();
this.shapeListener = new CanvasShapeListener() {
@Override
public void register(final Shape item) {
onRegisterShape(item);
}
@Override
public void deregister(final Shape item) {
onDeregisterShape(item);
}
@Override
public void clear() {
onClear();
}
};
canvas.addRegistrationListener(shapeListener);
// Canvas handler listeners.
this.elementListener = new CanvasElementListener() {
@Override
public void update(final Element item) {
onElementRegistration(item, false, true);
}
@Override
public void register(final Element item) {
onRegisterElement(item);
}
@Override
public void deregister(final Element item) {
onDeregisterElement(item);
}
@Override
public void clear() {
onClear();
}
};
getCanvasHandler().addRegistrationListener(elementListener);
}
use of org.kie.workbench.common.stunner.core.client.canvas.listener.CanvasElementListener in project kie-wb-common by kiegroup.
the class SessionPreviewCanvasHandlerProxyTest method checkRemoveRegistrationListenerDelegatesToWrapped.
@Test
public void checkRemoveRegistrationListenerDelegatesToWrapped() {
final CanvasElementListener instance = mock(CanvasElementListener.class);
proxy.removeRegistrationListener(instance);
verify(wrapped).removeRegistrationListener(eq(instance));
}
Aggregations