Search in sources :

Example 1 with RESIZE

use of com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE in project kie-wb-common by kiegroup.

the class DecisionServiceSVGShapeViewTest method testShapeControlResizeHandles.

@Test
public void testShapeControlResizeHandles() {
    final IControlHandleFactory controlHandleFactory = view.getPath().getControlHandleFactory();
    final IControlHandleList controlHandles = controlHandleFactory.getControlHandles(Collections.singletonList(RESIZE)).get(RESIZE);
    assertThat(controlHandles.size()).isGreaterThan(0);
    assertThat(controlHandles).areExactly(1, new Condition<>(ch -> ch instanceof MoveDividerControlHandle, "Is a MoveDividerControlHandle"));
}
Also used : NodeDragStartEvent(com.ait.lienzo.client.core.event.NodeDragStartEvent) WiresResizeStepEvent(com.ait.lienzo.client.core.shape.wires.event.WiresResizeStepEvent) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) NodeDragEndEvent(com.ait.lienzo.client.core.event.NodeDragEndEvent) Mock(org.mockito.Mock) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) RunWith(org.junit.runner.RunWith) Shape(com.ait.lienzo.client.core.shape.Shape) Attribute(com.ait.lienzo.client.core.Attribute) DragEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.DragEvent) DragBounds(com.ait.lienzo.client.core.types.DragBounds) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Attributes(com.ait.lienzo.client.core.shape.Attributes) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) NodeDragMoveEvent(com.ait.lienzo.client.core.event.NodeDragMoveEvent) DragHandler(org.kie.workbench.common.stunner.core.client.shape.view.event.DragHandler) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) HandlerManager(com.google.gwt.event.shared.HandlerManager) StreamSupport(java.util.stream.StreamSupport) RESIZE(com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE) Node(com.ait.lienzo.client.core.shape.Node) Before(org.junit.Before) MoveDividerDragHandler(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) DragContext(com.ait.lienzo.client.widget.DragContext) IPrimitive(com.ait.lienzo.client.core.shape.IPrimitive) GeneralRectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet) Condition(org.assertj.core.api.Condition) Collections(java.util.Collections) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory) Test(org.junit.Test)

Example 2 with RESIZE

use of com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE in project kie-wb-common by kiegroup.

the class DecisionServiceSVGShapeViewTest method testShapeControlResizeHandlersWithList.

@Test
public void testShapeControlResizeHandlersWithList() {
    final IControlHandleFactory controlHandleFactory = view.getPath().getControlHandleFactory();
    final IControlHandleList controlHandles = controlHandleFactory.getControlHandles(RESIZE).get(RESIZE);
    assertThat(controlHandles.size()).isGreaterThan(0);
    assertThat(controlHandles).areExactly(1, new Condition<>(ch -> ch instanceof MoveDividerControlHandle, "Is a MoveDividerControlHandle"));
}
Also used : NodeDragStartEvent(com.ait.lienzo.client.core.event.NodeDragStartEvent) WiresResizeStepEvent(com.ait.lienzo.client.core.shape.wires.event.WiresResizeStepEvent) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) NodeDragEndEvent(com.ait.lienzo.client.core.event.NodeDragEndEvent) Mock(org.mockito.Mock) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) RunWith(org.junit.runner.RunWith) Shape(com.ait.lienzo.client.core.shape.Shape) Attribute(com.ait.lienzo.client.core.Attribute) DragEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.DragEvent) DragBounds(com.ait.lienzo.client.core.types.DragBounds) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Attributes(com.ait.lienzo.client.core.shape.Attributes) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) NodeDragMoveEvent(com.ait.lienzo.client.core.event.NodeDragMoveEvent) DragHandler(org.kie.workbench.common.stunner.core.client.shape.view.event.DragHandler) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) HandlerManager(com.google.gwt.event.shared.HandlerManager) StreamSupport(java.util.stream.StreamSupport) RESIZE(com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE) Node(com.ait.lienzo.client.core.shape.Node) Before(org.junit.Before) MoveDividerDragHandler(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) DragContext(com.ait.lienzo.client.widget.DragContext) IPrimitive(com.ait.lienzo.client.core.shape.IPrimitive) GeneralRectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet) Condition(org.assertj.core.api.Condition) Collections(java.util.Collections) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory) Test(org.junit.Test)

