Search in sources :

Example 6 with ICreationFactory

use of com.archimatetool.editor.diagram.ICreationFactory in project archi by archimatetool.

the class CanvasModelFactoryTests method testGetNewObjectConnection.

@Test
public void testGetNewObjectConnection() {
    ICreationFactory factory = new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelConnection(), 2);
    ICanvasModelConnection connection = (ICanvasModelConnection) factory.getNewObject();
    assertEquals("", connection.getName());
    assertEquals(2, connection.getType());
}
Also used : ICanvasModelConnection(com.archimatetool.canvas.model.ICanvasModelConnection) ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) Test(org.junit.Test)

Example 7 with ICreationFactory

use of com.archimatetool.editor.diagram.ICreationFactory in project archi by archimatetool.

the class CanvasModelFactoryTests method testGetNewObjectCanvasSticky.

@Test
public void testGetNewObjectCanvasSticky() {
    ICreationFactory factory = new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelSticky(), new RGB(0, 0, 0));
    ICanvasModelSticky sticky = (ICanvasModelSticky) factory.getNewObject();
    assertEquals("#000000", sticky.getFillColor());
    assertEquals("#C0C0C0", sticky.getBorderColor());
}
Also used : ICanvasModelSticky(com.archimatetool.canvas.model.ICanvasModelSticky) ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) RGB(org.eclipse.swt.graphics.RGB) Test(org.junit.Test)

Example 8 with ICreationFactory

use of com.archimatetool.editor.diagram.ICreationFactory in project archi by archimatetool.

the class SketchModelFactoryTests method testGetNewObjectActor.

@Test
public void testGetNewObjectActor() {
    ICreationFactory factory = new SketchModelFactory(IArchimatePackage.eINSTANCE.getSketchModelActor());
    ISketchModelActor actor = (ISketchModelActor) factory.getNewObject();
    assertEquals("Actor", actor.getName());
}
Also used : ISketchModelActor(com.archimatetool.model.ISketchModelActor) ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) Test(org.junit.Test)

Example 9 with ICreationFactory

use of com.archimatetool.editor.diagram.ICreationFactory in project archi by archimatetool.

the class SketchModelFactoryTests method testIsUsedFor.

@Test
public void testIsUsedFor() {
    ICreationFactory factory = new SketchModelFactory(null);
    assertTrue(factory.isUsedFor(new SketchEditor()));
    assertFalse(factory.isUsedFor(new ArchimateDiagramEditor()));
}
Also used : ArchimateDiagramEditor(com.archimatetool.editor.diagram.ArchimateDiagramEditor) ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) Test(org.junit.Test)

Example 10 with ICreationFactory

use of com.archimatetool.editor.diagram.ICreationFactory in project archi by archimatetool.

the class SketchModelFactoryTests method testGetNewObjectConnection.

@Test
public void testGetNewObjectConnection() {
    ICreationFactory factory = new SketchModelFactory(IArchimatePackage.eINSTANCE.getDiagramModelConnection(), 2);
    IDiagramModelConnection connection = (IDiagramModelConnection) factory.getNewObject();
    assertEquals("", connection.getName());
    assertEquals(2, connection.getType());
}
Also used : IDiagramModelConnection(com.archimatetool.model.IDiagramModelConnection) ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) Test(org.junit.Test)

Aggregations

ICreationFactory (com.archimatetool.editor.diagram.ICreationFactory)11 Test (org.junit.Test)10 ArchimateDiagramEditor (com.archimatetool.editor.diagram.ArchimateDiagramEditor)2 IDiagramModelGroup (com.archimatetool.model.IDiagramModelGroup)2 RGB (org.eclipse.swt.graphics.RGB)2 ICanvasModelBlock (com.archimatetool.canvas.model.ICanvasModelBlock)1 ICanvasModelConnection (com.archimatetool.canvas.model.ICanvasModelConnection)1 ICanvasModelImage (com.archimatetool.canvas.model.ICanvasModelImage)1 ICanvasModelSticky (com.archimatetool.canvas.model.ICanvasModelSticky)1 ArchimateDiagramModelFactory (com.archimatetool.editor.diagram.ArchimateDiagramModelFactory)1 SketchEditor (com.archimatetool.editor.diagram.sketch.SketchEditor)1 IArchimateConcept (com.archimatetool.model.IArchimateConcept)1 IArchimateElement (com.archimatetool.model.IArchimateElement)1 IBounds (com.archimatetool.model.IBounds)1 IDiagramModelConnection (com.archimatetool.model.IDiagramModelConnection)1 IDiagramModelContainer (com.archimatetool.model.IDiagramModelContainer)1 IDiagramModelNote (com.archimatetool.model.IDiagramModelNote)1 IDiagramModelObject (com.archimatetool.model.IDiagramModelObject)1 IDiagramModelReference (com.archimatetool.model.IDiagramModelReference)1 ISketchModelActor (com.archimatetool.model.ISketchModelActor)1