use of org.kie.workbench.common.stunner.core.graph.content.view.Point2D in project kie-wb-common by kiegroup.
the class TransformImplTest method testGetTranslate.
@Test
public void testGetTranslate() {
final Point2D t = tested.getTranslate();
assertEquals(translate, t);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.Point2D in project kie-wb-common by kiegroup.
the class UpdateCanvasControlPointPositionCommandTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
newPosition = new Point2D(10, 10);
updateCanvasControlPointPositionCommand = spy(new UpdateCanvasControlPointPositionCommand(edge, controlPoint1, newPosition));
}
use of org.kie.workbench.common.stunner.core.graph.content.view.Point2D in project kie-wb-common by kiegroup.
the class UpdateElementPositionCommandTest method setUp.
@Before
@SuppressWarnings("unchecked")
public void setUp() throws Exception {
super.setUp();
when(candidate.getUUID()).thenReturn("uuid1");
when(candidate.getContent()).thenReturn(content);
when(content.getBounds()).thenReturn(new BoundsImpl(new BoundImpl(3d, 27d), new BoundImpl(50d, 50d)));
this.tested = new UpdateElementPositionCommand(candidate, new Point2D(100d, 200d));
}
use of org.kie.workbench.common.stunner.core.graph.content.view.Point2D in project kie-wb-common by kiegroup.
the class GraphBoundsIndexerImplTest method testGetAt.
@Test
public void testGetAt() {
Point2D position = GraphUtils.getPosition((View) graphInstanceParent.startNode.getContent());
double[] size = GraphUtils.getNodeSize((View) graphInstanceParent.startNode.getContent());
double getAtX = position.getX() + (size[0] / 2);
double getAtY = position.getY() + (size[1] / 2);
Node<View<?>, Edge> node = graphBoundsIndexerImpl.getAt(getAtX, getAtY);
assertNotNull(node);
}
use of org.kie.workbench.common.stunner.core.graph.content.view.Point2D in project kie-wb-common by kiegroup.
the class ControlPointControlImplTest method setUp.
@Before
public void setUp() {
super.setUp();
initialControlPointPosition = new Point2D(0, 0);
newControlPointPosition = new Point2D(10, 10);
controlPoint1 = new ControlPointImpl(initialControlPointPosition);
canvasSelectionEvent = new CanvasSelectionEvent(canvasHandler, EDGE_UUID);
canvasControlPointDragStartEvent = new CanvasControlPointDragStartEvent(initialControlPointPosition);
canvasControlPointDragEndEvent = new CanvasControlPointDragEndEvent(newControlPointPosition);
canvasControlPointDoubleClickEvent = new CanvasControlPointDoubleClickEvent(initialControlPointPosition);
controlPointControl = spy(new ControlPointControlImpl(canvasCommandFactory));
when(canvas.getShape(EDGE_UUID)).thenReturn(connectorShape);
when(graphIndex.get(EDGE_UUID)).thenReturn(edge);
when(graphIndex.getEdge(EDGE_UUID)).thenReturn(edge);
when(edge.getContent()).thenReturn(viewConnector);
when(edge.getUUID()).thenReturn(EDGE_UUID);
when(connectorShape.getShapeView()).thenReturn(shapeView);
when(viewConnector.getControlPoints()).thenReturn(Arrays.asList(controlPoint1));
controlPointControl.enable(canvasHandler);
controlPointControl.setCommandManagerProvider(() -> commandManager);
controlPointControl.register(edge);
}
Aggregations