use of com.archimatetool.canvas.model.ICanvasModelBlock 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());
}
use of com.archimatetool.canvas.model.ICanvasModelBlock in project archi by archimatetool.
the class CanvasModelEditPartFactoryTests method testCanvasBlockActorEditPart.
@Test
public void testCanvasBlockActorEditPart() {
ICanvasModelBlock block = ICanvasFactory.eINSTANCE.createCanvasModelBlock();
EditPart editPart = editPartFactory.createEditPart(null, block);
assertTrue(editPart instanceof CanvasBlockEditPart);
assertEquals(block, editPart.getModel());
}
use of com.archimatetool.canvas.model.ICanvasModelBlock in project archi by archimatetool.
the class CanvasModelFactory method getNewObject.
public Object getNewObject() {
// Create the instance from the registered factory in case of extensions
Object object = fTemplate.getEPackage().getEFactoryInstance().create(fTemplate);
// Sticky
if (object instanceof ICanvasModelSticky) {
ICanvasModelSticky sticky = (ICanvasModelSticky) object;
sticky.setTextPosition(ITextPosition.TEXT_POSITION_CENTRE);
sticky.setTextAlignment(ITextAlignment.TEXT_ALIGNMENT_CENTER);
if (fParam instanceof Color) {
String color = ColorFactory.convertColorToString((Color) fParam);
sticky.setFillColor(color);
}
// $NON-NLS-1$
sticky.setBorderColor("#C0C0C0");
} else // Block
if (object instanceof ICanvasModelBlock) {
ICanvasModelBlock block = (ICanvasModelBlock) object;
block.setTextPosition(ITextPosition.TEXT_POSITION_TOP);
block.setTextAlignment(ITextAlignment.TEXT_ALIGNMENT_LEFT);
// $NON-NLS-1$
block.setBorderColor("#000000");
} else // Image
if (object instanceof ICanvasModelImage) {
ICanvasModelImage image = (ICanvasModelImage) object;
// $NON-NLS-1$
image.setBorderColor("#000000");
} else // Canvas Connection
if (object instanceof ICanvasModelConnection) {
ICanvasModelConnection connection = (ICanvasModelConnection) object;
if (fParam instanceof Integer) {
connection.setType((Integer) fParam);
}
}
return object;
}
use of com.archimatetool.canvas.model.ICanvasModelBlock in project archi by archimatetool.
the class CanvasModelBlock method getCopy.
@Override
public EObject getCopy() {
ICanvasModelBlock newObject = (ICanvasModelBlock) super.getCopy();
// need to do this!
newObject.getChildren().clear();
return newObject;
}
Aggregations