Search in sources :

Example 16 with CreateConnectionRequest

use of org.eclipse.gef.requests.CreateConnectionRequest in project archi by archimatetool.

the class ArchimateDiagramConnectionPolicyTests method testGetConnectionCreateCommand_CreatesArchimateConnectionCommand.

@Test
public void testGetConnectionCreateCommand_CreatesArchimateConnectionCommand() throws Exception {
    setupSourcePolicy(IArchimateFactory.eINSTANCE.createBusinessActor());
    CreateConnectionRequest request = new CreateConnectionRequest();
    request.setFactory(new ArchimateDiagramModelFactory(IArchimatePackage.eINSTANCE.getAssignmentRelationship()));
    Command cmd = sourcePolicy.getConnectionCreateCommand(request);
    assertNotNull(cmd);
    assertTrue(cmd.getClass() == CreateDiagramArchimateConnectionWithDialogCommand.class);
    assertEquals(cmd, request.getStartCommand());
    assertEquals(sourceDiagramObject, TestUtils.getPrivateField(cmd, "fSource"));
}
Also used : CreateDiagramConnectionCommand(com.archimatetool.editor.diagram.commands.CreateDiagramConnectionCommand) CreateDiagramArchimateConnectionWithDialogCommand(com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand) Command(org.eclipse.gef.commands.Command) CreateDiagramArchimateConnectionWithDialogCommand(com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand) ArchimateDiagramModelFactory(com.archimatetool.editor.diagram.ArchimateDiagramModelFactory) CreateConnectionRequest(org.eclipse.gef.requests.CreateConnectionRequest) Test(org.junit.Test)

Aggregations

CreateConnectionRequest (org.eclipse.gef.requests.CreateConnectionRequest)16 Command (org.eclipse.gef.commands.Command)8 ArchimateDiagramModelFactory (com.archimatetool.editor.diagram.ArchimateDiagramModelFactory)5 CreateDiagramArchimateConnectionWithDialogCommand (com.archimatetool.editor.diagram.commands.CreateDiagramArchimateConnectionWithDialogCommand)5 CreateDiagramConnectionCommand (com.archimatetool.editor.diagram.commands.CreateDiagramConnectionCommand)4 Point (org.eclipse.draw2d.geometry.Point)4 Test (org.junit.Test)4 EditPart (org.eclipse.gef.EditPart)3 ReconnectRequest (org.eclipse.gef.requests.ReconnectRequest)3 AbstractBaseEditPart (com.archimatetool.editor.diagram.editparts.AbstractBaseEditPart)2 GroupEditPart (com.archimatetool.editor.diagram.editparts.diagram.GroupEditPart)2 IDiagramModelArchimateComponent (com.archimatetool.model.IDiagramModelArchimateComponent)2 ChopboxAnchor (org.eclipse.draw2d.ChopboxAnchor)2 IFigure (org.eclipse.draw2d.IFigure)2 PointList (org.eclipse.draw2d.geometry.PointList)2 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)2 EConnectionCategory (org.talend.core.model.process.EConnectionCategory)2 EConnectionType (org.talend.core.model.process.EConnectionType)2 IConnection (org.talend.core.model.process.IConnection)2 IExternalNode (org.talend.core.model.process.IExternalNode)2