Search in sources :

Example 1 with EdgeRoutingPointsProvider

use of org.eclipse.sirius.components.diagrams.layout.incremental.provider.EdgeRoutingPointsProvider in project sirius-components by eclipse-sirius.

the class EdgeRoutingPointsProviderTests method testEdgeRoutingPoints.

@Test
public void testEdgeRoutingPoints() {
    EdgeRoutingPointsProvider edgeRoutingPointsProvider = new EdgeRoutingPointsProvider();
    DiagramLayoutData diagramLayoutData = this.createDiagramLayoutData();
    EdgeLayoutData edgeLayoutData = this.createEdgeLayoutData(diagramLayoutData);
    List<Position> routingPoints = edgeRoutingPointsProvider.getRoutingPoints(edgeLayoutData);
    assertThat(routingPoints).hasSize(2);
    Position firstRoutingPoint = routingPoints.get(0);
    assertThat(firstRoutingPoint).extracting(Position::getX).isEqualTo(75.0);
    assertThat(firstRoutingPoint).extracting(Position::getY).isEqualTo(50.0);
    Position secondRoutingPoint = routingPoints.get(1);
    assertThat(secondRoutingPoint).extracting(Position::getX).isEqualTo(225.0);
    assertThat(secondRoutingPoint).extracting(Position::getY).isEqualTo(200.0);
}
Also used : EdgeLayoutData(org.eclipse.sirius.components.diagrams.layout.incremental.data.EdgeLayoutData) DiagramLayoutData(org.eclipse.sirius.components.diagrams.layout.incremental.data.DiagramLayoutData) Position(org.eclipse.sirius.components.diagrams.Position) EdgeRoutingPointsProvider(org.eclipse.sirius.components.diagrams.layout.incremental.provider.EdgeRoutingPointsProvider) Test(org.junit.jupiter.api.Test)

Aggregations

Position (org.eclipse.sirius.components.diagrams.Position)1 DiagramLayoutData (org.eclipse.sirius.components.diagrams.layout.incremental.data.DiagramLayoutData)1 EdgeLayoutData (org.eclipse.sirius.components.diagrams.layout.incremental.data.EdgeLayoutData)1 EdgeRoutingPointsProvider (org.eclipse.sirius.components.diagrams.layout.incremental.provider.EdgeRoutingPointsProvider)1 Test (org.junit.jupiter.api.Test)1