private void editSuperResource (){
// edit compound Role
if(selectedGroupsList==null){
Object [] selectedRoles = selectedRolesList.getSelectedValues();
String superRoleNewName = dialogFrameTextField.getText();
ResourceClassModel newSuperRole = new ResourceClassModel(superRoleNewName, ResourceClassModel.TYPE_ROLE);
String superRoleOldName = superRolesTree.getLastSelectedPathComponent().toString();
SuperRolesTreeNode superRole = (SuperRolesTreeNode) superRolesTree.getLastSelectedPathComponent();
for(int i=0;i<superRole.getChildCount();i++){
String Role = superRole.getChildAt(i).toString();
int j = getPetrinet().containsRole(Role);
ResourceClassModel RoleModel = (ResourceClassModel) getPetrinet().getRoles().get(j);
ResourceClassModel superRoleModel= new ResourceClassModel(superRoleOldName,
ResourceClassModel.TYPE_ROLE);
RoleModel.removeSuperModel(superRoleModel);
}
int j = getPetrinet().containsRole(superRoleOldName);
ResourceClassModel RoleModel = (ResourceClassModel) getPetrinet().getRoles().get(j);
RoleModel.setName(superRoleNewName);
updateRolesInPetrinet(superRoleOldName, superRoleNewName);
int path = superRolesTopNode.getIndex(superRole);
for(int i=0;i<selectedRoles.length;i++){
String RoleName = selectedRoles[i].toString();
int a = getPetrinet().containsRole(RoleName);
ResourceClassModel currentRole = getPetrinet().getRoles().get(a);
currentRole.addSuperModel(newSuperRole);
ArrayList <String> objects = getObjectsAssignedToResource(currentRole, ResourceClassModel.TYPE_ROLE);
for(int b = 0; b< objects.size();b++ ){
String currentObject = objects.get(b);
petrinet.addResourceMapping(newSuperRole.toString(), currentObject);
}
}
refreshRolesFromModel();
refreshGroupsFromModel();
refreshObjectsFromModel();
refreshGUI();
superRolesTree.expandRow(path);
getEditor().setSaved(false);
superRolesEditButton.setEnabled(false);
superRolesDeleteButton.setEnabled(false);
}
// edit compound Group
if(selectedRolesList==null){
Object [] selectedGroups = selectedGroupsList.getSelectedValues();
String superGroupNewName = dialogFrameTextField.getText();
ResourceClassModel newSuperGroup = new ResourceClassModel(superGroupNewName,
ResourceClassModel.TYPE_ORGUNIT);
String superGroupOldName = superGroupsTree.getLastSelectedPathComponent().toString();
SuperGroupsTreeNode superGroup = (SuperGroupsTreeNode) superGroupsTree.getLastSelectedPathComponent();
for(int i=0;i<superGroup.getChildCount();i++){
String Group = superGroup.getChildAt(i).toString();
int j = getPetrinet().containsOrgunit(Group);
ResourceClassModel GroupModel = (ResourceClassModel) getPetrinet().getOrganizationUnits().get(j);
ResourceClassModel superGroupModel= new ResourceClassModel(superGroupOldName,
ResourceClassModel.TYPE_ORGUNIT);
GroupModel.removeSuperModel(superGroupModel);
}
int j = getPetrinet().containsOrgunit(superGroupOldName);
ResourceClassModel GroupModel = (ResourceClassModel) getPetrinet().getOrganizationUnits().get(j);
GroupModel.setName(superGroupNewName);
updateRolesInPetrinet(superGroupOldName, superGroupNewName);
int path = superGroupsTopNode.getIndex(superGroup);
for(int i=0;i<selectedGroups.length;i++){
String GroupName = selectedGroups[i].toString();
int a = getPetrinet().containsOrgunit(GroupName);
ResourceClassModel currentGroup = getPetrinet().getOrganizationUnits().get(a);
currentGroup.addSuperModel(newSuperGroup);
ArrayList <String> objects = getObjectsAssignedToResource(currentGroup,
ResourceClassModel.TYPE_ORGUNIT);
for(int b = 0; b< objects.size();b++ ){
String currentObject = objects.get(b);