Login | Register
My pages Projects Community openCollabNet

Discussions > Commit Messages > svn commit: r19948 - trunk/src/argouml-app/src/org/argouml/uml: cognitive/critics diagram/static_structure diagram/ui

argouml
Discussion topic

Back to topic list

svn commit: r19948 - trunk/src/argouml-app/src/org/argouml/uml: cognitive/critics diagram/static_structure diagram/ui

Author mvw
Full name Michiel van der Wulp
Date 2014-09-07 11:41:25 PDT
Message Author: mvw
Date: 2014-09-07 11:41:24-0700
New Revision: 19948

Modified:
   trunk/src/argouml-ap​p/src/org/argouml/um​l/cognitive/critics/​ClAttributeCompartme​nt.java
   trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/static_str​ucture/ClassDiagramG​raphModel.java
   trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/ui/DnDJGra​ph.java

Log:
Fix for issue 6252: Adding associationclass does not add node.
I am still unsure about the architecture, but this is a severe bug and the fix can not wait longer.
Tested again - it works.

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​948&r1=19947​&r2=19948
====================​====================​====================​==================
--- 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-07 11:41:24-0700
@@ -1,6 +1,6 @@
 /* $Id$
  ********************​********************​********************​*****************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009-2014 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  *
  * Contributors:
  * bobtarling
+ * Michiel van der Wulp
  ********************​********************​********************​*****************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -148,12 +149,14 @@
     final Object modelElement = fig.getOwner();
         if (Model.getUmlFactory​().isContainmentVali​d(
                 Model.getMetaTypes()​.getAttribute(), modelElement)) {
- FigCompartmentBox fcb = (FigCompartmentBox) fig;
- FigCompartment fc =
- fcb.getCompartment(M​odel.getMetaTypes().​getAttribute());
- Rectangle fr = fc.getBounds();
- fig = null;
- return fr.contains(x, y);
+ if (fig instanceof FigCompartmentBox) {
+ FigCompartmentBox fcb = (FigCompartmentBox) fig;
+ FigCompartment fc =
+ fcb.getCompartment(M​odel.getMetaTypes().​getAttribute());
+ Rectangle fr = fc.getBounds();
+ fig = null;
+ return fr.contains(x, y);
+ } // else it is a FigAssociationClass, then what?
         }
         return false;
     }

Modified: trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/static_str​ucture/ClassDiagramG​raphModel.java
Url: http://argouml.tigri​s.org/source/browse/​argouml/trunk/src/ar​gouml-app/src/org/ar​gouml/uml/diagram/st​atic_structure/Class​DiagramGraphModel.ja​va?view=diff&pat​hrev=19948&r1=19​947&r2=19948
====================​====================​====================​==================
--- trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/static_str​ucture/ClassDiagramG​raphModel.java (original)
+++ trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/static_str​ucture/ClassDiagramG​raphModel.java 2014-09-07 11:41:24-0700
@@ -1,6 +1,6 @@
 /* $Id$
  ********************​********************​********************​*******************
- * Copyright (c) 2010-2012 Contributors - see below
+ * Copyright (c) 2010-2014 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -9,6 +9,7 @@
  * Contributors:
  * Jason Robbins - initial implementation
  * <see source control change log for other early contributors>
+ * Michiel van der Wulp
  *
  ********************​********************​********************​*******************
  */
@@ -49,6 +50,8 @@
 import org.argouml.model.Model;
 import org.argouml.uml.CommentEdge;
 import org.argouml.uml.diag​ram.UMLMutableGraphS​upport;
+import org.argouml.uml.diag​ram.ui.ModeCreateAss​ociationClass;
+import org.tigris.gef.base.Globals;
 
 /**
  * This class defines a bridge between the UML meta-model
@@ -463,6 +466,10 @@
                     addEdge(associationEnd);
                 } else if (canAddEdge(association)) {
                     addEdge(association);
+ if (Model.getFacade().i​sAAssociationClass(a​ssociation)) {
+ ModeCreateAssociatio​nClass.buildInActive​Layer(Globals
+ .curEditor(), association);
+ }
                 }
             }
         }

Modified: trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/ui/DnDJGra​ph.java
Url: http://argouml.tigri​s.org/source/browse/​argouml/trunk/src/ar​gouml-app/src/org/ar​gouml/uml/diagram/ui​/DnDJGraph.java?view​=diff&pathrev=19​948&r1=19947​&r2=19948
====================​====================​====================​==================
--- trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/ui/DnDJGra​ph.java (original)
+++ trunk/src/argouml-ap​p/src/org/argouml/um​l/diagram/ui/DnDJGra​ph.java 2014-09-07 11:41:24-0700
@@ -1,6 +1,6 @@
 /* $Id$
  ********************​********************​********************​*****************
- * Copyright (c) 2009-2012 Contributors - see below
+ * Copyright (c) 2009-2014 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -55,6 +55,7 @@
 import java.util.logging.Logger;
 
 import org.argouml.kernel.Owned;
+import org.argouml.model.Model;
 import org.argouml.ui.Trans​ferableModelElements​;
 import org.argouml.uml.diag​ram.ArgoDiagram;
 import org.argouml.uml.diag​ram.DiagramElement;
@@ -234,23 +235,27 @@
 
             Iterator i = modelElements.iterator();
             while (i.hasNext()) {
- /* TODO: Why not call UMLDiagram.doesAccept() first,
- * like in ClassDiagramRenderer? */
- final DiagramElement figNode = diagram.drop(i.next(), point);
-
- if (figNode != null && figNode instanceof Owned) {
- Object owner = ((Owned) figNode).getOwner();
- if (!gm.getNodes().cont​ains(owner)) {
- gm.getNodes().add(owner);
- }
-
- layer.add((Fig) figNode);
- if (figNode instanceof FigNode && figNode instanceof Owned) {
- gm.addNodeRelatedEdges(((Owned) figNode).getOwner());
+ Object node = i.next();
+ if (diagram.doesAccept(node)) {
+ final DiagramElement figNode = diagram.drop(node, point);
+
+ if (figNode != null && figNode instanceof Owned) {
+ Object owner = ((Owned) figNode).getOwner();
+ if (!gm.getNodes().cont​ains(owner)) {
+ gm.getNodes().add(owner);
+ }
+
+ layer.add((Fig) figNode);
+ if (figNode instanceof FigNode && figNode instanceof Owned) {
+ gm.addNodeRelatedEdges(((Owned) figNode).getOwner());
+ }
+ if (Model.getFacade().i​sAAssociationClass(n​ode)) {
+ ModeCreateAssociatio​nClass.buildInActive​Layer(Globals
+ .curEditor(), node);
+ }
                     }
                 }
             }
-
             dropTargetDropEvent.​getDropTargetContext​().dropComplete(true​);
         } catch (UnsupportedFlavorException e) {
             LOG.log(Level.SEVERE, "Exception caught", e);

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

Messages

Show all messages in topic

svn commit: r19948 - trunk/src/argouml-app/src/org/argouml/uml: cognitive/critics diagram/static_structure diagram/ui mvw Michiel van der Wulp 2014-09-07 11:41:25 PDT
Messages per page: