use of org.eclipse.sirius.diagram.EdgeTarget in project Palladio-Editors-Sirius by PalladioSimulator.
the class RemoveConnectorAction method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
DEdge edge = (DEdge) parameters.get("elementView");
LinkingResource linkingResource = (LinkingResource) edge.getTarget();
EdgeTarget targetNode = edge.getTargetNode();
ResourceContainer resourceContainer = (ResourceContainer) (((DDiagramElement) targetNode).getTarget());
linkingResource.getConnectedResourceContainers_LinkingResource().remove(resourceContainer);
}
use of org.eclipse.sirius.diagram.EdgeTarget in project Palladio-Editors-Sirius by PalladioSimulator.
the class ReconnectTargetOfRecoveryFlow method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
// RecoveryActionBehaviour source = (RecoveryActionBehaviour) parameters.get("source");
RecoveryActionBehaviour newTarget = (RecoveryActionBehaviour) parameters.get("target");
RecoveryActionBehaviour element = (RecoveryActionBehaviour) parameters.get("element");
// Removing the original edge
DEdge edge = (DEdge) parameters.get("edgeView");
RecoveryActionBehaviour source = (RecoveryActionBehaviour) edge.getTarget();
EdgeTarget targetNode = edge.getTargetNode();
RecoveryActionBehaviour target = (RecoveryActionBehaviour) (((DDiagramElement) targetNode).getTarget());
// prevent self looping
if (!element.equals(newTarget)) {
source.getFailureHandlingAlternatives__RecoveryActionBehaviour().remove(target);
// Adding it as new connection
element.getFailureHandlingAlternatives__RecoveryActionBehaviour().add(newTarget);
}
}
Aggregations