svn commit: r13003 - trunk/src_new/org/argouml: kernel persistence

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-07-09 12:27:26-0700
New Revision: 13003

Added:
   trunk/src_new/org/argouml/kernel/ProjectFactory.java   (contents, props changed)
   trunk/src_new/org/argouml/kernel/ProjectImpl.java
      - copied, changed from r12999, /trunk/src_new/org/argouml/kernel/Project.java
Modified:
   trunk/src_new/org/argouml/kernel/ProjectManager.java
   trunk/src_new/org/argouml/persistence/UmlFilePersister.java
   trunk/src_new/org/argouml/persistence/XmiFilePersister.java
   trunk/src_new/org/argouml/persistence/ZipFilePersister.java

Log:
Issue 4789 - Introduce interface and factory for Project to decouple users from the implementation

Added: trunk/src_new/org/argouml/kernel/ProjectFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectFactory.java?view=auto&rev=13003
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/kernel/ProjectFactory.java	2007-07-09 12:27:26-0700
@@ -0,0 +1,70 @@
+//$Id$
+//Copyright (c) 2007 The Regents of the University of California. All
+//Rights Reserved. Permission to use, copy, modify, and distribute this
+//software and its documentation without fee, and without a written
+//agreement is hereby granted, provided that the above copyright notice
+//and this paragraph appear in all copies. This software program and
+//documentation are copyrighted by The Regents of the University of
+//California. The software program and documentation are supplied "AS
+//IS", without any accompanying services from The Regents. The Regents
+//does not warrant that the operation of the program will be
+//uninterrupted or error-free. The end-user understands that the program
+//was developed for research purposes and is advised not to rely
+//exclusively on the program for any reason. IN NO EVENT SHALL THE
+//UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+//SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+//ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+//THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+//SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+//WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+//MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+//PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+//CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+//UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.net.URI;
+
+/**
+ * Factory for creating new IProject instances.
+ * <p>
+ * Consumers who need an instance of a Project
+ * should instead use this factory to get an instance which implements the
+ * Project interface. This allows us to decouple the specification from its
+ * implementation and break the dependency cycle that would otherwise exist
+ * between Projects and ArgoDiagrams.
+ * 
+ * @author Tom Morris <[email protected]>
+ * @stereotype singleton
+ */
+public class ProjectFactory {
+
+    private ProjectFactory() {
+        super();
+    }
+
+    private static final ProjectFactory INSTANCE = new ProjectFactory();
+
+    /**
+     * Create a new empty project.
+     * 
+     * @return
+     */
+    public Project createProject() {
+        return new ProjectImpl();
+    }
+
+    /**
+     * Create a project with the given URI as its location
+     * @param uri the URI to use as the name/location of the project
+     * @return a newly created project
+     */
+    public Project createProject(URI uri) {
+        return new ProjectImpl(uri);
+    }
+
+    public static ProjectFactory getInstance() {
+        return INSTANCE;
+    }
+}

Copied: trunk/src_new/org/argouml/kernel/ProjectImpl.java (from r12999, /trunk/src_new/org/argouml/kernel/Project.java)
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13003&p1=/trunk/src_new/org/argouml/kernel/Project.java&p2=trunk/src_new/org/argouml/kernel/ProjectImpl.java&r1=12999&r2=13003
==============================================================================
--- /trunk/src_new/org/argouml/kernel/Project.java	(original)
+++ trunk/src_new/org/argouml/kernel/ProjectImpl.java	2007-07-09 12:27:26-0700
@@ -67,18 +67,18 @@
 import org.tigris.gef.undo.UndoManager;
 
 /**
- * The Project is a datastructure that represents the designer's
+ * The ProjectImpl is a data structure that represents the designer's
  * current project. It manages the list of diagrams and UML models.
+ * <p>
+ * NOTE: This was named Project until 0.25.4 when it was replaced by an
+ * interface of the same name and renamed to ProjectImpl.
  */
