Examples of CompositeNode


Examples of org.eclipse.xtext.nodemodel.impl.CompositeNode

            boolean _not = (!_isEmpty);
            if (_not) {
              INode _head = IterableExtensions.<INode>head(nodes);
              final INode withKeyword = ((CompositeNode) _head).getPreviousSibling();
              INode _last = IterableExtensions.<INode>last(nodes);
              final CompositeNode lastOption = ((CompositeNode) _last);
              int _offset = withKeyword.getOffset();
              int _endOffset = lastOption.getEndOffset();
              int _offset_1 = withKeyword.getOffset();
              int _minus = (_endOffset - _offset_1);
              TargetPlatformValidator.this.acceptError("Options of every locations must be the same", _, _offset, _minus, TargetPlatformValidator.CHECK__OPTIONS_EQUALS_ALL_LOCATIONS);
            } else {
              final ICompositeNode node = NodeModelUtils.getNode(_);
View Full Code Here

Examples of org.eclipse.xtext.nodemodel.impl.CompositeNode

    if (_and) {
      final List<INode> nodes = NodeModelUtils.findNodesForFeature(location, TargetPlatformPackage.Literals.LOCATION__OPTIONS);
      INode _head = IterableExtensions.<INode>head(nodes);
      final INode withKeyword = ((CompositeNode) _head).getPreviousSibling();
      INode _last = IterableExtensions.<INode>last(nodes);
      final CompositeNode lastOption = ((CompositeNode) _last);
      int _offset = withKeyword.getOffset();
      int _endOffset = lastOption.getEndOffset();
      int _offset_1 = withKeyword.getOffset();
      int _minus = (_endOffset - _offset_1);
      this.acceptWarning("Options on location are deprecated. Define the option at the target level.", location, _offset, _minus, TargetPlatformValidator.DEPRECATE__OPTIONS_ON_LOCATIONS);
    }
  }
View Full Code Here

Examples of org.geppetto.core.model.runtime.CompositeNode

   * @param timestep
   */
  protected void advanceTimeStep(double timestep)
  {
    _runtime += timestep;
    ACompositeNode timeStepsNode = new CompositeNode("time tree");
    {
      VariableNode time = new VariableNode("time");
      timeStepsNode.addChild(time);
      PhysicalQuantity t = new PhysicalQuantity();
      t.setUnit(_timeStepUnit);
    }
    ATimeSeriesNode leafNode = (ATimeSeriesNode) timeStepsNode.getChildren().get(0);
    PhysicalQuantity runTime = new PhysicalQuantity();
    runTime.setValue(ValuesFactory.getDoubleValue(_runtime));
    leafNode.addPhysicalQuantity(runTime);
  }
View Full Code Here

