Search in sources :

Example 1 with ICreationFactory

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

the class SketchModelFactoryTests method testGetNewObjectSticky.

@Test
public void testGetNewObjectSticky() {
    ICreationFactory factory = new SketchModelFactory(IArchimatePackage.eINSTANCE.getSketchModelSticky(), ColorFactory.get(201, 231, 183));
    ISketchModelSticky sticky = (ISketchModelSticky) factory.getNewObject();
    assertEquals("Sticky", sticky.getName());
    assertEquals(ColorFactory.convertColorToString(ColorFactory.get(201, 231, 183)), sticky.getFillColor());
}
Also used : ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) ISketchModelSticky(com.archimatetool.model.ISketchModelSticky) Test(org.junit.Test)

Example 2 with ICreationFactory

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

the class CanvasModelFactoryTests method testGetNewObjectCanvasBlock.

@Test
public void testGetNewObjectCanvasBlock() {
    ICreationFactory factory = new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelBlock());
    ICanvasModelBlock block = (ICanvasModelBlock) factory.getNewObject();
    assertEquals("#000000", block.getBorderColor());
}
Also used : ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) ICanvasModelBlock(com.archimatetool.canvas.model.ICanvasModelBlock) Test(org.junit.Test)

Example 3 with ICreationFactory

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

the class CanvasModelFactoryTests method testIsUsedFor.

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

Example 4 with ICreationFactory

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

the class CanvasModelFactoryTests method testGetNewObjectCanvasImage.

@Test
public void testGetNewObjectCanvasImage() {
    ICreationFactory factory = new CanvasModelFactory(ICanvasPackage.eINSTANCE.getCanvasModelImage());
    ICanvasModelImage image = (ICanvasModelImage) factory.getNewObject();
    assertEquals("#000000", image.getBorderColor());
}
Also used : ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) ICanvasModelImage(com.archimatetool.canvas.model.ICanvasModelImage) Test(org.junit.Test)

Example 5 with ICreationFactory

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

the class SketchModelFactoryTests method testGetNewObjectGroup.

@Test
public void testGetNewObjectGroup() {
    ICreationFactory factory = new SketchModelFactory(IArchimatePackage.eINSTANCE.getDiagramModelGroup());
    IDiagramModelGroup group = (IDiagramModelGroup) factory.getNewObject();
    assertEquals("Group", group.getName());
}
Also used : ICreationFactory(com.archimatetool.editor.diagram.ICreationFactory) IDiagramModelGroup(com.archimatetool.model.IDiagramModelGroup) Test(org.junit.Test)

Aggregations

ICreationFactory (com.archimatetool.editor.diagram.ICreationFactory)10 Test (org.junit.Test)10 ArchimateDiagramEditor (com.archimatetool.editor.diagram.ArchimateDiagramEditor)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 SketchEditor (com.archimatetool.editor.diagram.sketch.SketchEditor)1 IDiagramModelConnection (com.archimatetool.model.IDiagramModelConnection)1 IDiagramModelGroup (com.archimatetool.model.IDiagramModelGroup)1 ISketchModelActor (com.archimatetool.model.ISketchModelActor)1 ISketchModelSticky (com.archimatetool.model.ISketchModelSticky)1