-public class Project implements java.io.Serializable {
+public class ProjectImpl implements java.io.Serializable, Project {
 
     /**
      * Logger.
      */
-    private static final Logger LOG = Logger.getLogger(Project.class);
-
-    ////////////////////////////////////////////////////////////////
-    // constants
+    private static final Logger LOG = Logger.getLogger(ProjectImpl.class);
 
     /**
      * Default name for a project.
@@ -86,17 +86,11 @@
     private static final String UNTITLED_FILE =
 	Translator.localize("label.projectbrowser-title");
 
-    ////////////////////////////////////////////////////////////////
-    // static variables
-
     /**
      * The UID.
      */
     static final long serialVersionUID = 1399111233978692444L;
 
-    ////////////////////////////////////////////////////////////////
-    // instance variables
-
     /**
      * TODO: should just be the directory to write.
      */
@@ -159,7 +153,7 @@
      *
      * @param theProjectUri Uri to read the project from.
      */
-    public Project(URI theProjectUri) {
+    public ProjectImpl(URI theProjectUri) {
         this();
         uri = PersistenceManager.getInstance().fixUriExtension(theProjectUri);
     }
@@ -167,7 +161,7 @@
     /**
      * Constructor.
      */
-    public Project() {
+    public ProjectImpl() {
         profile = new ProfileJava();
         projectSettings = new ProjectSettings();
 
@@ -199,23 +193,14 @@
         addSearchPath("PROJECT_DIR");
     }
 
-    /**
-     * Find the base name of this project.<p>
-     *
-     * This is the name minus any valid file extension.
-     *
-     * @return The name (a String).
-     */
+
     public String getBaseName() {
         String n = getName();
         n = PersistenceManager.getInstance().getBaseName(n);
         return n;
     }
 
-    /**
-     * Get the project name. This is just the name part of the full filename.
-     * @return the name of the project
-     */
+
     public String getName() {
         // TODO: maybe separate name
         if (uri == null) {
@@ -224,13 +209,7 @@
         return new File(uri).getName();
     }
 
-    /**
-     * Set the project URI.
-     *
-     * @param n The new URI (as a String).
-     * @throws URISyntaxException if the argument cannot be converted to
-     *         an URI.
-     */
+
     public void setName(String n)
         throws URISyntaxException {
         String s = "";
@@ -241,20 +220,12 @@
         setURI(new URI(s));
     }
 
-    /**
-     * Get the URI for this project.
-     *
-     * @return The URI.
-     */
+
     public URI getURI() {
         return uri;
     }
 
-    /**
-     * Set the URI for this project.
-     *
-     * @param theUri The URI to set.
-     */
+
     public void setURI(URI theUri) {
         if (theUri != null) {
             theUri = PersistenceManager.getInstance().fixUriExtension(theUri);
@@ -268,13 +239,7 @@
         uri = theUri;
     }
 
-    /**
-     * Set the project file.
-     *
-     * This only works if it is possible to convert the File to an uri.
-     *
-     * @param file File to set the project to.
-     */
+
     public void setFile(File file) {
         URI theProjectUri = file.toURI();
 
@@ -289,38 +254,25 @@
         uri = theProjectUri;
     }
 
-    /**
-     * Used by "argo.tee".
-     * 
-     * @return the search path
-     */
+
     public Vector getSearchPath() {
         return searchpath;
     }
 
-    /**
-     * @param searchPathElement the element to be added to the searchpath
-     */
+
     public void addSearchPath(String searchPathElement) {
         if (!this.searchpath.contains(searchPathElement)) {
-            this.searchpath.addElement(searchPathElement);
+            searchpath.addElement(searchPathElement);
         }
     }
 
-    /**
-     * Get all members of the project.
-     * Used by "argo2.tee".
-     *
-     * @return a Vector with all members.
-     */
+
     public MemberList getMembers() {
         LOG.info("Getting the members there are " + members.size());
         return members;
     }
 
-    /**
-     * @param d the diagram
-     */
+
     private void addDiagramMember(ArgoDiagram d) {
         ProjectMember pm = new ProjectMemberDiagram(d, this);
         addDiagram(d);
@@ -337,9 +289,7 @@
         LOG.info("Added todo member, there are now " + members.size());
     }
 
-    /**
-     * @param m the member to be added
-     */
+
     public void addMember(Object m) {
 
         if (m == null) {
@@ -393,9 +343,7 @@
         }
     }
 
-    /**
-     * @param model a namespace
-     */
+
     public void addModel(Object model) {
 
         if (!Model.getFacade().isANamespace(model)) {
@@ -457,21 +405,11 @@
     }
 
 
-    /**
-     * Get the author name. 
-     * Used by "argo.tee".
-     *
-     * @return The author name.
-     */
     public String getAuthorname() {
         return authorname;
     }
 
-    /**
-     * Set the author name.
-     *
-     * @param s The new author name.
-     */
+
     public void setAuthorname(final String s) {
         final String oldAuthorName = authorname;
         Memento memento = new Memento() {
@@ -490,21 +428,12 @@
         setSaveEnabled(true);
     }
 
-    /**
-     * Get the author name.
-     * Used by "argo.tee".
-     *
-     * @return The author name.
-     */
+
     public String getAuthoremail() {
         return authoremail;
     }
 
-    /**
-     * Set the author name.
-     *
-     * @param s The new author name.
-     */
+
     public void setAuthoremail(final String s) {
         final String oldAuthorEmail = authoremail;
         Memento memento = new Memento() {
@@ -523,39 +452,22 @@
         setSaveEnabled(true);
     }
 
-    /**
-     * Get the version.
-     * Used by "argo.tee".
-     *
-     * @return the version.
-     */
+
     public String getVersion() {
         return version;
     }
 
-    /**
-     * Set the new version.
-     * @param s The new version.
-     */
+
     public void setVersion(String s) {
         version = s;
     }
 
-    /**
-     * Get the description.
-     * Used by "argo.tee".
-     *
-     * @return the description.
-     */
+
     public String getDescription() {
         return description;
     }
 
-    /**
-     * Set a new description.
-     *
-     * @param s The new description.
-     */
+
     public void setDescription(final String s) {
         final String oldDescription = description;
         Memento memento = new Memento() {
@@ -574,40 +486,22 @@
         setSaveEnabled(true);
     }
 
-    /**
-     * Get the history file.
-     * Used by "argo.tee".
-     *
-     * @return The history file.
-     */
+
     public String getHistoryFile() {
         return historyFile;
     }
 
-    /**
-     * Set the history file.
-     *
-     * @param s The new history file.
-     */
+
     public void setHistoryFile(String s) {
         historyFile = s;
     }
 
-    /**
-     * Returns all models defined by the user. I.e. this does not return the
-     * default model but all other models.
-     *
-     * @return A Vector of all user defined models.
-     */
+
     public Vector getUserDefinedModels() {
         return models;
     }
 
-    /**
-     * Returns all models, including the default model (default.xmi).
-     *
-     * @return A Collection containing all models.
-     */
+
     public Collection getModels() {
         Set ret = new HashSet();
         ret.addAll(models);
@@ -615,13 +509,7 @@
         return ret;
     }
 
-    /**
-     * Return the model.<p>
-     *
-     * If there isn't exactly one model, <code>null</code> is returned.
-     *
-     * @return the model.
-     */
+
     public Object getModel() {
         if (models.size() != 1) {
             return null;
@@ -629,60 +517,30 @@
         return models.elementAt(0);
     }
 
-    /**
-     * Searches for a type/classifier with name s. If the type is not found, a
-     * new type is created and added to the current namespace.
-     * <p>
-     * @param s
-     *            the name of the type/classifier to be found
-     * @return Classifier
-     */
+
     public Object findType(String s) {
         return findType(s, true);
     }
 
-    /**
-     * Return the default type for an attribute.
-     * 
-     * @return a Classifier to use as the default type
-     */
+
     public Object getDefaultAttributeType() {
         // TODO: Move this to a profile - tfm - 20070307
         return findType("int");
     }
 
-    /**
-     * Return the default type for a parameter.
-     * 
-     * @return a Classifier to use as the default type
-     */
+
     public Object getDefaultParameterType() {
         // TODO: Move this to a profile - tfm - 20070307
         return findType("int");
     }
     
-    /**
-     * Return the default type for the return parameter of a method.
-     * 
-     * @return a Classifier to use as the default type
-     */
+
     public Object getDefaultReturnType() {
         // TODO: Move this to a profile - tfm - 20070307
         return findType("void");
     }
 
-    /**
-     * Searches for a type/classifier with name s. If defineNew is
-     * true, a new type is defined if the type/classifier is not
-     * found. The newly created type is added to the currentNamespace
-     * and given the name s.
-     * 
-     * TODO: Move to Model subsystem - tfm 20070307
-     * 
-     * @param s the name of the type/classifier to be found
-     * @param defineNew if true, define a new one
-     * @return Classifier the found classifier
-     */
+
     public Object findType(String s, boolean defineNew) {
         if (s != null) {
             s = s.trim();
@@ -714,15 +572,7 @@
         return cls;
     }
 
-    /**
-     * Finds all figs on the diagrams for some project member,
-     * including the figs containing the member (so for some
-     * operation, the containing figclass is returned).
-     *
-     * @param member The member we are looking for.
-     *              This can be a model element object but also another object.
-     * @return Collection The collection with the figs.
-     */
+
     public Collection findFigsForMember(Object member) {
         Collection figs = new ArrayList();
         Iterator it = diagrams.iterator();
@@ -736,12 +586,7 @@
         return figs;
     }
 
-    /**
-     * Returns a list with all figs for some UML object on all diagrams.
-     *
-     * @param obj the given UML object
-     * @return List the list of figs
-     */
+
     public Collection findAllPresentationsFor(Object obj) {
         Collection figs = new ArrayList();
         Iterator it = diagrams.iterator();
@@ -755,17 +600,7 @@
         return figs;
     }
 
-    /**
-     * Finds a classifier with a certain name.<p>
-     *
-     * Will only return first classifier with the matching name.
-     *
-     * TODO: Move to Model subsystem - tfm 20070307
-     * 
-     * @param s is short name.
-     * @param ns Namespace where we do the search.
-     * @return the found classifier (or <code>null</code> if not found).
-     */
+
     public Object findTypeInModel(String s, Object ns) {
 
         if (!Model.getFacade().isANamespace(ns)) {
@@ -795,9 +630,7 @@
         return null;
     }
 
-    /**
-     * @param m the namespace
-     */
+
     public void setCurrentNamespace(Object m) {
 
         if (m != null && !Model.getFacade().isANamespace(m)) {
@@ -807,37 +640,22 @@
         currentNamespace = m;
     }
 
-    /**
-     * @return the namespace
-     */
+
     public Object getCurrentNamespace() {
         return currentNamespace;
     }
 
-    /**
-     * @return the diagrams
-     * TODO: Whats the best way of changing this to List without effecting
-     * modules or argoeclipse?
-     */
+
     public Vector getDiagrams() {
         return new Vector(diagrams);
     }
 
-    /**
-     * Get the number of diagrams in this project.
-     * Used by argo2.tee!!
-     * @return the number of diagrams in this project.
-     */
+
     public int getDiagramCount() {
         return diagrams.size();
     }
 
-    /**
-     * Finds a diagram with a specific name or UID.
-     *
-     * @return the diagram object (if found). Otherwize null.
-     * @param name is the name to search for.
-     */
+
     public ArgoDiagram getDiagram(String name) {
         Iterator it = diagrams.iterator();
         while (it.hasNext()) {
@@ -853,9 +671,7 @@
         return null;
     }
 
-    /**
-     * @param d the diagram to be added
-     */
+
     public void addDiagram(ArgoDiagram d) {
         // send indeterminate new value instead of making copy of vector
 	d.setProject(this);
@@ -918,11 +734,7 @@
         }
     }
 
-    /**
-     * @param me the given modelelement
-     * @return the total number of presentation
-     *         for the given modelelement in the project
-     */
+
     public int getPresentationCountFor(Object me) {
 
         if (!Model.getFacade().isAUMLElement(me)) {
@@ -938,9 +750,7 @@
         return presentations;
     }
 
-    /**
-     * @return an initial target, in casu a diagram or a model
-     */
+
     public Object getInitialTarget() {
         if (diagrams.size() > 0) {
             return diagrams.get(0);
@@ -952,26 +762,16 @@
     }
 
 
-    /**
-     * @param cgp the generation preferences
-     */
     public void setGenerationPrefs(GenerationPreferences cgp) {
         cgPrefs = cgp;
     }
 
-    /**
-     * @return the generation preferences
-     */
+
     public GenerationPreferences getGenerationPrefs() {
         return cgPrefs;
     }
 
-    ////////////////////////////////////////////////////////////////
-    // event handling
 
-    /**
-     * @return the VetoableChangeSupport
-     */
     public VetoableChangeSupport getVetoSupport() {
         if (vetoSupport == null) {
             vetoSupport = new VetoableChangeSupport(this);
@@ -979,9 +779,7 @@
         return vetoSupport;
     }
 
-    /**
-     * This is executed before a save.
-     */
+
     public void preSave() {
         for (int i = 0; i < diagrams.size(); i++) {
             ((Diagram) diagrams.get(i)).preSave();
@@ -989,9 +787,7 @@
         // TODO: is preSave needed for models?
     }
 
-    /**
-     * This is execcuted after a save.
-     */
+
     public void postSave() {
         for (int i = 0; i < diagrams.size(); i++) {
             ((Diagram) diagrams.get(i)).postSave();
@@ -1000,9 +796,7 @@
         setSaveEnabled(true);
     }
 
-    /**
-     * This is executed after a load.
-     */
+
     public void postLoad() {
         for (int i = 0; i < diagrams.size(); i++) {
             ((Diagram) diagrams.get(i)).postLoad();
@@ -1023,27 +817,7 @@
     ////////////////////////////////////////////////////////////////
     // trash related methods
 
-    /**
-     * Moves some object to trash, i.e. deletes it completely with all
-     * dependent structures. <p>
-     *
-     * Deleting an object involves: <pre>
-     * - Removing Target history
-     * - Deleting all Fig representations for the object
-     * - Deleting the UML element
-     * - Deleting all dependent UML modelelements
-     * - Deleting CommentEdges (which are not UML elements)
-     * - Move to trash for enclosed objects, i.e. graphically drawn on top of
-     * - Move to trash subdiagrams for the object
-     * - Saveguard that there is always at least 1 diagram left
-     * - If the current diagram has been deleted, select a new one to show
-     * - Trigger the explorer when a diagram is deleted
-     * - Set the needsSave (dirty) flag of the projectmanager
-     * </pre>
-     *
-     * @param obj The object to be deleted
-     * @see org.argouml.kernel.Project#trashInternal(Object)
-     */
+
     public void moveToTrash(Object obj) {
         if (obj instanceof Collection) {
             Iterator i = ((Collection) obj).iterator();
@@ -1114,17 +888,12 @@
         }
     }
 
-    /**
-     * @param obj the object
-     * @return true if the object is trashed
-     */
+
     public boolean isInTrash(Object obj) {
         return trashcan.contains(obj);
     }
 
-    /**
-     * @param theDefaultModel a uml model
-     */
+
     public void setDefaultModel(Object theDefaultModel) {
 
         if (!Model.getFacade().isAModel(theDefaultModel)) {
@@ -1137,21 +906,12 @@
         defaultModelTypeCache = new HashMap();
     }
 
-    /**
-     * Get the default model.
-     *
-     * @return A model.
-     */
+
     public Object getDefaultModel() {
         return defaultModel;
     }
 
-    /**
-     * Find a type by name in the default model.
-     *
-     * @param name the name.
-     * @return the type.
-     */
+
     public Object findTypeInDefaultModel(String name) {
         if (defaultModelTypeCache.containsKey(name)) {
             return defaultModelTypeCache.get(name);
@@ -1162,18 +922,12 @@
         return result;
     }
 
-    /**
-     * Returns the root.
-     * @return MModel
-     */
+
     public Object getRoot() {
         return Model.getModelManagementFactory().getRootModel();
     }
 
-    /**
-     * Sets the root.
-     * @param root The root to set, a uml model
-     */
+
     public void setRoot(Object root) {
 
         if (root == null) {
@@ -1194,13 +948,7 @@
         addModel(root);
     }
 
-    /**
-     * Returns true if the given name is a valid name for a diagram. Valid means
-     * that it does not occur as a name for a diagram yet.
-     * @param name The name to test
-     * @return boolean True if there are no problems with this name, false if
-     * it's not valid.
-     */
+
     public boolean isValidDiagramName(String name) {
         Iterator it = diagrams.iterator();
         boolean rv = true;
@@ -1214,73 +962,47 @@
         return rv;
     }
 
-    /**
-     * Returns the searchpath.
-     * @return Vector
-     */
+
     public Vector getSearchpath() {
         return searchpath;
     }
 
-    /**
-     * Returns the uri.
-     * @return URI
-     */
+
     public URI getUri() {
         return uri;
     }
 
-    /**
-     * Returns the uUIDRefs.
-     * @return HashMap
-     */
+
     public Map getUUIDRefs() {
         return uuidRefs;
     }
 
-    /**
-     * Sets the searchpath.
-     * @param theSearchpath The searchpath to set
-     */
+
     public void setSearchpath(Vector theSearchpath) {
         this.searchpath = theSearchpath;
     }
 
-    /**
-     * Sets the uUIDRefs.
-     * @param uUIDRefs The uUIDRefs to set
-     */
+
     public void setUUIDRefs(HashMap uUIDRefs) {
         uuidRefs = uUIDRefs;
     }
 
-    /**
-     * Sets the vetoSupport.
-     * @param theVetoSupport The vetoSupport to set
-     */
+
     public void setVetoSupport(VetoableChangeSupport theVetoSupport) {
         this.vetoSupport = theVetoSupport;
     }
 
-    /**
-     * Get the current viewed diagram.
-     *
-     * @return the current viewed diagram
-     */
+
     public ArgoDiagram getActiveDiagram() {
         return activeDiagram;
     }
 
-    /**
-     * @param theDiagram the ArgoDiagram
-     */
+
     public void setActiveDiagram(ArgoDiagram theDiagram) {
         activeDiagram = theDiagram;
     }
 
-    /**
-     * Remove the project.
-     */
+
     public void remove() {
 
         for (Iterator it = diagrams.iterator(); it.hasNext();) {
@@ -1334,33 +1056,22 @@
         trashcan.clear();
     }
 
-    /**
-     * Used by "argo.tee".
-     * 
-     * @return Returns the persistenceVersion.
-     */
+
     public int getPersistenceVersion() {
         return persistenceVersion;
     }
 
-    /**
-     * @param pv The persistenceVersion to set.
-     */
+
     public void setPersistenceVersion(int pv) {
         persistenceVersion = pv;
     }
 
-    /**
-     * @return Returns the profile.
-     */
+
     public Profile getProfile() {
         return profile;
     }
 
-    /**
-     * Repair all parts of the project before a save takes place.
-     * @return a report of any fixes
-     */
+
     public String repair() {
         String report = "";
         Iterator it = members.iterator();
@@ -1371,13 +1082,9 @@
         return report;
     }
 
-    /**
-     * Used by "argo.tee".
-     * 
-     * @return the settings of this project
-     */
+
     public ProjectSettings getProjectSettings() {
         return projectSettings;
     }
 
-} /* end class Project */
+}

Modified: trunk/src_new/org/argouml/kernel/ProjectManager.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/ProjectManager.java?view=diff&rev=13003&p1=trunk/src_new/org/argouml/kernel/ProjectManager.java&p2=trunk/src_new/org/argouml/kernel/ProjectManager.java&r1=13002&r2=13003
==============================================================================
--- trunk/src_new/org/argouml/kernel/ProjectManager.java	(original)
+++ trunk/src_new/org/argouml/kernel/ProjectManager.java	2007-07-09 12:27:26-0700
@@ -250,7 +250,7 @@
         creatingCurrentProject = true;
         LOG.info("making empty project");
         Project oldProject = currentProject;
-        currentProject = new Project();
+        currentProject = new ProjectImpl();
         if (addDefaultDiagrams) {
             createDefaultDiagrams();
         }

Modified: trunk/src_new/org/argouml/persistence/UmlFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/UmlFilePersister.java?view=diff&rev=13003&p1=trunk/src_new/org/argouml/persistence/UmlFilePersister.java&p2=trunk/src_new/org/argouml/persistence/UmlFilePersister.java&r1=13002&r2=13003
==============================================================================
--- trunk/src_new/org/argouml/persistence/UmlFilePersister.java	(original)
+++ trunk/src_new/org/argouml/persistence/UmlFilePersister.java	2007-07-09 12:27:26-0700
@@ -62,6 +62,7 @@
 import org.argouml.application.helpers.ApplicationVersion;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectFactory;
 import org.argouml.kernel.ProjectMember;
 import org.argouml.model.UmlException;
 import org.argouml.uml.ProjectMemberModel;
@@ -339,7 +340,7 @@
 
         XmlInputStream inputStream = null;
         try {
-            Project p = new Project(file.toURI());
+            Project p = ProjectFactory.getInstance().createProject(file.toURI());
             
             // Run through any stylesheet upgrades
             int fileVersion = getPersistenceVersionFromFile(file);

Modified: trunk/src_new/org/argouml/persistence/XmiFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/XmiFilePersister.java?view=diff&rev=13003&p1=trunk/src_new/org/argouml/persistence/XmiFilePersister.java&p2=trunk/src_new/org/argouml/persistence/XmiFilePersister.java&r1=13002&r2=13003
==============================================================================
--- trunk/src_new/org/argouml/persistence/XmiFilePersister.java	(original)
+++ trunk/src_new/org/argouml/persistence/XmiFilePersister.java	2007-07-09 12:27:26-0700
@@ -24,7 +24,6 @@
 
 package org.argouml.persistence;
 
-import java.io.BufferedWriter;
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -32,16 +31,14 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
 import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectFactory;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.kernel.ProjectMember;
 import org.argouml.model.Model;
@@ -223,7 +220,7 @@
         LOG.info("Loading with XMIFilePersister");
         
         try {
-            Project p = new Project();
+            Project p = ProjectFactory.getInstance().createProject();
             
             
             long length = file.length();

Modified: trunk/src_new/org/argouml/persistence/ZipFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/ZipFilePersister.java?view=diff&rev=13003&p1=trunk/src_new/org/argouml/persistence/ZipFilePersister.java&p2=trunk/src_new/org/argouml/persistence/ZipFilePersister.java&r1=13002&r2=13003
==============================================================================
--- trunk/src_new/org/argouml/persistence/ZipFilePersister.java	(original)
+++ trunk/src_new/org/argouml/persistence/ZipFilePersister.java	2007-07-09 12:27:26-0700
@@ -39,6 +39,7 @@
 import org.apache.log4j.Logger;
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
+import org.argouml.kernel.ProjectFactory;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.kernel.ProjectMember;
 import org.argouml.model.Model;
@@ -211,7 +212,7 @@
         LOG.info("Receiving file '" + file.getName() + "'");
 
         try {
-            Project p = new Project();
+            Project p = ProjectFactory.getInstance().createProject();
             String fileName = file.getName();
             String extension =
                 fileName.substring(
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.