use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasViewTest method addWiresConnector.
@Test
public void addWiresConnector() {
final AbstractConnectorView connector = new PolylineConnectorView(0.0, 0.0);
final String uuid = connector.uuid();
connector.setUUID(uuid);
view.addShape(connector);
final WiresShape registeredConnector = view.getWiresManager().getShape(uuid);
assertNull(registeredConnector);
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CaseManagementContainmentAcceptorControlImplTest method testAcceptContainment.
@Test
public void testAcceptContainment() {
control.enable(canvasHandler);
final WiresShape parentShape = makeWiresShape(PARENT_UUID);
final WiresShape childShape = makeWiresShape(CANDIDATE_UUID);
final MockCaseManagementShape ghost = makeWiresShape(CANDIDATE_UUID);
state.setGhost(Optional.of(ghost));
final boolean isAccept = control.CONTAINMENT_ACCEPTOR.acceptContainment(parentShape, new WiresShape[] { childShape });
assertTrue(isAccept);
verify(canvasCommandFactory, times(1)).setChildNode(any(Node.class), any(Node.class), eq(Optional.of(0)), eq(Optional.empty()), eq(Optional.empty()));
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class BaseLayoutManagerTest method setup.
public void setup() {
this.shapes = new ArrayList<>();
this.handler = getLayoutHandler();
this.container = spy(new MockCaseManagementShape());
this.container.setLayoutHandler(handler);
// Shapes are at (0,15), (0,30) and (0,45) by default. Set by LayoutManager.
for (int i = 0; i < 3; i++) {
final int index = i;
final WiresShape shape = new WiresShape(new MultiPath()) {
@Override
public String toString() {
return "WiresShape:" + index;
}
};
container.add(shape);
shapes.add(shape);
}
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CaseManagementColorMapBackedPickerTest method checkDropZonesAreNotAddedForWiresShapes.
@Test
public void checkDropZonesAreNotAddedForWiresShapes() {
final WiresShape shape = mock(WiresShape.class);
picker.addSupplementaryPaths(shape);
verify(picker, never()).addDropZone(any(AbstractCaseManagementShape.class));
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape 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;
}
Aggregations