use of com.archimatetool.model.ISketchModelActor in project archi by archimatetool.
the class SketchEditPartFactoryTests method testSketchActorEditPart.
@Test
public void testSketchActorEditPart() {
ISketchModelActor actor = IArchimateFactory.eINSTANCE.createSketchModelActor();
EditPart editPart = editPartFactory.createEditPart(null, actor);
assertTrue(editPart instanceof SketchActorEditPart);
assertEquals(actor, editPart.getModel());
}
use of com.archimatetool.model.ISketchModelActor in project archi by archimatetool.
the class SketchModelFactory method getNewObject.
public Object getNewObject() {
Object object = IArchimateFactory.eINSTANCE.create(fTemplate);
// Actor
if (object instanceof ISketchModelActor) {
((ISketchModelActor) object).setName(ArchiLabelProvider.INSTANCE.getDefaultName(fTemplate));
} else // Sticky
if (object instanceof ISketchModelSticky) {
ISketchModelSticky sticky = (ISketchModelSticky) object;
sticky.setName(ArchiLabelProvider.INSTANCE.getDefaultName(fTemplate));
sticky.setTextPosition(ITextPosition.TEXT_POSITION_TOP);
sticky.setTextAlignment(ITextAlignment.TEXT_ALIGNMENT_LEFT);
if (fParam instanceof Color) {
String color = ColorFactory.convertColorToString((Color) fParam);
sticky.setFillColor(color);
Color lineColor = ColorFactory.getDefaultLineColor(sticky);
if (lineColor != null) {
sticky.setLineColor(ColorFactory.convertColorToString(lineColor));
}
}
} else // Group
if (object instanceof IDiagramModelGroup) {
IDiagramModelGroup group = (IDiagramModelGroup) object;
group.setName(ArchiLabelProvider.INSTANCE.getDefaultName(fTemplate));
ColorFactory.setDefaultColors(group);
} else // Connection
if (object instanceof IDiagramModelConnection) {
IDiagramModelConnection connection = (IDiagramModelConnection) object;
if (fParam instanceof Integer) {
connection.setType((Integer) fParam);
}
ColorFactory.setDefaultColors(connection);
}
return object;
}
use of com.archimatetool.model.ISketchModelActor 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());
}
use of com.archimatetool.model.ISketchModelActor in project archi by archimatetool.
the class SketchModelActorTests method testGetCopy.
@Override
@Test
public void testGetCopy() {
super.testGetCopy();
actor.getProperties().add(IArchimateFactory.eINSTANCE.createProperty());
ISketchModelActor copy = (ISketchModelActor) actor.getCopy();
assertNotSame(actor, copy);
assertNotSame(actor.getProperties(), copy.getProperties());
assertEquals(actor.getProperties().size(), copy.getProperties().size());
}
Aggregations