Search in sources :

Example 1 with DNodeContainer

use of org.eclipse.sirius.diagram.DNodeContainer 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 DNodeContainer

use of org.eclipse.sirius.diagram.DNodeContainer in project Palladio-Editors-Sirius by PalladioSimulator.

the class ReconnectSourceOfConformsCompleteRelation method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    ImplementationComponentType newSource = (ImplementationComponentType) parameters.get("target");
    ImplementationComponentType oldSource = (ImplementationComponentType) parameters.get("source");
    DNodeContainer otherEnd = (DNodeContainer) parameters.get("otherEnd");
    CompleteComponentType target = (CompleteComponentType) otherEnd.getTarget();
    newSource.getParentCompleteComponentTypes().add(target);
    oldSource.getParentCompleteComponentTypes().remove(target);
}
Also used : ImplementationComponentType(org.palladiosimulator.pcm.repository.ImplementationComponentType) DNodeContainer(org.eclipse.sirius.diagram.DNodeContainer) CompleteComponentType(org.palladiosimulator.pcm.repository.CompleteComponentType)

Example 3 with DNodeContainer

use of org.eclipse.sirius.diagram.DNodeContainer in project Palladio-Editors-Sirius by PalladioSimulator.

the class ReconnectSourceOfConformsProvidesRelation method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    CompleteComponentType newSource = (CompleteComponentType) parameters.get("target");
    CompleteComponentType oldSource = (CompleteComponentType) parameters.get("source");
    DNodeContainer otherEnd = (DNodeContainer) parameters.get("otherEnd");
    ProvidesComponentType target = (ProvidesComponentType) otherEnd.getTarget();
    newSource.getParentProvidesComponentTypes().add(target);
    oldSource.getParentProvidesComponentTypes().remove(target);
}
Also used : DNodeContainer(org.eclipse.sirius.diagram.DNodeContainer) CompleteComponentType(org.palladiosimulator.pcm.repository.CompleteComponentType) ProvidesComponentType(org.palladiosimulator.pcm.repository.ProvidesComponentType)

Example 4 with DNodeContainer

use of org.eclipse.sirius.diagram.DNodeContainer in project InformationSystem by ObeoNetwork.

the class SOAService method allSelectableExternalComponents.

public List<Component> allSelectableExternalComponents(System context, DSemanticDiagram semanticDiagram) {
    List<Component> allNonReferencedExternalComponents = allNonReferencedExternalComponents(context);
    List<Component> allComponentToRemove = new ArrayList<Component>();
    // "DNodeContainer"
    for (EObject obj : EcoreService.eContents(semanticDiagram, DNodeContainer.class)) {
        // Retrieve and add the target of DNodeContainer type of Component
        if (((DNodeContainer) obj).getTarget() instanceof Component) {
            allComponentToRemove.add((Component) ((DNodeContainer) obj).getTarget());
        }
    }
    allNonReferencedExternalComponents.removeAll(allComponentToRemove);
    return allNonReferencedExternalComponents;
}
Also used : DNodeContainer(org.eclipse.sirius.diagram.DNodeContainer) EObject(org.eclipse.emf.ecore.EObject) ArrayList(java.util.ArrayList) Component(org.obeonetwork.dsl.soa.Component)

Aggregations

DNodeContainer (org.eclipse.sirius.diagram.DNodeContainer)4 CompleteComponentType (org.palladiosimulator.pcm.repository.CompleteComponentType)2 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 Component (org.obeonetwork.dsl.soa.Component)1 ImplementationComponentType (org.palladiosimulator.pcm.repository.ImplementationComponentType)1 ProvidesComponentType (org.palladiosimulator.pcm.repository.ProvidesComponentType)1 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)1 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)1