use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class ZestView method setElement.
private void setElement(Object object) {
IArchimateConcept concept = null;
if (object instanceof IArchimateConcept) {
concept = (IArchimateConcept) object;
} else if (object instanceof IAdaptable) {
concept = ((IAdaptable) object).getAdapter(IArchimateConcept.class);
}
fDrillDownManager.setNewInput(concept);
updateActions();
updateLabel();
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class ZestViewerContentProvider method getRelations.
/**
* Get all relations from source and target of concept and add to list, no more than DEPTH
*/
private void getRelations(List<IArchimateRelationship> mainList, List<IArchimateConcept> checkList, IArchimateConcept concept, int count) {
if (checkList.contains(concept)) {
return;
}
checkList.add(concept);
if (count > fDepth) {
return;
}
count++;
List<IArchimateRelationship> allRelationships = ArchimateModelUtils.getAllRelationshipsForConcept(concept);
for (IArchimateRelationship relationship : allRelationships) {
IArchimateConcept other = relationship.getSource().equals(concept) ? relationship.getTarget() : relationship.getSource();
int direction = relationship.getSource().equals(concept) ? DIR_OUT : DIR_IN;
if (!mainList.contains(relationship) && fViewpoint.isAllowedConcept(other.eClass()) && !isFilteredByRelationship(relationship)) {
if (direction == fDirection || fDirection == DIR_BOTH) {
mainList.add(relationship);
}
}
if (fViewpoint.isAllowedConcept(other.eClass()) && !isFilteredByRelationship(relationship)) {
if (direction == fDirection || fDirection == DIR_BOTH) {
getRelations(mainList, checkList, other, count);
}
}
}
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class MyExporter method writeFolder.
private void writeFolder(IFolder folder) throws IOException {
List<EObject> list = new ArrayList<EObject>();
getElements(folder, list);
for (EObject eObject : list) {
if (eObject instanceof IArchimateConcept) {
IArchimateConcept concept = (IArchimateConcept) eObject;
String string = normalise(concept.eClass().getName()) + "," + // $NON-NLS-1$
normalise(concept.getName()) + "," + // $NON-NLS-1$
normalise(concept.getDocumentation());
// $NON-NLS-1$
writer.write(string + "\n");
}
}
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class MyImporter method createAndAddArchimateComponent.
protected IArchimateConcept createAndAddArchimateComponent(IArchimateModel model, EClass type, String name, String id) {
IArchimateConcept concept = (IArchimateConcept) IArchimateFactory.eINSTANCE.create(type);
concept.setName(name);
concept.setId(id);
IFolder folder = model.getDefaultFolderForObject(concept);
folder.getElements().add(concept);
idLookup.put(concept.getId(), concept);
return concept;
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class DrillDownManager method goBack.
void goBack() {
if (!fBackStack.isEmpty()) {
saveCurrentState();
IArchimateConcept concept = (IArchimateConcept) fBackStack.pop();
if (isDeletedObject(concept)) {
reset();
return;
}
fCurrentConcept = concept;
setGraphViewerInput(concept);
updateNavigationButtons();
restoreLastState();
fView.updateLabel();
}
}
Aggregations