use of org.eclipse.sirius.diagram.DEdge 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.DEdge 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);
}
}
use of org.eclipse.sirius.diagram.DEdge in project Palladio-Editors-Sirius by PalladioSimulator.
the class ReconnectSourceOfRecoveryFlow method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
RecoveryActionBehaviour oldSource = (RecoveryActionBehaviour) parameters.get("source");
RecoveryActionBehaviour newSource = (RecoveryActionBehaviour) parameters.get("target");
// Finding the target that the edge is going to
DEdge edge = (DEdge) parameters.get("edgeView");
RecoveryActionBehaviour target = (RecoveryActionBehaviour) (((DDiagramElement) edge.getTargetNode()).getTarget());
// disallow self looping
if (!newSource.equals(target)) {
oldSource.getFailureHandlingAlternatives__RecoveryActionBehaviour().remove(target);
newSource.getFailureHandlingAlternatives__RecoveryActionBehaviour().add(target);
}
}
Aggregations