use of org.kie.workbench.common.stunner.core.client.canvas.listener.CanvasShapeListener 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);
}
Aggregations