svn commit: r14015 - trunk/src_new/org/argouml: persistence profile

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-28 01:06:17-0800
New Revision: 14015

Modified:
   trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java
   trunk/src_new/org/argouml/profile/URLModelLoader.java
   trunk/src_new/org/argouml/profile/UserDefinedProfile.java

Log:
Let UserDefinedProfile load its own XMI file

Modified: trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java?view=diff&rev=14015&p1=trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java&p2=trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java&r1=14014&r2=14015
==============================================================================
--- trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java	(original)
+++ trunk/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java	2007-12-28 01:06:17-0800
@@ -26,6 +26,7 @@
 

 import java.io.BufferedReader;

 import java.io.ByteArrayInputStream;

+import java.io.File;

 import java.io.IOException;

 import java.io.InputStream;

 import java.io.InputStreamReader;

@@ -41,6 +42,7 @@
 import org.xml.sax.InputSource;

 

 import org.argouml.application.helpers.ApplicationVersion;

+import org.argouml.kernel.ProfileConfiguration;

 import org.argouml.kernel.Project;

 import org.argouml.kernel.ProjectMember;

 import org.argouml.model.Model;

@@ -49,7 +51,6 @@
 import org.argouml.model.XmiWriter;

 import org.argouml.profile.Profile;

 import org.argouml.profile.ProfileFacade;

-import org.argouml.kernel.ProfileConfiguration;

 import org.argouml.profile.UserDefinedProfile;

 

 /**

@@ -109,8 +110,7 @@
                         xmi.append(line + "\n");

                     }

                     

-                    Collection model = readModelXMI(xmi.toString());

-                    profile = new UserDefinedProfile(fileName, model);

+                    profile = new UserDefinedProfile(new File(xmi.toString()));

                     

                     // consumes the </userDefined>

                     line = br.readLine().trim();		    


Modified: trunk/src_new/org/argouml/profile/URLModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/URLModelLoader.java?view=diff&rev=14015&p1=trunk/src_new/org/argouml/profile/URLModelLoader.java&p2=trunk/src_new/org/argouml/profile/URLModelLoader.java&r1=14014&r2=14015
==============================================================================
--- trunk/src_new/org/argouml/profile/URLModelLoader.java	(original)
+++ trunk/src_new/org/argouml/profile/URLModelLoader.java	2007-12-28 01:06:17-0800
@@ -47,8 +47,7 @@
      * @return the model
      * @throws ProfileException if the XMIReader couldn't read the profile
      */
-    public Collection loadModel(URL url)
-    throws ProfileException {
+    public Collection loadModel(URL url) throws ProfileException {
         if (url == null) {
             throw new ProfileException("Null profile URL");
         }

Modified: trunk/src_new/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=14015&p1=trunk/src_new/org/argouml/profile/UserDefinedProfile.java&p2=trunk/src_new/org/argouml/profile/UserDefinedProfile.java&r1=14014&r2=14015
==============================================================================
--- trunk/src_new/org/argouml/profile/UserDefinedProfile.java	(original)
+++ trunk/src_new/org/argouml/profile/UserDefinedProfile.java	2007-12-28 01:06:17-0800
@@ -52,20 +52,7 @@
         this.fromZargo = false;
     }
 
-    /**
-     * This constructor is used by the persistence subsystem
-     * when loading an user defined profile from a zargo file.
-     * 
-     * @param fileName the fake file name
-     * @param theModel the model loaded from the zargo file
-     */
-    public UserDefinedProfile(String fileName, Collection<Object> theModel) {
-        this.displayName = fileName;
-        this.modelFile = new File(fileName);
-        this.model = theModel;
-        this.fromZargo = true;
-    }
-
+    
     /**
      * @return the string that should represent this profile in the GUI. An
      *         start (*) is placed on it if it comes from the currently opened
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.