svn commit: r19583 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-07-12 12:13:31-0700
New Revision: 19583

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java

Log:
Make safe against none named model element

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java?view=diff&pathrev=19583&r1=19582&r2=19583
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java	2011-07-12 12:13:31-0700
@@ -941,11 +941,9 @@
      * generate the notation for the modelelement and stuff it into the text Fig
      */
     protected void updateNameText() {
-
-        if (getOwner() == null) {
-            return;
-        }
-        if (notationProviderName != null) {
+        if (notationProviderName != null
+                && getOwner() != null
+                && Model.getFacade().isANamedElement(getOwner())) {
             String nameStr = notationProviderName.toString(
                     getOwner(), getNotationSettings());
             nameFig.setText(nameStr);

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&pathrev=19583&r1=19582&r2=19583
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2011-07-12 12:13:31-0700
@@ -1617,19 +1617,17 @@
      * but also changes in rendering like bold.
      */
     protected void updateNameText() {
-        if (readyToEdit) {
-            if (getOwner() == null) {
-                return;
-            }
-            if (notationProviderName != null) {
-                nameFig.setText(notationProviderName.toString(
-                        getOwner(), getNotationSettings()));
-                updateFont();
-                updateBounds();
-            }
+        if (readyToEdit
+                && notationProviderName != null
+                && getOwner() != null
+                && Model.getFacade().isANamedElement(getOwner())) {
+            nameFig.setText(notationProviderName.toString(
+                    getOwner(), getNotationSettings()));
+            updateFont();
+            updateBounds();
         }
     }
-
+    
     /*
      * @see org.argouml.uml.diagram.ui.PathContainer#isPathVisible()
      */

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2791116

To unsubscribe from this discussion, e-mail: [[email protected]].
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.