use of com.ait.tooling.nativetools.client.event.HandlerRegistrationManager in project lienzo-core by ahome-it.
the class WiresManager method register.
public WiresConnectorControl register(final WiresConnector connector) {
connector.setConnectionAcceptor(m_connectionAcceptor);
final String uuid = connector.uuid();
final HandlerRegistrationManager m_registrationManager = createHandlerRegistrationManager();
final WiresConnector.WiresConnectorHandler handler = new WiresConnector.WiresConnectorHandlerImpl(connector, this);
connector.setWiresConnectorHandler(m_registrationManager, handler);
getConnectorList().add(connector);
m_shapeHandlersMap.put(uuid, m_registrationManager);
connector.addToLayer(getLayer().getLayer());
return handler.getControl();
}
use of com.ait.tooling.nativetools.client.event.HandlerRegistrationManager in project lienzo-core by ahome-it.
the class WiresManager method register.
public WiresShapeControl register(final WiresShape shape, final boolean addIntoIndex) {
shape.setWiresManager(this);
final WiresShapeHandler handler = new WiresShapeHandler(getControlFactory().newShapeControl(shape, this), getControlFactory().newShapeHighlight(this), this);
if (addIntoIndex) {
// Shapes added to the align and distribute index.
handler.getControl().setAlignAndDistributeControl(addToIndex(shape));
shape.addWiresResizeEndHandler(new WiresResizeEndHandler() {
@Override
public void onShapeResizeEnd(final WiresResizeEndEvent event) {
removeFromIndex(shape);
handler.getControl().setAlignAndDistributeControl(addToIndex(shape));
}
});
}
final HandlerRegistrationManager registrationManager = createHandlerRegistrationManager();
setWiresShapeHandler(shape, registrationManager, handler);
// Shapes added to the canvas layer by default.
getLayer().add(shape);
final String uuid = shape.uuid();
m_shapesMap.put(uuid, shape);
m_shapeHandlersMap.put(uuid, registrationManager);
return handler.getControl();
}
Aggregations