Search in sources :

Example 1 with LinkingResource

use of org.palladiosimulator.pcm.resourceenvironment.LinkingResource in project Palladio-Editors-Sirius by PalladioSimulator.

the class ReconnectLinkingResourceOfConnector method execute.

@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
    DNodeContainer otherEnd = (DNodeContainer) parameters.get("otherEnd");
    ResourceContainer element = (ResourceContainer) otherEnd.getTarget();
    LinkingResource source = (LinkingResource) parameters.get("source");
    LinkingResource target = (LinkingResource) parameters.get("target");
    source.getConnectedResourceContainers_LinkingResource().remove(element);
    target.getConnectedResourceContainers_LinkingResource().add(element);
}
Also used : DNodeContainer(org.eclipse.sirius.diagram.DNodeContainer) LinkingResource(org.palladiosimulator.pcm.resourceenvironment.LinkingResource) ResourceContainer(org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)

Example 2 with LinkingResource

use of org.palladiosimulator.pcm.resourceenvironment.LinkingResource 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)

Aggregations

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