use of com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor in project kie-wb-common by kiegroup.
the class CaseManagementContainmentAcceptorControlImplTest method getContainmentAcceptor.
private IContainmentAcceptor getContainmentAcceptor() {
verify(canvasView, times(1)).setContainmentAcceptor(containmentAcceptorArgumentCaptor.capture());
final IContainmentAcceptor containmentAcceptor = containmentAcceptorArgumentCaptor.getValue();
return containmentAcceptor;
}
use of com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor in project lienzo-core by ahome-it.
the class WiresContainmentControlImpl method runAcceptor.
private boolean runAcceptor(final boolean allowNotAccept) {
if (!isEnabled()) {
return false;
}
final WiresShape shape = getShape();
final WiresContainer parent = getParent();
final WiresLayer layer = getWiresLayer();
final WiresManager wiresManager = layer.getWiresManager();
final IContainmentAcceptor containmentAcceptor = wiresManager.getContainmentAcceptor();
final WiresShape[] shapes = { shape };
final boolean isParentLayer = (null == parent) || (parent instanceof WiresLayer);
final WiresContainer candidateParent = isParentLayer ? layer : parent;
final boolean isAllowed = containmentAcceptor.containmentAllowed(candidateParent, shapes);
if (!allowNotAccept && isAllowed) {
return containmentAcceptor.acceptContainment(candidateParent, shapes);
}
return isAllowed;
}
use of com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor in project kie-wb-common by kiegroup.
the class CaseManagementContainmentAcceptorControlImplTest method getILayoutHandler.
private ILayoutHandler getILayoutHandler(final WiresContainer parentShape, final WiresShape childShape) {
final IContainmentAcceptor containmentAcceptor = getContainmentAcceptor();
containmentAcceptor.acceptContainment(parentShape, new WiresShape[] { childShape });
return parentShape.getLayoutHandler();
}
use of com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor in project kie-wb-common by kiegroup.
the class CaseManagementContainmentAcceptorControlImplTest method checkDoEnable.
@Test
public void checkDoEnable() {
control.onEnable(canvasView);
final IContainmentAcceptor containmentAcceptor = getContainmentAcceptor();
assertNotNull(containmentAcceptor);
assertTrue(containmentAcceptor instanceof CaseManagementContainmentAcceptorControlImpl.CanvasManagementContainmentAcceptor);
}
use of com.ait.lienzo.client.core.shape.wires.IContainmentAcceptor in project kie-wb-common by kiegroup.
the class CaseManagementContainmentAcceptorControlImplTest method checkContainmentAllowed.
@Test
public void checkContainmentAllowed() {
control.enable(canvasHandler);
final IContainmentAcceptor containmentAcceptor = getContainmentAcceptor();
final WiresShape parentShape = makeWiresShape(PARENT_UUID);
final WiresShape childShape = makeWiresShape(CANDIDATE_UUID);
assertTrue(containmentAcceptor.containmentAllowed(parentShape, new WiresShape[] { childShape }));
verify(canvasCommandFactory, times(1)).removeChild(any(Node.class), any(Node.class));
verify(canvasCommandFactory, times(1)).setChildNode(any(Node.class), any(Node.class));
}
Aggregations