use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class ShapeViewDragProxyImpl method show.
@Override
public DragProxy<AbstractCanvas, ShapeView<?>, DragProxyCallback> show(final ShapeView<?> item, final int x, final int y, final DragProxyCallback callback) {
final AbstractDragProxy.Callback c = new AbstractDragProxy.Callback() {
@Override
public void onStart(final int x, final int y) {
callback.onStart(x, y);
}
@Override
public void onMove(final int x, final int y) {
callback.onMove(x, y);
}
@Override
public void onComplete(final int x, final int y) {
callback.onComplete(x, y);
}
};
if (item instanceof WiresShape) {
final WiresShape wiresShape = (WiresShape) item;
this.proxy = new WiresShapeDragProxy(getLayer().getLienzoLayer(), wiresShape, x, y, 100, c);
} else if (item instanceof WiresConnector) {
final WiresConnector wiresConnector = (WiresConnector) item;
this.proxy = new WiresConnectorDragProxy(getLayer().getLienzoLayer(), wiresConnector, x, y, 100, c);
}
return this;
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class LienzoLayerUtilsTest method registerShape.
private WiresShape registerShape(final String expectedUUID) {
final Shape path = new MultiPath();
final WiresShape ws = new WiresShape((MultiPath) path);
WiresUtils.assertShapeUUID(ws.getContainer(), expectedUUID);
return ws;
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CanvasView method undock.
@Override
public AbstractCanvas.View undock(final ShapeView<?> target, final ShapeView<?> child) {
final WiresShape targetShape = (WiresShape) target;
final WiresShape childShape = (WiresShape) child;
return undock(targetShape, childShape);
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CanvasViewTest method testUndock.
@Test
@SuppressWarnings("unchecked")
public void testUndock() {
final WiresShape wiresShape = mock(WiresShape.class);
final WiresShape targetWiresShape = mock(WiresShape.class);
tested.undock(targetWiresShape, wiresShape);
verify(targetWiresShape, times(1)).remove(eq(wiresShape));
verify(wiresShape, times(1)).setDockedTo((WiresContainer) isNull());
}
use of com.ait.lienzo.client.core.shape.wires.WiresShape in project kie-wb-common by kiegroup.
the class CanvasViewTest method testDock.
@Test
@SuppressWarnings("unchecked")
public void testDock() {
final WiresShape wiresShape = mock(WiresShape.class);
final WiresShape parentWiresShape = mock(WiresShape.class);
tested.dockShape(parentWiresShape, wiresShape);
verify(parentWiresShape, times(1)).add(eq(wiresShape));
verify(wiresShape, times(1)).setDockedTo(eq(parentWiresShape));
}
Aggregations