use of com.archimatetool.model.ISketchModelSticky in project archi by archimatetool.
the class SketchModelStickyTests method testGetCopy.
@Override
@Test
public void testGetCopy() {
super.testGetCopy();
sticky.setContent("hello");
sticky.getProperties().add(IArchimateFactory.eINSTANCE.createProperty());
ISketchModelSticky copy = (ISketchModelSticky) sticky.getCopy();
assertNotSame(sticky, copy);
assertEquals(sticky.getContent(), copy.getContent());
assertNotSame(sticky.getChildren(), copy.getChildren());
assertTrue(copy.getChildren().isEmpty());
assertNotSame(sticky.getProperties(), copy.getProperties());
assertEquals(sticky.getProperties().size(), copy.getProperties().size());
}
use of com.archimatetool.model.ISketchModelSticky in project archi by archimatetool.
the class SketchModelSticky method getCopy.
@Override
public EObject getCopy() {
ISketchModelSticky newObject = (ISketchModelSticky) super.getCopy();
// newObject.setContent(getContent());
newObject.getChildren().clear();
return newObject;
}
use of com.archimatetool.model.ISketchModelSticky 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());
}
use of com.archimatetool.model.ISketchModelSticky 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.ISketchModelSticky in project archi by archimatetool.
the class SketchEditPartFactoryTests method testSketchStickyEditPart.
@Test
public void testSketchStickyEditPart() {
ISketchModelSticky sticky = IArchimateFactory.eINSTANCE.createSketchModelSticky();
EditPart editPart = editPartFactory.createEditPart(null, sticky);
assertTrue(editPart instanceof StickyEditPart);
assertEquals(sticky, editPart.getModel());
}
Aggregations