Search in sources :

Example 11 with IBounds

use of com.archimatetool.model.IBounds in project archi by archimatetool.

the class DiagramModelObject method basicSetBounds.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetBounds(IBounds newBounds, NotificationChain msgs) {
    IBounds oldBounds = bounds;
    bounds = newBounds;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IArchimatePackage.DIAGRAM_MODEL_OBJECT__BOUNDS, oldBounds, newBounds);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) IBounds(com.archimatetool.model.IBounds)

Example 12 with IBounds

use of com.archimatetool.model.IBounds in project archi by archimatetool.

the class ArchimateFactoryTests method testCreateBounds.

@Test
public void testCreateBounds() {
    IBounds bounds = IArchimateFactory.eINSTANCE.createBounds(1, 2, 3, 4);
    assertNotNull(bounds);
    assertEquals(1, bounds.getX());
    assertEquals(2, bounds.getY());
    assertEquals(3, bounds.getWidth());
    assertEquals(4, bounds.getHeight());
}
Also used : IBounds(com.archimatetool.model.IBounds) Test(org.junit.Test)

Example 13 with IBounds

use of com.archimatetool.model.IBounds in project archi by archimatetool.

the class DiagramModelObjectTests method testGetCopy.

@Override
@Test
public void testGetCopy() {
    super.testGetCopy();
    IDiagramModelConnection conn = IArchimateFactory.eINSTANCE.createDiagramModelConnection();
    conn.connect(object, object);
    object.addConnection(conn);
    assertTrue(object.getSourceConnections().contains(conn));
    assertTrue(object.getTargetConnections().contains(conn));
    IBounds bounds = IArchimateFactory.eINSTANCE.createBounds(2, 4, 6, 8);
    object.setBounds(bounds);
    IDiagramModelObject copy = (IDiagramModelObject) object.getCopy();
    assertNotSame(object, copy);
    assertTrue(copy.getSourceConnections().isEmpty());
    assertTrue(copy.getTargetConnections().isEmpty());
    assertNotSame(bounds, copy.getBounds());
    assertEquals(bounds.getX(), copy.getBounds().getX());
    assertEquals(bounds.getY(), copy.getBounds().getY());
    assertEquals(bounds.getWidth(), copy.getBounds().getWidth());
    assertEquals(bounds.getHeight(), copy.getBounds().getHeight());
}
Also used : IBounds(com.archimatetool.model.IBounds) IDiagramModelConnection(com.archimatetool.model.IDiagramModelConnection) IDiagramModelObject(com.archimatetool.model.IDiagramModelObject) Test(org.junit.Test)

Aggregations

IBounds (com.archimatetool.model.IBounds)13 IDiagramModelObject (com.archimatetool.model.IDiagramModelObject)6 Dimension (org.eclipse.draw2d.geometry.Dimension)6 Test (org.junit.Test)4 SetConstraintObjectCommand (com.archimatetool.editor.diagram.commands.SetConstraintObjectCommand)2 IDiagramModelArchimateObject (com.archimatetool.model.IDiagramModelArchimateObject)2 IDiagramModelContainer (com.archimatetool.model.IDiagramModelContainer)2 IDiagramModelImage (com.archimatetool.model.IDiagramModelImage)2 ILockable (com.archimatetool.model.ILockable)2 Command (org.eclipse.gef.commands.Command)2 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)2 DiagramImageEditPart (com.archimatetool.editor.diagram.editparts.diagram.DiagramImageEditPart)1 IDiagramModelObjectFigure (com.archimatetool.editor.diagram.figures.IDiagramModelObjectFigure)1 DiagramImageFigure (com.archimatetool.editor.diagram.figures.diagram.DiagramImageFigure)1 IGraphicalObjectUIProvider (com.archimatetool.editor.ui.factory.IGraphicalObjectUIProvider)1 IArchimateElement (com.archimatetool.model.IArchimateElement)1 IDiagramModel (com.archimatetool.model.IDiagramModel)1 IDiagramModelConnection (com.archimatetool.model.IDiagramModelConnection)1 IJunction (com.archimatetool.model.IJunction)1 File (java.io.File)1