Package org.woped.core.model.petrinet

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


            .getTrigger(), true);
      }

      if (transition.getParent() instanceof GroupModel) {
        GroupModel group = (GroupModel) transition.getParent();
        TriggerModel triggerModel = ((PetriNetModelProcessor) getModelProcessor())
        .newTrigger(map);

        if (map.getTriggerPosition() != null) {
          triggerModel.setPosition(map.getTriggerPosition());
        } else {
          if (isRotateSelected()) {
            triggerModel.setPosition(map.getPosition().x - 25,
                map.getPosition().y + 10);
          } else {
            triggerModel.setPosition(map.getPosition().x + 10,
                map.getPosition().y - 20);
          }

        }
        ParentMap pm = new ParentMap();
View Full Code Here


            .getTrigger(), true);
      }

      if (transition.getParent() instanceof GroupModel) {
        GroupModel group = (GroupModel) transition.getParent();
        TriggerModel triggerModel = ((PetriNetModelProcessor) getModelProcessor())
            .newTrigger(map);

        if (map.getTriggerPosition() != null) {
          triggerModel.setPosition(map.getTriggerPosition());
        } else {
          if (isRotateSelected()) {
            triggerModel.setPosition(map.getPosition().x - 25,
                map.getPosition().y + 10);
          } else {
            triggerModel.setPosition(map.getPosition().x + 10,
                map.getPosition().y - 20);
          }

        }
        ParentMap pm = new ParentMap();
View Full Code Here

      aModel.getNameModel().setPosition(
          (int) (aModel.getNameModel().getX() * factor),
          (int) (aModel.getNameModel().getY() * factor));
      if (aModel instanceof OperatorTransitionModel
          && ((OperatorTransitionModel) aModel).hasTrigger()) {
        TriggerModel trigger = ((OperatorTransitionModel) aModel)
            .getToolSpecific().getTrigger();
        trigger.setPosition((int) (trigger.getX() * factor),
            (int) (trigger.getY() * factor));
      }
    }
  }
 
View Full Code Here

                      AbstractPetriNetElementModel mainModel = ((GroupModel)elements[i]).getMainElement();
                      if (!Arrays.asList(elements).contains(mainModel))
                          m_editor.getModelProcessor().getElementContainer().addElement(mainModel);
                  } else if (elements[i] instanceof TriggerModel)
                  {
                      TriggerModel trigger = (TriggerModel) elements[i];
                      ((TransitionModel) ((GroupModel) trigger.getParent()).getMainElement()).getToolSpecific().setTrigger((TriggerModel) elements[i]);
                  } else
                  {
                      LoggerManager.debug(Constants.EDITOR_LOGGER, "Could not insert type:" + elements[i].getClass());
                  }
              }
View Full Code Here

        // 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

      return new Subprocess((SubProcessModel) e);
    if (TransitionModel.class.isInstance(e))
    {
      if (((TransitionModel) e).hasTrigger())
      {
        TriggerModel m = ((TransitionModel) e).getToolSpecific()
            .getTrigger();
        if (m.getTriggertype() == TriggerModel.TRIGGER_TIME)
          return new TimeTriggerTransition((TransitionModel) e);
        // if (m.getTriggertype() == TriggerModel.TRIGGER_RESOURCE)
        // return new ResourceTriggerTransition((TransitionModel) e);
        if (m.getTriggertype() == TriggerModel.TRIGGER_MESSAGE)
          return new MessageTriggerTransition((TransitionModel) e);
      }
      return new SimpleTransition((TransitionModel) e);
    }
    return null;
View Full Code Here

    if (resMod != null) {
      n.setrole(resMod.getTransRoleName());
      n.setgroup(resMod.getTransOrgUnitName());
      n.setHasResource(true);
    }else{
      TriggerModel t = tm.getToolSpecific().getTrigger();
      if ((t!=null)&&(t.getTriggertype()!=TriggerModel.TRIGGER_RESOURCE))           
        n.settime(0);
    }
  }
View Full Code Here

        } else if (cell instanceof TransitionResourceModel)
        {
            return new TransitionResourceView(cell);
        } else if (cell instanceof TriggerModel)
        {
            TriggerModel aTCell = (TriggerModel) cell;
            /* Hier die �berpr�fung ob Besondere View ? */
            if (aTCell.getTriggertype() == TriggerModel.TRIGGER_MESSAGE)
            {

                return new TriggerExtView(cell);

            } else if (aTCell.getTriggertype() == TriggerModel.TRIGGER_RESOURCE)
            {

                return new TriggerResView(cell);

            } else if (aTCell.getTriggertype() == TriggerModel.TRIGGER_TIME)
            {

                return new TriggerTimeView(cell);

            } else
View Full Code Here

TOP

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

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.