Author: tfmorris
Date: 2008-05-01 17:30:18-0700
New Revision: 14586

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

Log:
Remove old style diagram creation interface (now done in common importer code)

Modified: trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java?view=diff&rev=14586&p1=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&p2=trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java&r1=14585&r2=14586
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java 
(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/reveng/java/Modeller.java 
2008-05-01 17:30:18-0700
@@ -34,7 +34,6 @@
 import java.util.Stack;
 import java.util.StringTokenizer;
 
-
 import org.apache.log4j.Logger;
 import org.argouml.application.api.Argo;
 import org.argouml.kernel.ProjectManager;
@@ -42,7 +41,6 @@
 import org.argouml.model.Facade;
 import org.argouml.model.Model;
 import org.argouml.ocl.OCLUtil;
-import org.argouml.uml.reveng.DiagramInterface;
 import org.argouml.uml.reveng.ImportCommon;
 import org.argouml.uml.reveng.ImportInterface;
 import org.argouml.uml.reveng.ImportSettings;
@@ -74,11 +72,6 @@
      */
     private Object model;
 
-    // TODO: This can be removed when we are sure there are no external users
-    // of the functionality.  Diagram creation has moved to ImportCommon where
-    // a single implementation is shared by all importers. - tfm 20061209
-    private DiagramInterface diagram;
-
     /**
      * Current import settings.
      */
@@ -90,14 +83,6 @@
     private Object currentPackage;
 
     /**
-     * Last package name used in addPackage().
-     * It is null for classes which are not packaged.
-     * Used in popClassifier() to create diagram for that
-     * package.
-     */
-    private String currentPackageName;
-
-    /**
      * Keeps the data that varies during parsing.
      */
     private ParseState parseState;
@@ -254,23 +239,14 @@
      * @param name The name of the package.
      */
     public void addPackage(String name) {
-       // Add a package figure for this package to the owner's class
-       // diagram, if it's not in the diagram yet. I do this for all
-       // the class diagrams up to the top level, since I need
-       // diagrams for all the packages.
+        // We used to add diagrams to the project here for each package
+        // but diagram creation is handled in the common code for all
+        // reverse engineering modules now
+        
+       // Find the top level package
        String ownerPackageName, currentName = name;
         ownerPackageName = getPackageName(currentName);
        while (!"".equals(ownerPackageName)) {
-           if (diagram != null
-                   && importSession != null
-                   && importSession.isCreateDiagramsSelected()
-                   && diagram.isDiagramInProject(ownerPackageName)) {
-
-               diagram.selectClassDiagram(getPackage(ownerPackageName),
-                       ownerPackageName);
-               diagram.addPackage(getPackage(currentName));
-
-           }
            currentName = ownerPackageName;
             ownerPackageName = getPackageName(currentName);
        }
@@ -288,15 +264,11 @@
 
        // Find or create a Package model element for this package.
        mPackage = getPackage(name);
-        currentPackageName = name;
 
        // Set the current package for the following source code.
        currentPackage = mPackage;
        parseState.addPackageContext(mPackage);
 
-        // Delay diagram creation until any classifier (class or
-        // interface) will be found
-
         //set the namespace of the component
         // check to see if there is already a component defined:
         Object component = Model.getFacade().lookupIn(currentPackage, 
fileName);
@@ -949,31 +921,6 @@
        Called from the parser when a classifier is completely parsed.
     */
     public void popClassifier() {
-        // now create diagram if it doesn't exists in project
-       if (diagram != null 
-                && importSession != null 
-                && importSession.isCreateDiagramsSelected()) {
-
-           if (currentPackageName != null) {
-               diagram.selectClassDiagram(currentPackage,
-                       currentPackageName);
-           }
-           // The class is in a source file
-           // with no package declaration
-           else {
-               // create new diagram in root for classifier without package
-               diagram.createRootClassDiagram();
-           }
-           // add the current classifier to the diagram.
-           Object classifier = parseState.getClassifier();
-           if (Model.getFacade().isAInterface(classifier)) {
-               diagram.addInterface(classifier,
-                       importSession.isMinimizeFigsSelected());
-           } else if (Model.getFacade().isAClass(classifier)) {
-               diagram.addClass(classifier,
-                       importSession.isMinimizeFigsSelected());
-           }
-       }
 
         // Remove operations and attributes not in source
         parseState.removeObsoleteFeatures();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to