Examples of LocalVariableStatement


Examples of eu.admire.dispel.statements.LocalVariableStatement

      IReason ret = Reason.createFalseReason();
     
      for (Statement s : pck.getStatements()) {

        if (s instanceof LocalVariableStatement) {
          LocalVariableStatement lvs = (LocalVariableStatement) s;
          if (lvs.getVariable().getValue() instanceof
              ProcessingElementInstance) {
            if (getFeatureProvider(
                ).getPictogramElementForBusinessObject(lvs)
                == null) {
              ret = Reason.createTrueReason("PE not in graph");
            }
          } else if (lvs.getVariable().getTypeReference()
              instanceof Stream) {
             
              if (s != null) {
                if (getFeatureProvider(
                    ).getPictogramElementForBusinessObject(s)
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

        eu.admire.dispel.containers.Package pck) {
     
      boolean ret = false;
      for (Statement s : pck.getStatements()) {
        if (s instanceof LocalVariableStatement) {
          LocalVariableStatement lvs = (LocalVariableStatement) s;
          if ((lvs.getVariable().getValue() instanceof
              ProcessingElementInstance)
              || (lvs.getVariable().getTypeReference()
              instanceof Stream)) {
            if (getFeatureProvider(
                ).getPictogramElementForBusinessObject(lvs)
                == null) {
             
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

      ProcessingElementDefinition pd) {
   
    String peName = CreatePEFeature.generateUniquePEName(
        Utility.getModel(getDiagram()));
   
    LocalVariableStatement lvs = CreatePEFeature.createPEAndAddToModel(pd, peName,
        getDiagramEditor().getEditingDomain(), getDiagram());
   
    return lvs;
  }
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

  /**
   * Adds a PE to the diagram.
   */
  public PictogramElement add(IAddContext context) {

    LocalVariableStatement lvs = null;
   
    if (context.getNewObject() instanceof AdaptableProcessingElement) {
      lvs = createAndAddPE(((AdaptableProcessingElement)
          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);
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

    DecimalDoubleLiteral dl =
        LiteralsFactory.eINSTANCE.createDecimalDoubleLiteral();

    dl.setDecimalValue(val);

    LocalVariableStatement lvs = Utility.wrapLiteral(dl,
        Utility.getModel(getDiagram()));
   
    Utility.addAsLastNonSubmitStatement(lvs,
        Utility.getPackage(getDiagram()).getStatements());
    addGraphicalRepresentation(context, lvs);
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

  /**
   * Add the ConnectionInitialization to the diagram.
   */
  public PictogramElement add(IAddContext context) {

    LocalVariableStatement addedVar =
        (LocalVariableStatement) context.getNewObject();
    Diagram targetDiagram = (Diagram) context.getTargetContainer();

    // CONTAINER SHAPE WITH ROUNDED RECTANGLE
    IPeCreateService peCreateService = Graphiti.getPeCreateService();
    ContainerShape containerShape =
        peCreateService.createContainerShape(targetDiagram, true);

    // check whether the context has a size (e.g. from a create feature)
    // otherwise define a default size for the shape
    int width = context.getWidth() <= 0 ? 200 : context.getWidth();
    int height = context.getHeight() <= 0 ? 44 : context.getHeight();

    IGaService gaService = Graphiti.getGaService();

    {
      // create and set graphics algorithm
      RoundedRectangle roundedRectangle =
          gaService.createRoundedRectangle(containerShape, 5, 5);
      roundedRectangle.setStyle(StyleUtil.getStyleForCI(getDiagram()));
      gaService.setLocationAndSize(roundedRectangle,
          context.getX(), context.getY(), width, height);

      //Don't think this should happen, but want to be sure
      if (addedVar.eResource() == null) {
        Activator.logInfo("ConnectionInitialization has no resource");
      }

      // create link and wire it
      link(containerShape, addedVar);
    }

    //Check for child literal
    Object lit = Utility.getChildLiteral(addedVar.getVariable(
        ).getInitialValue());
    if (lit != null) {
      AddContext addLiteralContext = new AddContext(
          new AreaContext(), lit);
      addLiteralContext.setTargetContainer(containerShape);
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

   * Get the current value in the model.
   */
  public String getInitialValue(IDirectEditingContext context) {

    PictogramElement pe = context.getPictogramElement();
    LocalVariableStatement lvs = (LocalVariableStatement)
        getBusinessObjectForPictogramElement(pe);

    return lvs.getVariable().getName();
  }
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

  @Override
  public void setValue(String value, IDirectEditingContext context) {

    // set the new name for the PE
    PictogramElement pe = context.getPictogramElement();
    LocalVariableStatement lvs = (LocalVariableStatement) getBusinessObjectForPictogramElement(pe);

    lvs.getVariable().setName(value);

    updatePictogramElement(((Shape) pe).getContainer());
  }
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

    StringReference str = ReferencesFactory.eINSTANCE
        .createStringReference();

    str.setValue(Utility.fixUpQuotes(literalName));

    LocalVariableStatement lvs = Utility.wrapLiteral(str,
        Utility.getModel(getDiagram()));
   
    Utility.addAsLastNonSubmitStatement(lvs,
        Utility.getPackage(getDiagram()).getStatements());
    addGraphicalRepresentation(context, lvs);
View Full Code Here

Examples of eu.admire.dispel.statements.LocalVariableStatement

    DecimalIntegerLiteral dI =
        LiteralsFactory.eINSTANCE.createDecimalIntegerLiteral();

    dI.setDecimalValue(val);

    LocalVariableStatement lvs = Utility.wrapLiteral(dI,
        Utility.getModel(getDiagram()));
   
    Utility.addAsLastNonSubmitStatement(lvs,
        Utility.getPackage(getDiagram()).getStatements());
    addGraphicalRepresentation(context, lvs);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.