Package org.woped.core.model

Examples of org.woped.core.model.ModelElementContainer


                    // Verify that the operator has the correct arc
                    // configuration
                    // If this is not the case it will be added to the
                    // misused operators list
                    verifyOperatorArcConfiguration(operator, arcConfig);
                    ModelElementContainer simpleTransContainer = operator.getSimpleTransContainer();
                    // Recursively call ourselves to add inner nodes
                    Iterator<AbstractPetriNetElementModel> innerIterator = simpleTransContainer.getRootElements().iterator();
                    updateStatistics(innerIterator);
                    // To have the total number of arcs we must subtract
                    // the number of incoming and outgoing arcs from the
                    // number of inner arcs of the operator
                    m_nNumArcs += simpleTransContainer.getArcMap().size()
                            - (arcConfig.m_numIncoming + arcConfig.m_numOutgoing);
                }
                    break;
                case AbstractPetriNetElementModel.SUBP_TYPE:
                    // Default behaviour for sub processes is to treat them as a
View Full Code Here


          rootOwningContainer = i.next();       
          AbstractPetriNetElementModel owningElement = rootOwningContainer.getOwningElement();
          int newLowest = ((owningElement!=null)?owningElement.getHierarchyLevel()+1:0);
          while (i.hasNext())
          {
            ModelElementContainer candidate = i.next();
            owningElement = candidate.getOwningElement();
            int candidateHierarchy = ((owningElement!=null)?owningElement.getHierarchyLevel()+1:0);
            if (candidateHierarchy<newLowest)
            {
              rootOwningContainer = candidate;
              newLowest = candidateHierarchy;
View Full Code Here

    boolean result = true;
    // An object can have multiple owning containers
    // Iterate through all of them to get all connections
    Iterator<ModelElementContainer> ownerIterator = getOwningContainers().iterator();
    while (ownerIterator.hasNext()) {
      ModelElementContainer currentContainer = ownerIterator.next();
      Map<String, AbstractPetriNetElementModel> targetElements = currentContainer.getTargetElements(getId());
      if (targetElements.size()>0)
        result = false;
    }
    return result;
  }
View Full Code Here

   */
  public boolean isRoot() {
    boolean result = true;
    Iterator<ModelElementContainer> ownerIterator = getOwningContainers().iterator();
    while (ownerIterator.hasNext()) {
      ModelElementContainer currentContainer = ownerIterator.next();
      Map<String, AbstractPetriNetElementModel> sourceElements = currentContainer.getSourceElements(getId());
      if (sourceElements.size()>0)
        result = false;
    }
    return result;
  }
View Full Code Here

    boolean result = true;
    // An object can have multiple owning containers
    // Iterate through all of them to get all connections
    Iterator<ModelElementContainer> ownerIterator = getOwningContainers().iterator();
    while (ownerIterator.hasNext()) {
      ModelElementContainer currentContainer = ownerIterator.next();
      Map<String, AbstractPetriNetElementModel> sourceElements = currentContainer.getSourceElements(getId());
      if (sourceElements.size()>0)
        result = false;
    }
    return result;
 
View Full Code Here

            previousItem();
      if (BackwardTransitionToOccur != null) {
        TransitionToOccur = BackwardTransitionToOccur;
       
        // Check if the transition to be executed belongs to the current net
        ModelElementContainer currentContainer =
            tgController.getThisEditor().getModelProcessor().getElementContainer();
       
        boolean thisContainer =
            (currentContainer.getElementById(TransitionToOccur.getId()) != null);
        if (!thisContainer) {
          // First check if we need to step upwards (after reaching
          // the initial state of a sub process)
          boolean foundStepUp = false;
          if (TransitionToOccur instanceof SubProcessModel) {
            SubProcessModel subProcessElement =
                (SubProcessModel)TransitionToOccur;
            if (subProcessElement.getElementContainer() == currentContainer) {
              // Yup. We're returning from a sub process and this
              // is the sub process transition itself. Close the sub process
              this.changeTokenGameReference(null, true);
              foundStepUp = true;
            }
          }
          if (!foundStepUp) {
            // TODO: Rework history to include references to sub processes
            // and their respective states before the were left.
            // This will allow us to step back into a sub process
            // when going backwards
            //
            // Skip all sub process elements, don't open any subprocesses
            // while going backwards
            do {
              previousItem();
              TransitionToOccur = BackwardTransitionToOccur;             
            } while (currentContainer.getElementById(TransitionToOccur.getId()) == null);
          }
        }

        tgController.occurTransitionbyTokenGameBarVC(TransitionToOccur,
            BackWard, false);
View Full Code Here

        PetriNetModelProcessor processor,
        AbstractPetriNetElementModel sourceModel)
    {
      // create & add new arc From EACH Source to EACH SimpleTrans
      // of Operator
      ModelElementContainer outerContainer = processor.getElementContainer();
      Iterator<String> sourceIter = outerContainer.getSourceElements(getId()).keySet()
      .iterator();
      while (sourceIter.hasNext())
      {
        Iterator<AbstractPetriNetElementModel> simpleRootIter = getSimpleTransContainer().getRootElements()
        .iterator();
        AbstractPetriNetElementModel tempSource = outerContainer
        .getElementById(sourceIter.next());
        while (simpleRootIter.hasNext())
        {
          // wenn simpletrans dann reference
          AbstractPetriNetElementModel tempTarget = (AbstractPetriNetElementModel) simpleRootIter
View Full Code Here

    }
    public void registerOutgoingConnection(
        PetriNetModelProcessor processor,
        AbstractPetriNetElementModel targetModel)
    {
      ModelElementContainer upperContainer = processor.getElementContainer();
     
      // Wenn die Referenztabelle von dem Operator nur diesen
      // neuen Eintrag hat
      if (upperContainer.getTargetElements(getId()).size() == 1
          && getSimpleTransContainer().getElementsByType(
              AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE)
              .size() == 1)
      {
        // get simple trans
        TransitionModel simpleTrans = (TransitionModel)getSimpleTransContainer().getElementsByType(
            AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE)
            .values().iterator().next();
        // create an reference entry
        addReference(getNextFreeArcID(processor),
            (DefaultPort) simpleTrans.getChildAt(0),
            (DefaultPort) targetModel.getChildAt(0));
       
      } else
      {
       
        // create simple trans
        TransitionModel simpleTrans = addNewSimpleTrans();
        // create an reference entry for the existing
        // simpleTrans
        addReference(getNextFreeArcID(processor),
            (DefaultPort) simpleTrans.getChildAt(0),
            (DefaultPort) targetModel.getChildAt(0));
       
        // create reference from each source to each inner
        // transition
        Iterator<String> sourceIter = upperContainer.getSourceElements(getId()).keySet().iterator();
        while (sourceIter.hasNext())
        {
          addReference(getNextFreeArcID(processor),
              (DefaultPort) upperContainer.getElementById(sourceIter.next()).getChildAt(0),
              (DefaultPort) simpleTrans.getChildAt(0));
        }
      }
    }
View Full Code Here

  // ! inner transitions) should be added to the tree item
  public NodeNetInfo(AbstractPetriNetElementModel node, boolean addChildren) {
    // Initialize the display of this item
    super("");
    m_nodeObject = node;
    ModelElementContainer rootOwningContainer = m_nodeObject.getRootOwningContainer();
    m_nodeOwner = rootOwningContainer != null ? rootOwningContainer.getOwningElement() : null;
    setUserObject(getNodeString(m_nodeObject, m_nodeOwner));

    // set the type of the element
    typeId = node.getType();

    // if the element is a transition-operator
    if (node instanceof OperatorTransitionModel) {
      OperatorTransitionModel otm = (OperatorTransitionModel) node;
      typeId = otm.getOperatorType();
    }

    // Generic approach to detect whether this element has any children:
    // Elements with children implement InnerElementContainer
    if (addChildren && (node instanceof InnerElementContainer) &&
        (typeId == OperatorTransitionModel.XOR_SPLIT_TYPE
        || typeId == OperatorTransitionModel.ANDJOIN_XORSPLIT_TYPE
        || typeId == OperatorTransitionModel.XORJOIN_ANDSPLIT_TYPE
        || typeId == OperatorTransitionModel.XOR_SPLITJOIN_TYPE
        || typeId == OperatorTransitionModel.SUBP_TYPE)) {
      // Add sub-elements as tree items
      InnerElementContainer operator = (InnerElementContainer) node;
      ModelElementContainer simpleTransContainer = operator.getSimpleTransContainer();
      // Recursively call ourselves to add inner nodes
      Iterator<AbstractPetriNetElementModel> innerIterator = simpleTransContainer.getRootElements().iterator();
      while (innerIterator.hasNext()) {
        try {
          AbstractPetriNetElementModel current = (AbstractPetriNetElementModel) innerIterator.next();
          AbstractPetriNetElementModel owningElement = current.getRootOwningContainer().getOwningElement();
          if ((owningElement != null)
View Full Code Here

 
  public void setHighlight(String metricsID){
    removeHighlights();
    if(metricsID == null)
      return;
    ModelElementContainer mec = editor.getModelProcessor().getElementContainer();
    String id = algorithmNameToID(metricsID);
    MetricHighlighting high = mc.getHighlighter().getHighlighting(id);
    Set<String> nodeIDs = high.getNodeIDs();
   
    for(String nodeID:nodeIDs)
      mec.getElementById(nodeID).setHighlighted(true);
   
    Set<String> arcIDs = high.getArcIDs();
    for(String arcID:arcIDs)
      mec.getArcById(arcID).setHighlighted(true);
  }
View Full Code Here

TOP

Related Classes of org.woped.core.model.ModelElementContainer

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.