Package org.woped.core.model.petrinet

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


          for (int i = 0; i < getPetrinet().getResources().size(); i++){
            objectsUnassignedListModel.addElement((ResourceModel) getPetrinet().getResources().get(i));
            }
          int a = objectsUnassignedListModel.getSize()-1;
          for (int i = 0; i< (a+1) ;i++){
            ResourceModel currentObject = (ResourceModel) objectsUnassignedListModel.getElementAt(a-i);
            Vector<?> assignedClasses = getPetrinet().getResourceClassesResourceIsAssignedTo(currentObject.toString());
            if (!assignedClasses.isEmpty() ){
              objectsUnassignedListModel.removeElement(currentObject);
              objectsAssignedListModel.addElement(currentObject);
             
             
            }

             
            Object ass;
            for (Iterator<?> iter = assignedClasses.iterator(); iter.hasNext();){
              ass = iter.next();
              String currentResource = ass.toString();
              for(int j =0; j <  RolesTreeModel.getChildCount(RolesTopNode);j++){
                String currentRole = RolesTreeModel.getChild(RolesTopNode, j).toString();
                if(currentResource.equals(currentRole)){
                  RolesTreeNode currentNode = (RolesTreeNode) RolesTreeModel.getChild(RolesTopNode, j);
                  RolesTreeModel.insertNodeInto(new ObjectsTreeNode(currentObject.toString()), currentNode, currentNode.getChildCount());
                }
              }
              for(int j =0; j <  GroupsTreeModel.getChildCount(GroupsTopNode);j++){
                String currentGroup = GroupsTreeModel.getChild(GroupsTopNode, j).toString();
                if(currentResource.equals(currentGroup)){
                  GroupsTreeNode currentNode = (GroupsTreeNode) GroupsTreeModel.getChild(GroupsTopNode, j);
                  DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) GroupsTree.getCellRenderer();
                  renderer.setLeafIcon(Messages.getImageIcon("PetriNet.Resources.Delete"));
                  GroupsTreeModel.insertNodeInto(new ObjectsTreeNode(currentObject.toString()), currentNode, currentNode.getChildCount());
               
                }
              }
                  
                }
View Full Code Here


              }

              ResourceType[] resources = currentNet
                  .getToolspecificArray(j).getResources()
                  .getResourceArray();
              ResourceModel resourceModelTemp;
              for (int m = 0; m < resources.length; m++) {
                resourceModelTemp = new ResourceModel(
                    resources[m].getName());
                currentPetrinet.addResource(resourceModelTemp);
              }

              for (int n = 0; n < resourceMaps.length; n++) {
View Full Code Here

               if(e.getSource()== objectsNewButton ){
                 String newResourceName = JOptionPane.showInputDialog(RolesContentPanel,
                     (Object)Messages.getString("PetriNet.Resources.ResourceName"),
                     Messages.getString("PetriNet.Resources.CreateObject"),JOptionPane.QUESTION_MESSAGE);
                 if (checkClassSyntax(newResourceName )){
                   ResourceModel newObject = new ResourceModel(newResourceName);
                     getPetrinet().addResource(newObject);
                     objectsUnassignedListModel.addElement(newObject);
                    refreshRolesFromModel();
                    refreshGroupsFromModel();
                    refreshObjectsFromModel();
View Full Code Here

                    Messages.getString("PetriNet.Resources.ResourceName"),
                    Messages.getString("PetriNet.Resources.EditObject"),
                                JOptionPane.QUESTION_MESSAGE,null,null,message);
              if (checkClassSyntax(newName )){
                  getPetrinet().replaceResourceMapping(message.toString(), newName);
                         ResourceModel resourceModel = (ResourceModel) getPetrinet().getResources().get(getPetrinet().containsResource(message.toString()));
                         resourceModel.setName(newName);
                 
                refreshRolesFromModel();
                refreshGroupsFromModel();
                refreshObjectsFromModel();
                refreshGUI();
View Full Code Here

            iNetToolSpec.setVerticalLayout(editor.isRotateSelected());
            // resources
            ResourcesType iNetResources = iNetToolSpec.addNewResources();
            // Rescources
            ResourceType iResourceType;
            ResourceModel rModelTemp;

            for (Iterator<ResourceModel> iter = petrinetModel.getResources().iterator(); iter.hasNext();)
            {
                rModelTemp = (ResourceModel) iter.next();
                iResourceType = iNetResources.addNewResource();
                iResourceType.setName(rModelTemp.getName());
                for (int i = 0; i < statusBars.length; i++)
                    statusBars[i].nextStep();
            }
            // Roles
View Full Code Here

TOP

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

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.