Search in sources :

Example 1 with WiresConnectorControl

use of com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl in project kie-wb-common by kiegroup.

the class WiresConnectorViewTest method testHideControlPoints.

@Test
public void testHideControlPoints() {
    final WiresConnectorControl connectorControl = mock(WiresConnectorControl.class);
    tested.setControl(connectorControl);
    final Object wcv = tested.hideControlPoints();
    assertEquals(wcv, tested);
    verify(connectorControl, times(1)).hideControlPoints();
    verify(connectorControl, never()).showControlPoints();
}
Also used : WiresConnectorControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl) Test(org.junit.Test)

Example 2 with WiresConnectorControl

use of com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl in project kie-wb-common by kiegroup.

the class WiresConnectorViewTest method testConnectionControl.

@Test
public void testConnectionControl() {
    final WiresConnectorControl connectorControl = mock(WiresConnectorControl.class);
    final Object wcv = tested.setControl(connectorControl);
    assertEquals(wcv, tested);
    assertEquals(connectorControl, tested.getControl());
}
Also used : WiresConnectorControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl) Test(org.junit.Test)

Example 3 with WiresConnectorControl

use of com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl in project kie-wb-common by kiegroup.

the class WiresConnectorViewTest method testShowControlPointsNotSupported.

@Test(expected = UnsupportedOperationException.class)
public void testShowControlPointsNotSupported() {
    final WiresConnectorControl connectorControl = mock(WiresConnectorControl.class);
    tested.setControl(connectorControl);
    tested.showControlPoints(HasControlPoints.ControlPointType.RESIZE);
}
Also used : WiresConnectorControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl) Test(org.junit.Test)

Example 4 with WiresConnectorControl

use of com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl in project kie-wb-common by kiegroup.

the class WiresCanvasView method addShape.

@Override
public WiresCanvas.View addShape(final ShapeView<?> shapeView) {
    if (WiresUtils.isWiresShape(shapeView)) {
        WiresShape wiresShape = (WiresShape) shapeView;
        wiresManager.register(wiresShape);
        wiresManager.getMagnetManager().createMagnets(wiresShape, getMagnetCardinals());
        WiresUtils.assertShapeGroup(wiresShape.getGroup(), WiresCanvas.WIRES_CANVAS_GROUP_ID);
    } else if (WiresUtils.isWiresConnector(shapeView)) {
        WiresConnector wiresConnector = (WiresConnector) shapeView;
        final WiresConnectorControl connectorControl = wiresManager.register(wiresConnector);
        if (shapeView instanceof WiresConnectorView) {
            ((WiresConnectorView) shapeView).setControl(connectorControl);
        }
        WiresUtils.assertShapeGroup(wiresConnector.getGroup(), WiresCanvas.WIRES_CANVAS_GROUP_ID);
    } else {
        super.addShape(shapeView);
    }
    return this;
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) WiresConnector(com.ait.lienzo.client.core.shape.wires.WiresConnector) WiresConnectorView(org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresConnectorView) WiresConnectorControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl)

Example 5 with WiresConnectorControl

use of com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl in project kie-wb-common by kiegroup.

the class CaseManagementControlFactoryTest method testControls.

@Test
public void testControls() {
    WiresShapeControl shapeControl = factory.newShapeControl(shape, wiresManager);
    assertNotNull(shapeControl);
    assertTrue(shapeControl instanceof CaseManagementShapeControl);
    WiresConnectorControl connectorControl = factory.newConnectorControl(wiresConnector, wiresManager);
    assertNotNull(connectorControl);
    assertTrue(connectorControl instanceof WiresConnectorControlImpl);
    WiresConnectionControl connectionControl = factory.newConnectionControl(wiresConnector, true, wiresManager);
    assertNotNull(connectionControl);
    assertTrue(connectionControl instanceof WiresConnectionControlImpl);
}
Also used : WiresConnectorControlImpl(com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresConnectorControlImpl) WiresShapeControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresShapeControl) WiresConnectionControlImpl(com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresConnectionControlImpl) WiresConnectorControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl) WiresConnectionControl(com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectionControl) Test(org.junit.Test)

Aggregations

WiresConnectorControl (com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectorControl)6 Test (org.junit.Test)5 WiresConnector (com.ait.lienzo.client.core.shape.wires.WiresConnector)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1 WiresConnectionControl (com.ait.lienzo.client.core.shape.wires.handlers.WiresConnectionControl)1 WiresShapeControl (com.ait.lienzo.client.core.shape.wires.handlers.WiresShapeControl)1 WiresConnectionControlImpl (com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresConnectionControlImpl)1 WiresConnectorControlImpl (com.ait.lienzo.client.core.shape.wires.handlers.impl.WiresConnectorControlImpl)1 WiresConnectorView (org.kie.workbench.common.stunner.client.lienzo.shape.view.wires.WiresConnectorView)1