use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class DrillDownManager method goInto.
void goInto() {
IStructuredSelection sel = (IStructuredSelection) fGraphViewer.getSelection();
IArchimateConcept concept = (IArchimateConcept) sel.getFirstElement();
if (isValidObject(concept)) {
saveCurrentState();
fBackStack.push(fCurrentConcept);
fCurrentConcept = concept;
setGraphViewerInput(concept);
updateNavigationButtons();
restoreLastState();
fView.updateLabel();
}
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class NavigatorView method setElement.
private void setElement(Object object) {
fDrillDownAdapter.reset();
IArchimateConcept concept = null;
if (object instanceof IArchimateConcept) {
concept = (IArchimateConcept) object;
} else if (object instanceof IAdaptable) {
concept = ((IAdaptable) object).getAdapter(IArchimateConcept.class);
}
if (concept != null) {
// Need to use an array
getViewer().setInput(new Object[] { concept });
} else {
getViewer().setInput(null);
}
fCurrentArchimateConcept = concept;
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class MagicConnectionCreationTool method setTargetEditPart.
@Override
protected void setTargetEditPart(EditPart editpart) {
/*
* Set editpart to null if it's not an Archimate target concept so we can handle it as if we clicked on the canvas.
* This also disables unwanted connection target feedback.
*/
if (editpart != null && !(editpart.getModel() instanceof IDiagramModelArchimateComponent)) {
editpart = null;
}
/*
* Check whether we are trying to connect an element to a relation where the relation is already connected to that element
* If we are, set editpart to null to veto it.
*/
if (editpart != null) {
EditPart sourceEditPart = ((CreateConnectionRequest) getSourceRequest()).getSourceEditPart();
if (sourceEditPart != null) {
if (sourceEditPart.getModel() instanceof IDiagramModelArchimateComponent && editpart.getModel() instanceof IDiagramModelArchimateComponent) {
IArchimateConcept sourceConcept = ((IDiagramModelArchimateComponent) sourceEditPart.getModel()).getArchimateConcept();
IArchimateConcept targetConcept = ((IDiagramModelArchimateComponent) editpart.getModel()).getArchimateConcept();
if (ArchimateModelUtils.hasDirectRelationship(sourceConcept, targetConcept)) {
editpart = null;
}
}
}
}
super.setTargetEditPart(editpart);
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class ZestViewerContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof IArchimateConcept) {
IArchimateConcept archimateConcept = (IArchimateConcept) inputElement;
// Check if it was deleted
if (archimateConcept.eContainer() == null) {
return new Object[0];
}
// Relationship
if (archimateConcept instanceof IArchimateRelationship) {
return new Object[] { inputElement };
}
// Element - Get its relationships
if (archimateConcept instanceof IArchimateElement) {
List<IArchimateRelationship> mainList = new ArrayList<IArchimateRelationship>();
getRelations(mainList, new ArrayList<IArchimateConcept>(), archimateConcept, 0);
return mainList.toArray();
}
}
return new Object[0];
}
use of com.archimatetool.model.IArchimateConcept in project archi by archimatetool.
the class ZestViewerLabelProvider method getTooltip.
public IFigure getTooltip(Object entity) {
if (entity instanceof IArchimateConcept) {
ToolTipFigure l = new ToolTipFigure();
String type = ArchiLabelProvider.INSTANCE.getDefaultName(((EObject) entity).eClass());
l.setText(ArchiLabelProvider.INSTANCE.getLabel(entity));
// $NON-NLS-1$
l.setType(Messages.ZestViewerLabelProvider_0 + " " + type);
if (entity instanceof IArchimateRelationship) {
l.setRubric(ArchiLabelProvider.INSTANCE.getRelationshipSentence((IArchimateRelationship) entity));
}
return l;
}
return null;
}
Aggregations