Search in sources :

Example 1 with MoveDividerDragHandler

use of org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler in project kie-wb-common by kiegroup.

the class DecisionServiceSVGShapeViewTest method testDragConstraintHandler.

@Test
@SuppressWarnings("unchecked")
public void testDragConstraintHandler() {
    final MoveDividerControlHandle moveDividerControlHandle = getMoveDividerControlHandle();
    final IPrimitive control = moveDividerControlHandle.getControl();
    when(dragContext.getNode()).thenReturn(control);
    final MoveDividerDragHandler dragConstraints = (MoveDividerDragHandler) getMoveDividerControlHandle().getControl().getDragConstraints();
    dragConstraints.startDrag(dragContext);
    final DragBounds dragBounds = control.getDragBounds();
    assertThat(dragBounds.getX1()).isEqualTo(0.0);
    assertThat(dragBounds.getY1()).isEqualTo(GeneralRectangleDimensionsSet.DEFAULT_HEIGHT);
    assertThat(dragBounds.getX2()).isEqualTo(WIDTH);
    assertThat(dragBounds.getY2()).isEqualTo(HEIGHT - GeneralRectangleDimensionsSet.DEFAULT_HEIGHT);
}
Also used : IPrimitive(com.ait.lienzo.client.core.shape.IPrimitive) DragBounds(com.ait.lienzo.client.core.types.DragBounds) MoveDividerDragHandler(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler) MoveDividerControlHandle(org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle) Test(org.junit.Test)

Aggregations

IPrimitive (com.ait.lienzo.client.core.shape.IPrimitive)1 DragBounds (com.ait.lienzo.client.core.types.DragBounds)1 Test (org.junit.Test)1 MoveDividerControlHandle (org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerControlHandle)1 MoveDividerDragHandler (org.kie.workbench.common.dmn.client.shape.view.decisionservice.DecisionServiceSVGShapeView.MoveDividerDragHandler)1