Package eu.admire.dispel.core

Examples of eu.admire.dispel.core.ProcessingElementInstance


   */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
      IAdaptable info) throws ExecutionException {
    Output newElement = ParametersFactory.eINSTANCE.createOutput();

    ProcessingElementInstance owner = (ProcessingElementInstance) getElementToEdit();
    owner.getProcessingElementParameters().add(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
View Full Code Here


      container = out.eContainer();

      if (container instanceof ProcessingElementInstance) {

        ProcessingElementInstance pei = (ProcessingElementInstance) container;

        Collection<LocalVariable> variables = DispelEObjectUtil
            .getObjectsByType(pck.eAllContents(),
                VariablesPackage.eINSTANCE.getLocalVariable());

        for (LocalVariable var : variables) {

          if (var.getValue() != null && var.getValue().equals(pei)) {

            src1.setTarget(var);
          }
        }

      }

      /*******************************/

      IdentifierReference dst1 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      IdentifierReference dst2 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      dst1.setNext(dst2);

      dst2.setTarget((Input) getTarget());

      Input in = (Input) getTarget();

      container = in.eContainer();

      if (container instanceof ProcessingElementInstance) {

        ProcessingElementInstance pei = (ProcessingElementInstance) container;

        Collection<LocalVariable> variables = DispelEObjectUtil
            .getObjectsByType(pck.eAllContents(),
                VariablesPackage.eINSTANCE.getLocalVariable());

        for (LocalVariable var : variables) {

          if (var.getValue() != null && var.getValue().equals(pei)) {

            dst1.setTarget(var);
          }
        }

      }

      newElement.setChild(src1);
      newElement.setValue(dst1);

    }

    //TODO iFO following might be buggy!   

    if (getSource() instanceof ConnectionInitialization
        && getTarget() instanceof Input) {

      IdentifierReference dst1 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      IdentifierReference dst2 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      dst1.setNext(dst2);

      dst2.setTarget((Input) getTarget());

      Input in = (Input) getTarget();

      container = in.eContainer();

      if (container instanceof ProcessingElementInstance) {

        ProcessingElementInstance pei = (ProcessingElementInstance) container;

        Collection<LocalVariable> variables = DispelEObjectUtil
            .getObjectsByType(pck.eAllContents(),
                VariablesPackage.eINSTANCE.getLocalVariable());

        for (LocalVariable var : variables) {

          if (var.getValue() != null && var.getValue().equals(pei)) {

            dst1.setTarget(var);
          }
        }

      }

      newElement.setChild(getSource());
      newElement.setValue(dst1);
    }

    if (getSource() instanceof Output
        && getTarget() instanceof LocalVariable) {

      IdentifierReference src1 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      IdentifierReference src2 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      src1.setNext(src2);

      src2.setTarget((Output) getSource());

      Output out = (Output) getSource();

      container = out.eContainer();

      if (container instanceof ProcessingElementInstance) {

        ProcessingElementInstance pei = (ProcessingElementInstance) container;

        Collection<LocalVariable> variables = DispelEObjectUtil
            .getObjectsByType(pck.eAllContents(),
                VariablesPackage.eINSTANCE.getLocalVariable());

        for (LocalVariable var : variables) {

          if (var.getValue() != null && var.getValue().equals(pei)) {

            src1.setTarget(var);
          }
        }
      }

      IdentifierReference dst1 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      dst1.setTarget((LocalVariable) getTarget());

      newElement.setChild(src1);
      newElement.setValue(dst1);

    }

    if (getSource() instanceof LocalVariable
        && getTarget() instanceof Input) {

      IdentifierReference dst1 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      IdentifierReference dst2 = ReferencesFactory.eINSTANCE
          .createIdentifierReference();

      dst1.setNext(dst2);

      dst2.setTarget((Input) getTarget());

      Input in = (Input) getTarget();

      container = in.eContainer();

      if (container instanceof ProcessingElementInstance) {

        ProcessingElementInstance pei = (ProcessingElementInstance) container;

        LocalVariable inVar = (LocalVariable) getSource();
        pck = inVar.getContainingPackage();

        Collection<LocalVariable> variables = DispelEObjectUtil
View Full Code Here

          context.getNewObject()).getProcessingElementDefinition());
    } else {
      lvs = (LocalVariableStatement) context.getNewObject();
    }
   
    ProcessingElementInstance pei =
        (ProcessingElementInstance) lvs.getVariable().getValue();
    Diagram targetDiagram = (Diagram) context.getTargetContainer();

    // Container shape for everything
    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    ContainerShape containerShape =
        peCreateService.createContainerShape(targetDiagram, true);
   
    //Don't think this should happen, but want to check
    if (lvs.eResource() == null) {
      Activator.logInfo("PE has no resource");
    }

    // create link and wire it
    link(containerShape, lvs);

    addLineToBox(containerShape);
   
    int paramHeight = createInputsAndOutputs(containerShape, pei);
    createBox(context, lvs, containerShape, paramHeight + 10);
 
    addText(containerShape, pei.getName(), lvs);
     
    // add a chopbox anchor to the shape
        peCreateService.createChopboxAnchor(containerShape);
        // call the layout feature
        layoutPictogramElement(containerShape);
View Full Code Here

TOP

Related Classes of eu.admire.dispel.core.ProcessingElementInstance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.