Example 3 with RESIZE

use of com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE in project kie-wb-common by kiegroup.

the class DecisionServiceSVGShapeViewTest method getMoveDividerControlHandle.

private MoveDividerControlHandle getMoveDividerControlHandle() {
    final IControlHandleFactory controlHandleFactory = view.getPath().getControlHandleFactory();
    final IControlHandleList controlHandles = controlHandleFactory.getControlHandles(RESIZE).get(RESIZE);
    return StreamSupport.stream(controlHandles.spliterator(), false).filter(ch -> ch instanceof MoveDividerControlHandle).map(ch -> (MoveDividerControlHandle) ch).findFirst().get();
}
Also used : NodeDragStartEvent(com.ait.lienzo.client.core.event.NodeDragStartEvent) WiresResizeStepEvent(com.ait.lienzo.client.core.shape.wires.event.WiresResizeStepEvent) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) NodeDragEndEvent(com.ait.lienzo.client.core.event.NodeDragEndEvent) Mock(org.mockito.Mock) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) RunWith(org.junit.runner.RunWith) Shape(com.ait.lienzo.client.core.shape.Shape) Attribute(com.ait.lienzo.client.core.Attribute) DragEvent(org.kie.workbench.common.stunner.core.client.shape.view.event.DragEvent) DragBounds(com.ait.lienzo.client.core.types.DragBounds) SVGPrimitiveShape(org.kie.workbench.common.stunner.svg.client.shape.view.SVGPrimitiveShape) Attributes(com.ait.lienzo.client.core.shape.Attributes) LienzoMockitoTestRunner(com.ait.lienzo.test.LienzoMockitoTestRunner) NodeDragMoveEvent(com.ait.lienzo.client.core.event.NodeDragMoveEvent) DragHandler(org.kie.workbench.common.stunner.core.client.shape.view.event.DragHandler) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) HandlerManager(com.google.gwt.event.shared.HandlerManager) StreamSupport(java.util.stream.StreamSupport) RESIZE(com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE) Node(com.ait.lienzo.client.core.shape.Node) Before(org.junit.Before) MoveDividerDragHandler(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) DragContext(com.ait.lienzo.client.widget.DragContext) IPrimitive(com.ait.lienzo.client.core.shape.IPrimitive) GeneralRectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet) Condition(org.assertj.core.api.Condition) Collections(java.util.Collections) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) IControlHandleList(com.ait.lienzo.client.core.shape.wires.IControlHandleList) IControlHandleFactory(com.ait.lienzo.client.core.shape.wires.IControlHandleFactory)

Aggregations

Attribute (com.ait.lienzo.client.core.Attribute)3 NodeDragEndEvent (com.ait.lienzo.client.core.event.NodeDragEndEvent)3 NodeDragMoveEvent (com.ait.lienzo.client.core.event.NodeDragMoveEvent)3 NodeDragStartEvent (com.ait.lienzo.client.core.event.NodeDragStartEvent)3 Attributes (com.ait.lienzo.client.core.shape.Attributes)3 IPrimitive (com.ait.lienzo.client.core.shape.IPrimitive)3 Node (com.ait.lienzo.client.core.shape.Node)3 Shape (com.ait.lienzo.client.core.shape.Shape)3 RESIZE (com.ait.lienzo.client.core.shape.wires.IControlHandle.ControlHandleStandardType.RESIZE)3 IControlHandleFactory (com.ait.lienzo.client.core.shape.wires.IControlHandleFactory)3 IControlHandleList (com.ait.lienzo.client.core.shape.wires.IControlHandleList)3 WiresResizeStepEvent (com.ait.lienzo.client.core.shape.wires.event.WiresResizeStepEvent)3 DragBounds (com.ait.lienzo.client.core.types.DragBounds)3 DragContext (com.ait.lienzo.client.widget.DragContext)3 LienzoMockitoTestRunner (com.ait.lienzo.test.LienzoMockitoTestRunner)3 HandlerManager (com.google.gwt.event.shared.HandlerManager)3 Collections (java.util.Collections)3 StreamSupport (java.util.stream.StreamSupport)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 Condition (org.assertj.core.api.Condition)3