Search in sources :

Example 1 with EdgeTarget

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);
}
Also used : LinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource) EdgeTarget(org.eclipse.sirius.diagram.EdgeTarget) DDiagramElement(org.eclipse.sirius.diagram.DDiagramElement) DEdge(org.eclipse.sirius.diagram.DEdge) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)

Example 2 with EdgeTarget

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);
    }
}
Also used : EdgeTarget(org.eclipse.sirius.diagram.EdgeTarget) DDiagramElement(org.eclipse.sirius.diagram.DDiagramElement) RecoveryActionBehaviour(org.palladiosimulator.pcm.seff.seff_reliability.RecoveryActionBehaviour) DEdge(org.eclipse.sirius.diagram.DEdge)

Aggregations

DDiagramElement (org.eclipse.sirius.diagram.DDiagramElement)2 DEdge (org.eclipse.sirius.diagram.DEdge)2 EdgeTarget (org.eclipse.sirius.diagram.EdgeTarget)2 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)1 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)1 RecoveryActionBehaviour (org.palladiosimulator.pcm.seff.seff_reliability.RecoveryActionBehaviour)1