Package org.woped.core.model.petrinet

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


        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

    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

     */
    public void ungroup(Object[] cells)
    {
        // Shortcut to the model
        GraphModel graphModel = getModel();
        GroupModel aGroup;
        // If any Cells
        if (cells != null && cells.length > 0)
        {
            // List that Holds the Groups
            ArrayList<Object> groups = new ArrayList<Object>();
            // List that Holds the Children
            ArrayList<Object> children = new ArrayList<Object>();
            // Loop Cells
            for (int i = 0; i < cells.length; i++)
            {
                // If Cell is a Group
                if (isGroup(cells[i]))
                {
                    aGroup = (GroupModel) cells[i];
                    if (aGroup.isUngroupable())
                    {
                        // Add to List of Groups
                        groups.add(cells[i]);
                        // Loop Children of Cell
                        for (int j = 0; j < graphModel.getChildCount(cells[i]); j++) {
View Full Code Here

TOP

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

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.