Examples of org.geppetto.core.model.runtime.CompositeNode

                else
                {
                  if(tokenizer.hasMoreElements())
                  {
                    // not a leaf, create a composite state node
                    ACompositeNode newNode = new CompositeNode(current);
                    node.addChild(newNode);
                    node = newNode;
                  }
                  else
                  {
                    // it's a leaf node
                    VariableNode newNode = new VariableNode(current);
                    int[] start = { _currentRecordingIndex };
                    int[] lenght = { 1 };
                    Array value;
                    try
                    {
                      value = hdfVariable.read(start, lenght);
                      Type type = Type.fromValue(hdfVariable.getDataType().toString());

                      PhysicalQuantity quantity = new PhysicalQuantity();
                      AValue readValue = null;
                      switch(type)
                      {
                        case DOUBLE:
                          readValue = ValuesFactory.getDoubleValue(value.getDouble(0));
                          break;
                        case FLOAT:
                          readValue = ValuesFactory.getFloatValue(value.getFloat(0));
                          break;
                        case INTEGER:
                          readValue = ValuesFactory.getIntValue(value.getInt(0));
                          break;
                        default:
                          break;
                      }
                      quantity.setValue(readValue);
                      newNode.addPhysicalQuantity(quantity);
                      node.addChild(newNode);
                    }
                    catch(IOException | InvalidRangeException e)
                    {
                      throw new GeppettoExecutionException(e);
View Full Code Here

Examples of org.geppetto.core.model.runtime.CompositeNode

      }
      indexMap.put(id, index);
    } else {
      // add bracket if array and it's at index 0
      if (node.getParent().isArray()) {
        CompositeNode parent = (CompositeNode) node.getParent();
        if (parent.getChildren().indexOf(node) == 0) {
          _serialized.append("{");
        }
      }

      String namePath = "\"" + node.getBaseName() + "\":{";
View Full Code Here

Examples of org.geppetto.core.model.runtime.CompositeNode

 
  @Override
  public boolean visitVariableNode(VariableNode node) {

    if (node.getParent().isArray()) {
      CompositeNode parent = (CompositeNode) node.getParent();
      if (parent.getChildren().indexOf(node) == 0) {
        _serialized.append("{");
      }
    }

    String commonProperties = this.commonProperties(node);
View Full Code Here

Examples of org.jbpm.workflow.core.node.CompositeNode

                        final String localName,
                        final Attributes attrs,
                        final ExtensibleXmlParser parser) throws SAXException {
        parser.startElementBuilder( localName,
                                    attrs );
        CompositeNode compositeNode = (CompositeNode) parser.getParent();
        final String type = attrs.getValue("type");
        emptyAttributeCheck(localName, "type", type, parser);
        final String nodeId = attrs.getValue("nodeId");
        emptyAttributeCheck(localName, "nodeId", nodeId, parser);
        final String nodeInType = attrs.getValue("nodeInType");
        emptyAttributeCheck(localName, "nodeInType", nodeInType, parser);
        compositeNode.linkIncomingConnections(type, new Long(nodeId), nodeInType);
        return null;
    }   
View Full Code Here

Examples of org.jbpm.workflow.core.node.CompositeNode

                        final String localName,
                        final Attributes attrs,
                        final ExtensibleXmlParser parser) throws SAXException {
        parser.startElementBuilder( localName,
                                    attrs );
        CompositeNode compositeNode = (CompositeNode) parser.getParent();
        final String type = attrs.getValue("type");
        emptyAttributeCheck(localName, "type", type, parser);
        final String nodeId = attrs.getValue("nodeId");
        emptyAttributeCheck(localName, "nodeId", nodeId, parser);
        final String nodeOutType = attrs.getValue("nodeOutType");
        emptyAttributeCheck(localName, "nodeOutType", nodeOutType, parser);
        compositeNode.linkOutgoingConnections(new Long(nodeId), nodeOutType, type);
        return null;
    }   
View Full Code Here

Examples of org.jbpm.workflow.core.node.CompositeNode

      return "composite";
    }

    public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
      super.writeNode(getNodeName(), node, xmlDump, includeMeta);
        CompositeNode compositeNode = (CompositeNode) node;
        writeAttributes(compositeNode, xmlDump, includeMeta);
        xmlDump.append(">" + EOL);
        if (includeMeta) {
          writeMetaData(compositeNode, xmlDump);
        }
      for (String eventType: compositeNode.getActionTypes()) {
          writeActions(eventType, compositeNode.getActions(eventType), xmlDump);
        }
        writeTimers(compositeNode.getTimers(), xmlDump);
        if (compositeNode instanceof CompositeContextNode) {
          VariableScope variableScope = (VariableScope)
        ((CompositeContextNode) compositeNode).getDefaultContext(VariableScope.VARIABLE_SCOPE);
          if (variableScope != null) {
            List<Variable> variables = variableScope.getVariables();
View Full Code Here

Examples of org.jbpm.workflow.core.node.CompositeNode

        }
        int parentOffsetX = 0;
        int parentOffsetY = 0;
        NodeContainer nodeContainer = node.getNodeContainer();
        while (nodeContainer instanceof CompositeNode) {
          CompositeNode parent = (CompositeNode) nodeContainer;
          Integer parentX = (Integer) parent.getMetaData().get("x");
          if (parentX != null) {
            parentOffsetX += parentX;
          }
          Integer parentY = (Integer) parent.getMetaData().get("y");
          if (parentY != null) {
            parentOffsetY += (Integer) parent.getMetaData().get("y");
          }
          nodeContainer = parent.getNodeContainer();
        }
        x += parentOffsetX;
        y += parentOffsetY;
      xmlDump.append(
        "      <bpmndi:BPMNShape bpmnElement=\"" + getUniqueNodeId(node) + "\" >" + EOL +
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.