Search in sources :

Example 1 with DEdge

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);
}
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 DEdge

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);
    }
}
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)

Example 3 with DEdge

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);
    }
}
Also used : 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)3 DEdge (org.eclipse.sirius.diagram.DEdge)3 EdgeTarget (org.eclipse.sirius.diagram.EdgeTarget)2 RecoveryActionBehaviour (org.palladiosimulator.pcm.seff.seff_reliability.RecoveryActionBehaviour)2 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)1 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)1