Login | Register
My pages Projects Community openCollabNet

Discussions > Commit Messages > svn commit: r19950 - trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/ClAttributeCompartment.java

argouml
Discussion topic

Back to topic list

svn commit: r19950 - trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/ClAttributeCompartment.java

Author mvw
Full name Michiel van der Wulp
Date 2014-09-14 08:34:37 PDT
Message Author: mvw
Date: 2014-09-14 08:34:37-0700
New Revision: 19950

Modified:
   trunk/src/argouml-ap​p/src/org/argouml/um​l/cognitive/critics/​ClAttributeCompartme​nt.java

Log:
Fix some association class related exceptions

Modified: trunk/src/argouml-ap​p/src/org/argouml/um​l/cognitive/critics/​ClAttributeCompartme​nt.java
Url: http://argouml.tigri​s.org/source/browse/​argouml/trunk/src/ar​gouml-app/src/org/ar​gouml/uml/cognitive/​critics/ClAttributeC​ompartment.java?view​=diff&pathrev=19​950&r1=19949​&r2=19950
====================​====================​====================​==================
--- trunk/src/argouml-ap​p/src/org/argouml/um​l/cognitive/critics/​ClAttributeCompartme​nt.java (original)
+++ trunk/src/argouml-ap​p/src/org/argouml/um​l/cognitive/critics/​ClAttributeCompartme​nt.java 2014-09-14 08:34:37-0700
@@ -47,6 +47,7 @@
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.model.Model;
 import org.argouml.ui.Clarifier;
+import org.argouml.uml.diag​ram.ui.FigAssociatio​nClass;
 import org.argouml.uml.diag​ram.ui.FigCompartmen​t;
 import org.argouml.uml.diag​ram.ui.FigCompartmen​tBox;
 import org.tigris.gef.prese​ntation.Fig;
@@ -86,6 +87,9 @@
         final Object modelElement = fig.getOwner();
         if (Model.getUmlFactory​().isContainmentVali​d(
                 Model.getMetaTypes()​.getAttribute(), modelElement)) {
+ if (fig instanceof FigAssociationClass) {
+ fig = ((FigAssociationClass) fig).getAssociationClass();
+ }
             FigCompartmentBox fcb = (FigCompartmentBox) fig;
             FigCompartment fc =
                 fcb.getCompartment(M​odel.getMetaTypes().​getAttribute());
@@ -149,6 +153,9 @@
     final Object modelElement = fig.getOwner();
         if (Model.getUmlFactory​().isContainmentVali​d(
                 Model.getMetaTypes()​.getAttribute(), modelElement)) {
+ if (fig instanceof FigAssociationClass) {
+ fig = ((FigAssociationClass) fig).getAssociationClass();
+ }
             if (fig instanceof FigCompartmentBox) {
                 FigCompartmentBox fcb = (FigCompartmentBox) fig;
                 FigCompartment fc =
@@ -156,7 +163,7 @@
                 Rectangle fr = fc.getBounds();
                 fig = null;
                 return fr.contains(x, y);
- } // else it is a FigAssociationClass, then what?
+ }
         }
         return false;
     }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r19950 - trunk/src/argouml-app/src/org/argouml/uml/cognitive/critics/ClAttributeCompartment.java mvw Michiel van der Wulp 2014-09-14 08:34:37 PDT
Messages per page: