use of com.archimatetool.model.IArchimateDiagramModel in project archi by archimatetool.
the class NestedElementsChecker method findWrongNestedElements.
// Nested diagram elements without correct relationships
List<IIssue> findWrongNestedElements() {
List<IIssue> issues = new ArrayList<IIssue>();
for (IArchimateDiagramModel dm : fViews) {
for (Iterator<EObject> iter = dm.eAllContents(); iter.hasNext(); ) {
EObject eObject = iter.next();
if (eObject instanceof IDiagramModelArchimateObject) {
IDiagramModelArchimateObject parent = (IDiagramModelArchimateObject) eObject;
for (IDiagramModelObject dmoChild : parent.getChildren()) {
if (dmoChild instanceof IDiagramModelArchimateObject) {
IDiagramModelArchimateObject child = (IDiagramModelArchimateObject) dmoChild;
if (isNestedWithoutValidRelation(parent, child)) {
String description = NLS.bind(fDescription, new Object[] { child.getName(), parent.getName() });
IIssue issue = new AdviceType(fName, description, fExplanation, child);
issues.add(issue);
}
}
}
}
}
}
return issues;
}
use of com.archimatetool.model.IArchimateDiagramModel in project archi by archimatetool.
the class ArchimateTestModel method addNewArchimateDiagramModel.
/**
* Create and add a new blank ArchimateDiagramModel adding it to its default folder
*/
public IArchimateDiagramModel addNewArchimateDiagramModel() {
IArchimateDiagramModel dm = IArchimateFactory.eINSTANCE.createArchimateDiagramModel();
model.getDefaultFolderForObject(dm).getElements().add(dm);
return dm;
}
use of com.archimatetool.model.IArchimateDiagramModel in project archi by archimatetool.
the class PropertiesLabelProviderTests method testGetTextDiagramModel.
@Test
public void testGetTextDiagramModel() {
// Text for diagram model
IArchimateDiagramModel dm = IArchimateFactory.eINSTANCE.createArchimateDiagramModel();
String text = provider.getText(new StructuredSelection(dm));
assertEquals("View", text);
// Text for EditPart
ArchimateDiagramPart editPart = new ArchimateDiagramPart();
editPart.setModel(dm);
text = provider.getText(new StructuredSelection(editPart));
assertEquals("View", text);
}
use of com.archimatetool.model.IArchimateDiagramModel in project archi by archimatetool.
the class ArchiLabelProviderTests method testGetGraphicsIconForDiagramModel.
@Test
public void testGetGraphicsIconForDiagramModel() {
// Null object
assertNull(ArchiLabelProvider.INSTANCE.getGraphicsIconForDiagramModel(null));
// Models
IArchimateDiagramModel dm = IArchimateFactory.eINSTANCE.createArchimateDiagramModel();
assertNotNull(ArchiLabelProvider.INSTANCE.getGraphicsIconForDiagramModel(dm));
ISketchModel sm = IArchimateFactory.eINSTANCE.createSketchModel();
assertNotNull(ArchiLabelProvider.INSTANCE.getGraphicsIconForDiagramModel(sm));
}
use of com.archimatetool.model.IArchimateDiagramModel in project archi by archimatetool.
the class ViewpointSection method update.
@Override
protected void update() {
if (fIsExecutingCommand) {
return;
}
String id = ((IArchimateDiagramModel) getFirstSelectedObject()).getViewpoint();
IViewpoint viewPoint = ViewpointManager.INSTANCE.getViewpoint(id);
// A Viewer will get a selectionChanged event when setting it
fIsRefreshing = true;
fComboViewer.setSelection(new StructuredSelection(viewPoint));
fIsRefreshing = false;
}
Aggregations