Examples of GroupModel


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

        if (map.getReadOnly() != null) {
          ((AbstractPetriNetElementModel) element).setReadOnly(map
              .getReadOnly());
        }
        // Grouping
        GroupModel group = getGraph().groupName(element,
            ((AbstractPetriNetElementModel) element).getNameModel());
        group.setUngroupable(false);
        // System.err.println("In createElement Method - the created elemetn"
        // + element.toString());
        group.add(element);
        group.add(element.getNameModel());
        if (insertIntoCache) {
          getGraph().getGraphLayoutCache().insert(group);
        }

        // edit
View Full Code Here

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

   
    while (!toBeProcessed.isEmpty()) {
      Object currentElement = toBeProcessed.poll();     
      if (currentElement instanceof GroupModel)
      {
        GroupModel tempGroup = (GroupModel) currentElement;
        if (!tempGroup.isUngroupable()) {
          Object cell = tempGroup;
          while (cell instanceof GroupModel) {
            cell = ((GroupModel) cell).getMainElement();
          }
          if (cell instanceof AbstractPetriNetElementModel
              && !((AbstractPetriNetElementModel) cell).isReadOnly()) {
            result.add(tempGroup);
            for (int j = 0; j < tempGroup.getChildCount(); j++) {
              result.add(tempGroup.getChildAt(j));
            }
          }
        } else {
          result.add(currentElement);
          for (int j = 0; j < tempGroup.getChildCount(); j++)
            toBeProcessed.offer(tempGroup.getChildAt(j));
        }   
      } else {
        result.add(currentElement);
      }
    }
