use of com.archimatetool.model.IDiagramModelConnection in project archi by archimatetool.
the class DiagramModelConnectionTests method testGetCopy.
@Override
@Test
public void testGetCopy() {
connection.connect(source, target);
connection.getProperties().add(IArchimateFactory.eINSTANCE.createProperty());
IDiagramModelConnection copy = (IDiagramModelConnection) connection.getCopy();
assertNotSame(target, copy);
assertNotSame(connection.getProperties(), copy.getProperties());
assertEquals(connection.getProperties().size(), copy.getProperties().size());
assertNotSame(connection.getBendpoints(), copy.getBendpoints());
assertNull(copy.getSource());
assertNull(copy.getTarget());
assertEquals(connection.getDocumentation(), copy.getDocumentation());
assertEquals(connection.getType(), copy.getType());
}
use of com.archimatetool.model.IDiagramModelConnection in project archi by archimatetool.
the class DiagramModelObjectTests method testRemoveConnection.
@Test
public void testRemoveConnection() {
IDiagramModelConnection conn = IArchimateFactory.eINSTANCE.createDiagramModelConnection();
conn.connect(object, object);
object.addConnection(conn);
assertTrue(object.getSourceConnections().contains(conn));
assertTrue(object.getTargetConnections().contains(conn));
// Try to remove bogus connection
IDiagramModelConnection conn2 = IArchimateFactory.eINSTANCE.createDiagramModelConnection();
conn2.connect(IArchimateFactory.eINSTANCE.createDiagramModelNote(), IArchimateFactory.eINSTANCE.createDiagramModelNote());
object.removeConnection(conn2);
assertTrue(object.getSourceConnections().contains(conn));
assertTrue(object.getTargetConnections().contains(conn));
// Now do it properly
object.removeConnection(conn);
assertTrue(object.getSourceConnections().isEmpty());
assertTrue(object.getTargetConnections().isEmpty());
}
use of com.archimatetool.model.IDiagramModelConnection in project archi by archimatetool.
the class DiagramModelObjectTests method testGetSourceConnections.
@Test
public void testGetSourceConnections() {
assertTrue(object.getSourceConnections().isEmpty());
IDiagramModelConnection conn = IArchimateFactory.eINSTANCE.createDiagramModelConnection();
object.getSourceConnections().add(conn);
assertSame(conn, object.getSourceConnections().get(0));
}
use of com.archimatetool.model.IDiagramModelConnection in project archi by archimatetool.
the class DiagramModelObjectTests method testGetTargetConnections.
@Test
public void testGetTargetConnections() {
assertTrue(object.getTargetConnections().isEmpty());
IDiagramModelConnection conn = IArchimateFactory.eINSTANCE.createDiagramModelConnection();
object.getTargetConnections().add(conn);
assertSame(conn, object.getTargetConnections().get(0));
}
use of com.archimatetool.model.IDiagramModelConnection in project archi by archimatetool.
the class DiagramConnectionSection method refreshLineWidthCombo.
protected void refreshLineWidthCombo() {
if (fIsExecutingCommand) {
return;
}
IDiagramModelConnection lastSelectedConnection = (IDiagramModelConnection) getFirstSelectedObject();
int lineWidth = lastSelectedConnection.getLineWidth();
fComboLineWidth.select(lineWidth - 1);
fComboLineWidth.setEnabled(!isLocked(lastSelectedConnection));
}
Aggregations