svn commit: r12742 - trunk/src_new/org/argouml: kernel uml/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-06-02 09:35:44-0700
New Revision: 12742

Modified:
   trunk/src_new/org/argouml/kernel/Project.java
   trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java

Log:
Make the "delete from model" also work for primitive Figs (i.e. the Figs witout owner).

Modified: trunk/src_new/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/Project.java?view=diff&rev=12742&p1=trunk/src_new/org/argouml/kernel/Project.java&p2=trunk/src_new/org/argouml/kernel/Project.java&r1=12741&r2=12742
==============================================================================
--- trunk/src_new/org/argouml/kernel/Project.java	(original)
+++ trunk/src_new/org/argouml/kernel/Project.java	2007-06-02 09:35:44-0700
@@ -1110,9 +1110,9 @@
             // I believe this code is never reached. If we delete a FigEdge
             // or FigNode we actually call this method with the owner not
             // the Fig itself.
-            // For Figs with no owner (primitives like circle etc) then they
-            // are not deleted (crtl-Del) they are removed (Del)
-            LOG.error("Request to delete a Fig " + obj.getClass().getName());
+            // MVW: This is now called by ActionDeleteModelElements
+            // for primitive Figs (without owner).
+            LOG.info("Request to delete a Fig " + obj.getClass().getName());
         } else if (obj instanceof CommentEdge) {
             CommentEdge ce = (CommentEdge) obj;
             LOG.info("Removing the link from " + ce.getAnnotatedElement()

Modified: trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java?view=diff&rev=12742&p1=trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java&p2=trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java&r1=12741&r2=12742
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java	(original)
+++ trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java	2007-06-02 09:35:44-0700
@@ -142,7 +142,10 @@
                 if (sureRemove(target)) {
                     // remove from the model
                     if (target instanceof Fig) {
-                        target = ((Fig) target).getOwner();
+                        Object owner = ((Fig) target).getOwner();
+                        if (owner != null) {
+                            target = owner;
+                        }
                     }
                     if (Model.getFacade().isAConcurrentRegion(target)) {
                         new ActionDeleteConcurrentRegion()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.