use of org.kie.workbench.common.stunner.core.client.shape.view.event.MouseDoubleClickHandler in project kie-wb-common by kiegroup.
the class ControlPointControlImpl method registerHandlers.
@SuppressWarnings("unchecked")
private void registerHandlers(final Element element, final Shape<?> shape) {
if (shape.getShapeView() instanceof HasEventHandlers && element instanceof Edge && element.getContent() instanceof ViewConnector) {
final HasEventHandlers hasEventHandlers = (HasEventHandlers) shape.getShapeView();
// Register handler on the Connector to Add a ControlPoint
MouseDoubleClickHandler eventHandler = new MouseDoubleClickHandler() {
@Override
public void handle(MouseDoubleClickEvent event) {
addControlPoint((Edge) element, new ControlPointImpl(event.getX(), event.getY()));
}
};
hasEventHandlers.addHandler(ViewEventType.MOUSE_DBL_CLICK, eventHandler);
registerHandler(element.getUUID(), eventHandler);
}
}
Aggregations