svn commit: r17027 - trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java

Thomas Neustupny <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: thn
Date: 2009-04-02 12:29:53-0700
New Revision: 17027

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java

Log:
for batch mode: make not fail and a little more robust

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java?view=diff&pathrev=17027&r1=17026&r2=17027
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/ImportCommon.java	2009-04-02 12:29:53-0700
@@ -45,6 +45,7 @@
 import org.argouml.model.Model;
 import org.argouml.taskmgmt.ProgressMonitor;
 import org.argouml.ui.explorer.ExplorerEventAdaptor;
+import org.argouml.ui.targetmanager.TargetManager;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;
 import org.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter;
@@ -144,6 +145,14 @@
         if (Globals.curEditor().getGraphModel()
                 instanceof ClassDiagramGraphModel) {
             result =  new DiagramInterface(Globals.curEditor());
+        } else {
+            Project p =  ProjectManager.getManager().getCurrentProject();
+            TargetManager.getInstance().setTarget(p.getInitialTarget());
+            // the previous line helps, but we better check again:
+            if (Globals.curEditor().getGraphModel()
+                    instanceof ClassDiagramGraphModel) {
+                result =  new DiagramInterface(Globals.curEditor());
+            }
         }
         return result;
     }
@@ -543,7 +552,7 @@
         }
         // New style importers don't create diagrams, so we'll do it
         // based on the list of newElements that they created
-        if (isCreateDiagramsSelected()) {
+        if (isCreateDiagramsSelected() && diagramInterface != null) {
             addFiguresToDiagrams(newElements);
         }

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

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.