Package org.woped.core.model.petrinet

Examples of org.woped.core.model.petrinet.TransitionModel


     * Pre-select sub process as the next transition to occur, but only
     * if there is only one sub process, so the selection is deterministic
     */
  public void setSubProcessTransition() {
    int activatedSubProcessCount = 0;
    TransitionModel subProcess = null;
    for (TransitionModel t : followingActivatedTransitions) {
      if (t instanceof SubProcessModel) {
        ++activatedSubProcessCount;
        subProcess = t;
      }
View Full Code Here


    private void highlightTransitions(ReachabilityPlaceModel place) {
        IMarking ma = (IMarking) place.getUserObject();
        Iterator<String> netIt = ma.getActivatedTransitions().iterator();
        while (netIt.hasNext()) {
            TransitionModel trans = (TransitionModel) getPetriNet().getElementContainer().getElementById(netIt.next());
            trans.setRGHighlighted(true);
        }
    }
View Full Code Here

            }
            CreationMap map = new CreationMap();
            map.setId(T_STAR);
            map.setName(T_STAR);
            map.setType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE);
            tStar = new TransitionModel(map);
            GraphConstants.setBorderColor(tStar.getAttributes(), T_STAR_COLOR);
            GraphConstants.setForeground(tStar.getNameModel().getAttributes(), T_STAR_COLOR);
            tStar.addPort();
            tStar.addPort();
View Full Code Here

            if (toDelete[i] instanceof ArcModel) {
                allPorts.add(toDelete[i]);
                editor.getModelProcessor().removeArc(((ArcModel) toDelete[i]).getId());
            } else
                if (toDelete[i] instanceof TriggerModel) {
                    TransitionModel owner = (TransitionModel) editor.getModelProcessor().getElementContainer()
                            .getElementById(((TriggerModel) toDelete[i]).getOwnerId());
                    if (owner != null) {
                        if (owner.getToolSpecific().getTrigger().getTriggertype() == TriggerModel.TRIGGER_RESOURCE
                                && owner.getToolSpecific().getTransResource() != null) {
                            owner.getToolSpecific().removeTransResource();
                        }
                        owner.getToolSpecific().removeTrigger();
                    }
                    allPorts.add(toDelete[i]);
                } else
                    if (toDelete[i] instanceof TransitionResourceModel) {
                        TransitionModel owner = (TransitionModel) editor.getModelProcessor().getElementContainer()
                                .getElementById(((TransitionResourceModel) toDelete[i]).getOwnerId());
                        if (owner != null) {
                            owner.getToolSpecific().removeTransResource();
                        }
                        allPorts.add(toDelete[i]);
                    } else
                        if (toDelete[i] instanceof NameModel) {
                            allPorts.add(toDelete[i]);
View Full Code Here

    {
      cell = ((GroupModel) cell).getMainElement();
    }
    if (cell instanceof TransitionModel)
    {
      TransitionModel trans = (TransitionModel) cell;
      if (trans.hasResource())
      {
        editor.deleteCell(trans.getToolSpecific().getTransResource(), true);
      }
    }
  }
View Full Code Here

        // rotate names
        element.getNameModel().setPosition(element.getNameModel().getY(), element.getNameModel().getX());

        // rotate triggers and resources
        if (element instanceof TransitionModel) {
          TransitionModel tm = (TransitionModel) element;

          if (!rotateSelected) {
            rotateTransitionIcon(tm, TURN_RIGHT);
            triggerXOffset = -5;
            triggerYOffset = 0;
            resourceXOffset = -20;
            resourceYOffset = -25;
          } else {
            rotateTransitionIcon(tm, TURN_LEFT);
            triggerXOffset = 0;
            triggerYOffset = 5;
            resourceXOffset = 25;
            resourceYOffset = 20;
          }
          if (tm.hasTrigger()) {
            newX = tm.getToolSpecific().getTrigger().getY() + triggerXOffset;
            newY = tm.getToolSpecific().getTrigger().getX() + triggerYOffset;
            tm.getToolSpecific().getTrigger().setPosition(newX, newY);
            if (newX < negX)
              negX = newX;
            if (newY < negY)
              negY = newY;
          }
          if (tm.hasResource()) {
            newX = tm.getToolSpecific().getTransResource().getY() + resourceXOffset;
            newY = tm.getToolSpecific().getTransResource().getX() + resourceYOffset;
            tm.getToolSpecific().getTransResource().setPosition(newX, newY);
            if (newX < negX)
              negX = newX;
            if (newY < negY)
              negY = newY;
          }
View Full Code Here

        element.getNameModel().setPosition(element.getNameModel().getX() + moveX,
            element.getNameModel().getY() + moveY);

        // move triggers and resources (if existing)
        if (element instanceof TransitionModel) {
          TransitionModel tm = (TransitionModel) element;

          if (tm.hasTrigger()) {
            TriggerModel trigMod = tm.getToolSpecific().getTrigger();
            trigMod.setPosition(trigMod.getX() + moveX, trigMod.getY() + moveY);
          }
          if (tm.hasResource()) {
            TransitionResourceModel transRes = tm.getToolSpecific().getTransResource();
            transRes.setPosition(transRes.getX() + moveX, transRes.getY() + moveY);
          }
        }
      }
    }
View Full Code Here

    }
 
 
  private TransitionType initTransition(TransitionType iTransition, TransitionModel currentModel, OperatorTransitionModel operatorModel)
    {
        TransitionModel takenModel = operatorModel == null ? currentModel : operatorModel;
        // name
        initNodeName(iTransition.addNewName(), takenModel.getNameModel());
        // attr. id
        iTransition.setId(currentModel.getId());

        return iTransition;
    }
View Full Code Here

  /**
   * Creates a new Trigger and adds it to the Transtition
   *
   */
  public TriggerModel newTrigger(CreationMap map) {
    TransitionModel transition = (TransitionModel) getElementContainer()
        .getElementById(map.getId());
    if (transition.getToolSpecific() == null) {
      transition.setToolSpecific(new Toolspecific(transition.getId()));
    }
    return transition.getToolSpecific().setTrigger(map);

  }
View Full Code Here

  }

  // TODO: DOCUMentation
  public TransitionResourceModel newTransResource(CreationMap map) {
    TransitionModel transition = (TransitionModel) getElementContainer()
        .getElementById(map.getId());
    if (transition.getToolSpecific() == null) {
      transition.setToolSpecific(new Toolspecific(transition.getId()));
    }
    return transition.getToolSpecific().setTransResource(map);
  }
View Full Code Here

TOP

Related Classes of org.woped.core.model.petrinet.TransitionModel

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.