View Full Code Here

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

    LinkedList<ArcModel> clipboardArcs = new LinkedList<ArcModel>();
   
    while (!toBeProcessed.isEmpty()) {
      Object currentElement = toBeProcessed.poll();
      if (currentElement instanceof GroupModel) {
        GroupModel tempGroup = (GroupModel)currentElement;
        if (tempGroup.isUngroupable()) {
          // Regular group of multiple elements, add
          // its elements instead of the group itself
          for (int j = 0; j < tempGroup.getChildCount(); j++)
            toBeProcessed.offer(tempGroup.getChildAt(j));
          // Do not process the group itself
          currentElement = null;
         } else {
           // The is just the usual group of main element, name label and other stuff.
           // We are only interested in the main model in this case
View Full Code Here

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

      tempMap.setEditOnCreation(false);
      tempMap.setReadOnly(false);
      // set ID to null, to get new ID
      tempMap.setId(null);
      // get tempGroupModel with new ID
      GroupModel tempGroupModel = (GroupModel) (create(tempMap));
      // get form the group an AbstractElementModel (extends GraphCell)

      tempElement = tempGroupModel.getMainElement();
      // check if tempElement TransitionModel (PetriNetModelElement)

      if (tempElement instanceof TransitionModel) {
        // GroupModel currentTrans = (GroupModel) (create(currentMap));
        // new element exactly transitionModel
View Full Code Here

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

    getEditorPanel().m_understandColoring = null;
  }

  public void checkSubprocessEditors(Vector<Object> selectedElement) {
    Iterator<Object> iterator = selectedElement.iterator();
    GroupModel element;
    ArcConfiguration arcConfig = new ArcConfiguration();
    IEditor subEditor;
    while (iterator.hasNext()) {
      try {
        element = (GroupModel) iterator.next();
        if (element.getMainElement().getType() == AbstractPetriNetElementModel.SUBP_TYPE) {
          SubProcessModel subprocess = (SubProcessModel) element
              .getMainElement();
          NetAlgorithms.getArcConfiguration(subprocess, arcConfig);
          IEditor editor = (EditorVC) getM_centralMediator().getUi()
              .getEditorFocus();
          if ((arcConfig.m_numIncoming != 0)
              || (arcConfig.m_numOutgoing != 0)) {
            subEditor = getM_centralMediator()
                .createSubprocessEditor(
                    true,
                    editor,
                    (SubProcessModel) element
                        .getMainElement());
            this.fireViewEvent(new ViewEvent(subEditor,
                AbstractViewEvent.VIEWEVENTTYPE_GUI,
                AbstractViewEvent.CLOSE, null));
          }
View Full Code Here

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

                sourceArcPoint = new Point(source.getPosition().x + source.getWidth() / 2, point.y + tStar.getHeight()
                        / 2);
                sinkArcPoint = new Point(sink.getPosition().x + sink.getWidth() / 2, point.y + tStar.getHeight() / 2);
            }
            tStar.setPosition(point);
            GroupModel group = editor.getGraph().groupName(tStar, (tStar).getNameModel());
            group.setUngroupable(false);
            group.add(tStar);
            group.add(tStar.getNameModel());
            tStarComponents[0] = group;
            editor.getGraph().getGraphLayoutCache().insert(group);

            CreationMap sinkTStarMap = CreationMap.createMap();
            sinkTStarMap.setArcSourceId(sink.getId());
View Full Code Here

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

    private void deleteCells(Object[] toDelete) {
        Vector<Object> result = new Vector<Object>();
        for (int i = 0; i < toDelete.length; i++) {
            if (toDelete[i] instanceof GroupModel && !((GroupModel) toDelete[i]).isUngroupable()) {
                GroupModel tempGroup = (GroupModel) toDelete[i];
                Object cell = tempGroup;
                while (cell instanceof GroupModel) {
                    cell = ((GroupModel) cell).getMainElement();
                }
                if (cell instanceof AbstractPetriNetElementModel && !((AbstractPetriNetElementModel) cell).isReadOnly()) {
                    result.add(tempGroup);
                    for (int j = 0; j < tempGroup.getChildCount(); j++) {
                        result.add(tempGroup.getChildAt(j));
                    }
                }
            } else {
                result.add(toDelete[i]);
            }
View Full Code Here

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

    public void drawNet(PetriNetModelProcessor processor)
    {
      for (Iterator<AbstractPetriNetElementModel> iter = processor.getElementContainer().getRootElements().iterator(); iter.hasNext();)
      {
        AbstractPetriNetElementModel element = (AbstractPetriNetElementModel) iter.next();
        GroupModel group = groupName(element, (element.getNameModel()));
        // The combination of element and element name plus all additional
        // cells (resources) is in general not ungroupable
        group.setUngroupable(false);
        if (element.getType() == AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE ||
            element.getType() == AbstractPetriNetElementModel.TRANS_OPERATOR_TYPE ||
            element.getType() == AbstractPetriNetElementModel.SUBP_TYPE)
        {
          // Restore display of trigger element if present
          if (((TransitionModel) element).hasTrigger())
          {
            ParentMap pm = new ParentMap();
            pm.addEntry(((TransitionModel) element).getToolSpecific().getTrigger(), group);
            HashMap<GroupModel, AttributeMap> hm = new HashMap<GroupModel, AttributeMap>();
            hm.put(group, group.getAttributes());
            getModel().insert(new Object[] { ((TransitionModel) element).getToolSpecific().getTrigger() }, hm, null, pm, null);
          }

          // Restore display of associated resource if present
          if (((TransitionModel) element).hasResource())
          {
            ParentMap pm = new ParentMap();
            pm.addEntry(((TransitionModel) element).getToolSpecific().getTransResource(), group);
            HashMap<GroupModel, AttributeMap> hm = new HashMap<GroupModel, AttributeMap>();
            hm.put(group, group.getAttributes());
            getModel().insert(new Object[] { ((TransitionModel) element).getToolSpecific().getTransResource() }, hm, null, pm, null);
          }
        }
        getGraphLayoutCache().insertGroup(group, new Object[] { element, ((AbstractPetriNetElementModel) element).getNameModel() });
      }
View Full Code Here

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

        return group(mainElement, name, additional, ungroupable);
    }

    public void groupSelection()
    {
        GroupModel group = groupName(null, null, getSelectionCells(), true);
        if (group != null)
        {
            getGraphLayoutCache().insertGroup(group, getSelectionCells());
            setSelectionCell(group);
       }       
View Full Code Here

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

    public GroupModel group(AbstractPetriNetElementModel mainElement, NameModel name, Object[] additional, boolean ungroupable)
    {
        if (mainElement != null && name != null)
        {
            // Create Group Cell
            GroupModel group = new GroupModel(mainElement, name, additional, ungroupable);
            LoggerManager.debug(Constants.CORE_LOGGER, "Grouping of Elements created.");
            return group;
        } else
        {
            GroupModel group = new GroupModel(mainElement, name, additional, ungroupable);
            return group;
        }
    }
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.