petrinet.addResourceMapping(parent.toString(), node.toString());
model.insertNodeInto(node, parent, parent.getChildCount());
Vector<ResourceClassModel> Groups = petrinet.getOrganizationUnits();
Vector<ResourceClassModel> Roles = petrinet.getRoles();
ResourceClassModel Group;
for (Iterator <ResourceClassModel>iter = Groups.iterator(); iter.hasNext();){
Group = iter.next();
if(Group.getSuperModels()!= null && Group.toString().equals(parent.toString())){
for(Iterator<ResourceClassModel>superGroups = Group.getSuperModels();superGroups.hasNext();){
String currentSuperGroup= superGroups.next().toString();
petrinet.addResourceMapping(currentSuperGroup.toString(), node.toString());
}
}
}
ResourceClassModel Role;
for (Iterator <ResourceClassModel>iter = Roles.iterator(); iter.hasNext();){
Role = iter.next();
if(Role.getSuperModels()!= null && Role.toString().equals(parent.toString())){
for(Iterator<ResourceClassModel>superRoles = Role.getSuperModels();superRoles.hasNext();){
String currentSuperRole= superRoles.next().toString();
petrinet.addResourceMapping(currentSuperRole.toString(), node.toString());
}
}
}
DefaultMutableTreeNode superParent = (DefaultMutableTreeNode) parent.getParent();
int pathToExpand = superParent.getIndex(parent);
collapseAll(DropTree.this);
DropTree.this.expandRow(pathToExpand);
}
else{
JOptionPane.showMessageDialog(null , Messages.getString("ResourceEditor.Error.AlreadyAssigned.Text"), Messages.getString("ResourceEditor.Error.AlreadyAssigned.Title"),
JOptionPane.ERROR_MESSAGE);
}
else{
DefaultMutableTreeNode superParent = (DefaultMutableTreeNode) parent.getParent();
if (!parentContainsNode(superParent,node)){
petrinet.addResourceMapping(superParent.toString(), node.toString());
model.insertNodeInto(node, superParent, superParent.getChildCount());
Vector<ResourceClassModel> Groups = petrinet.getOrganizationUnits();
Vector<ResourceClassModel> Roles = petrinet.getRoles();
ResourceClassModel Group;
for (Iterator <ResourceClassModel>iter = Groups.iterator(); iter.hasNext();){
Group = iter.next();
if(Group.getSuperModels()!= null && Group.toString().equals(superParent.toString())){
for(Iterator<ResourceClassModel>superGroups = Group.getSuperModels();superGroups.hasNext();){
String currentSuperGroup= superGroups.next().toString();
petrinet.addResourceMapping(currentSuperGroup.toString(), node.toString());
}
}
}
ResourceClassModel Role;
for (Iterator <ResourceClassModel>iter = Roles.iterator(); iter.hasNext();){
Role = iter.next();
if(Role.getSuperModels()!= null && Role.toString().equals(superParent.toString())){
for(Iterator<ResourceClassModel>superRoles = Role.getSuperModels();superRoles.hasNext();){
String currentSuperRole= superRoles.next().toString();
petrinet.addResourceMapping(currentSuperRole.toString(), node.toString());
}
}
}