From: Benjamin B. <bg...@us...> - 2005-05-31 13:12:57
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13859/Plugin/com/ibm/ecute/UMLBuffer Modified Files: UMLBuffer.java Log Message: 2.1 beta 1a fixed some CIM MOF import errors in RSA/RSM Index: UMLBuffer.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLBuffer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- UMLBuffer.java 8 Apr 2005 09:11:16 -0000 1.7 +++ UMLBuffer.java 31 May 2005 13:12:47 -0000 1.8 @@ -568,36 +568,43 @@ int result = -1; // RSA if (UMLProgram instanceof RSAModelCreator){ - // System.out.println("UMLProgram is an instance of RSAModelCreator"); + + boolean aggregate = false; // get the first qualifier of each association role to find out // in which role the aggregate is defined ArrayList qualifiers1 = role1.getQualifiers(true); - UMLQualifier role1Qualifier = (UMLQualifier) qualifiers1.get(0); - ArrayList qualifiers2 = role2.getQualifiers(true); - UMLQualifier role2Qualifier = (UMLQualifier) qualifiers2.get(0); - - // if aggregate is defined in role 1 (MOF file) then AddAssociation is - // called with role 2 first to get the diamond on the correct end of the - // association (the diamond is in RSA on the side of the second role - // which is passed to AddAssociation) - if (role1Qualifier.name.equalsIgnoreCase("Aggregate")){ - System.out.println("Role 1 is AGGREGATE"); - aggregateRole1 = true; - result = UMLProgram.AddAssociation(role2.endPointName, - role2.name, role1.endPointName, role1.name, RclassDiagram); + if(qualifiers1.size() > 0){ + UMLQualifier role1Qualifier = (UMLQualifier) qualifiers1.get(0); + //if aggregate is defined in role 1 (MOF file) then AddAssociation is + // called with role 2 first to get the diamond on the correct end of the + // association (the diamond is in RSA on the side of the second role + // which is passed to AddAssociation) + if (role1Qualifier.name.equalsIgnoreCase("Aggregate")){ + //System.out.println("Role 1 is AGGREGATE"); + aggregate = true; + aggregateRole1 = true; + result = UMLProgram.AddAssociation(role2.endPointName, + role2.name, role1.endPointName, role1.name, RclassDiagram); + } } - // if aggregate is defined in role 2 (MOF file) - // aggregateRole1 is set to false to get the qualifiers (with SetQualifiers) - // to the correct end of the aggregation/composition - else if (role2Qualifier.name.equalsIgnoreCase("Aggregate")){ - System.out.println("Role 2 is AGGREGATE"); - aggregateRole1 = false; - result = UMLProgram.AddAssociation(role1.endPointName, - role1.name, role2.endPointName, role2.name, RclassDiagram); + ArrayList qualifiers2 = role2.getQualifiers(true); + if(qualifiers2.size() > 0){ + UMLQualifier role2Qualifier = (UMLQualifier) qualifiers2.get(0); + // if aggregate is defined in role 2 (MOF file) + // aggregateRole1 is set to false to get the qualifiers (with SetQualifiers) + // to the correct end of the aggregation/composition + if (role2Qualifier.name.equalsIgnoreCase("Aggregate")){ + //System.out.println("Role 2 is AGGREGATE"); + aggregate = true; + aggregateRole1 = false; + result = UMLProgram.AddAssociation(role1.endPointName, + role1.name, role2.endPointName, role2.name, RclassDiagram); + } + } // if the association is no aggregation or composition - } else { + if(!aggregate) { //System.out.println("Normal association"); //System.out.println("Role 1 end point = " + role1.endPointName + " Role 1 name = " + role1.name); //System.out.println("Role 2 end point = " + role2.endPointName + " Role 2 name = " + role2.name); |