svn commit: r16824 - trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-02-22 04:05:48-0800
New Revision: 16824

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java

Log:
Issue 5701: Only try and interpret model to connect edges if bother nodes exist on diagram.
This whole method should go when we have a longer testing period.

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java?view=diff&pathrev=16824&r1=16823&r2=16824
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/state/ui/FigTransition.java	2009-02-22 04:05:48-0800
@@ -155,16 +155,31 @@
      * 
      * @param lay diagram layer containing this fig
      * @param owner owning UML element
+     * @deprecated in 0.28 by Bob Tarling - The above TODO is from Michiel.
+     * I also don't understand the purpose of this method. The GEF framework
+     * should be setting source/dest or persistence should manage.
      */
+    @Deprecated
     private void initPorts(Layer lay, Object owner) {
-        Object sourceSV = Model.getFacade().getSource(owner);
-        Object destSV = Model.getFacade().getTarget(owner);
-        FigNode sourceFN = (FigNode) lay.presentationFor(sourceSV);
-        FigNode destFN = (FigNode) lay.presentationFor(destSV);
-        setSourcePortFig(sourceFN);
-        setSourceFigNode(sourceFN);
-        setDestPortFig(destFN);
-        setDestFigNode(destFN);
+        final Object sourceSV = Model.getFacade().getSource(owner);
+        final FigNode sourceFN = (FigNode) lay.presentationFor(sourceSV);
+        if (sourceFN != null) {
+            // The purpose of this method is not explained and it give give
+            // NPE depending on z order of figs as they are read. For now
+            // ignore if null but for future lets delete this.
+            setSourcePortFig(sourceFN);
+            setSourceFigNode(sourceFN);
+        }
+        
+        final Object destSV = Model.getFacade().getTarget(owner);
+        final FigNode destFN = (FigNode) lay.presentationFor(destSV);
+        if (destFN != null) {
+            // The purpose of this method is not explained and it give give
+            // NPE depending on z order of figs as they are read. For now
+            // ignore if null but for future lets delete this.
+            setDestPortFig(destFN);
+            setDestFigNode(destFN);
+        }
     }
 
     /*

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

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.