svn commit: r13344 - branches/gsoc2007/maurelio1234/branch2/src_new: . org/argouml org/argouml/kernel org/argouml/ui org/argouml/ui/explorer org/argouml/uml org/argouml/uml/profile org/argouml/uml/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-08-14 11:06:40-0700
New Revision: 13344

Modified:
   branches/gsoc2007/maurelio1234/branch2/src_new/.classpath
   branches/gsoc2007/maurelio1234/branch2/src_new/default.properties
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java

Log:
removing code using deprecated profiles API

implementing "appliedProfile" semantics

updating tests

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/.classpath?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/.classpath&p2=branches/gsoc2007/maurelio1234/branch2/src_new/.classpath&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/.classpath	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/.classpath	2007-08-14 11:06:40-0700
@@ -8,5 +8,12 @@
 	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model-euml"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model-mdr"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-tools"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/antlrall-2.7.2.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/commons-logging-1.0.2.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/gef-0.12.4M4.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/log4j-1.2.6.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/ocl-argo-1.1.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/swidgets-0.1.4.jar"/>
+	<classpathentry kind="lib" path="/argouml-core-lib/toolbar-1.4.jar"/>
 	<classpathentry kind="output" path="build-eclipse"/>
 </classpath>

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/default.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/default.properties?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/default.properties&p2=branches/gsoc2007/maurelio1234/branch2/src_new/default.properties&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/default.properties	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/default.properties	2007-08-14 11:06:40-0700
@@ -37,18 +37,18 @@
 # set in one of the user's property files.  It should be set to an absolute
 # path so that it works for subcomponent builds.
 #
-argo.tools.dir=${argo.root.dir}/tools
-argo.model.dir=${argo.root.dir}/src/model
-argo.mdr.dir=${argo.root.dir}/src/model-mdr
-argo.euml.dir=${argo.root.dir}/src/model-euml
-argo.tests.src=${argo.root.dir}/tests
-argo.lib.dir=${argo.root.dir}/lib
-argo.src.dir=${argo.root.dir}/src_new
+argo.tools.dir=${argo.root.dir}/argouml-core-tools
+argo.model.dir=${argo.root.dir}/argouml-core-model
+argo.mdr.dir=${argo.root.dir}/argouml-core-model-mdr
+argo.euml.dir=${argo.root.dir}/argouml-core-model-euml
+argo.tests.src=${argo.root.dir}/argouml-core-tests
+argo.lib.dir=${argo.root.dir}/argouml-core-lib
+argo.src.dir=${argo.root.dir}/argouml_branch
 #
 argo.build.dir=${argo.root.dir}/build
 argo.tools.lib=${argo.tools.dir}/lib
 #
-argo.tests.dir=${argo.build.dir}/tests
+argo.tests.dir=${argo.build.dir}/argouml-core-tests
 argo.tests.classes=${argo.tests.dir}/classes
 argo.tests.reports=${argo.tests.dir}/reports
 #

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi	2007-08-14 11:06:40-0700
@@ -1,5 +1,5 @@
 <?xml version = '1.0' encoding = 'UTF-8' ?>

-<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Mon Aug 13 17:13:00 BRT 2007'>

+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Tue Aug 14 09:04:21 BRT 2007'>

   <XMI.header>    <XMI.documentation>
       <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
       <XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-05-12 03:08:08 -0300 $ </XMI.exporterVersion>
@@ -212,6 +212,7 @@
         <UML:Stereotype xmi.id = '.:0000000000000874' name = 'appliedProfile' isSpecification = 'false'

           isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>

           <UML:Stereotype.baseClass>Package</UML:Stereotype.baseClass>

+          <UML:Stereotype.baseClass>Dependency</UML:Stereotype.baseClass>

         </UML:Stereotype>

         <UML:Stereotype xmi.id = '.:0000000000000875' name = 'auxiliary' isSpecification = 'false'

           isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>

@@ -220,6 +221,7 @@
         <UML:Stereotype xmi.id = '.:0000000000000876' name = 'modelLibrary' isSpecification = 'false'

           isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>

           <UML:Stereotype.baseClass>Package</UML:Stereotype.baseClass>

+          <UML:Stereotype.baseClass>Dependency</UML:Stereotype.baseClass>

         </UML:Stereotype>

         <UML:Stereotype xmi.id = '.:0000000000000877' name = 'profile' isSpecification = 'false'

           isRoot = 'false' isLeaf = 'false' isAbstract = 'false'>


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java	2007-08-14 11:06:40-0700
@@ -882,26 +882,24 @@
         }
     }
 
-
     public boolean isInTrash(Object obj) {
         return trashcan.contains(obj);
     }
 
-
     @SuppressWarnings("deprecation")
     public void setDefaultModel(Object theDefaultModel) {
-        defaultModelTypeCache = new HashMap<String, Object>();
+        throw new UnsupportedOperationException();
     }
 
     @SuppressWarnings("deprecation")
     public Object getDefaultModel() {
-		throw new UnsupportedOperationException();
+        throw new UnsupportedOperationException();
     }
-    
+
     @SuppressWarnings("deprecation")
     @Deprecated
     public Collection getProfiles() {
-		throw new UnsupportedOperationException();
+        throw new UnsupportedOperationException();
     }
 
     public Object findTypeInDefaultModel(String name) {
@@ -982,12 +980,10 @@
         return new Vector(searchpath);
     }
 
-
     public Map<String, Object> getUUIDRefs() {
         return uuidRefs;
     }
 
-
     @SuppressWarnings("deprecation")
     public void setSearchpath(Vector<String> theSearchpath) {
         searchpath = theSearchpath;
@@ -1002,12 +998,10 @@
         uuidRefs = uUIDRefs;
     }
 
-
     public void setVetoSupport(VetoableChangeSupport theVetoSupport) {
         vetoSupport = theVetoSupport;
     }
 
-
     public ArgoDiagram getActiveDiagram() {
         return activeDiagram;
     }
@@ -1017,7 +1011,6 @@
         activeDiagram = theDiagram;
     }
 
-
     public void remove() {
         for (ArgoDiagram diagram : diagrams) {
             diagram.remove();
@@ -1074,7 +1067,7 @@
     @SuppressWarnings("deprecation")
     @Deprecated
     public Profile getProfile() {
-		throw new UnsupportedOperationException();
+	throw new UnsupportedOperationException();
     }
 
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java	2007-08-14 11:06:40-0700
@@ -49,6 +49,7 @@
 import org.argouml.kernel.ProjectManager;

 import org.argouml.uml.profile.Profile;

 import org.argouml.uml.profile.ProfileConfiguration;

+import org.argouml.uml.profile.ProfileException;

 import org.argouml.uml.profile.ProfileManager;

 import org.argouml.uml.profile.ProfileManagerImpl;

 import org.argouml.uml.profile.UserDefinedProfile;

@@ -86,7 +87,7 @@
 	private ProfileManager profileManager = ProfileManagerImpl

 		.getInstance();

 

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

          * @param arg0

@@ -103,8 +104,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -178,7 +178,7 @@
      * @author maurelio1234

      */

     private class UsedProfilesListModel implements ListModel {

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

 	 * @param arg0

@@ -195,8 +195,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -361,24 +360,23 @@
 

 	    int ret = fileChooser.showOpenDialog(this);

 	    if (ret == JFileChooser.APPROVE_OPTION) {

-		File file = fileChooser.getSelectedFile();

+                File file = fileChooser.getSelectedFile();

 

-		UserDefinedProfile profile = new UserDefinedProfile(file);

-

-		if (profile.getModel() != null) {

-		    ProfileManagerImpl.getInstance().registerProfile(profile);

-

-		    ProjectManager.getManager().getCurrentProject()

-			    .getProfileConfiguration().addProfile(profile);

-

-		    UsedProfilesListModel model = 

-			((UsedProfilesListModel) usedList.getModel());

-		    model.fireListeners();

-		} else {

-		    JOptionPane.showMessageDialog(this,

-			    Translator.localize("tab.profiles.userdefined.errorloading"));

-		}

-	    }

+                try {

+                    UserDefinedProfile profile = new UserDefinedProfile(file);

+                    ProfileManagerImpl.getInstance().registerProfile(profile);

+

+                    ProjectManager.getManager().getCurrentProject()

+                            .getProfileConfiguration().addProfile(profile);

+

+                    UsedProfilesListModel model = ((UsedProfilesListModel) usedList

+                            .getModel());

+                    model.fireListeners();

+                } catch (ProfileException e) {

+                    JOptionPane.showMessageDialog(this, Translator

+                            .localize("tab.profiles.userdefined.errorloading"));

+                }

+            }

 	}

 

 	availableList.validate();


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java	2007-08-14 11:06:40-0700
@@ -49,13 +49,13 @@
 import javax.swing.filechooser.FileFilter;

 

 import org.argouml.application.api.GUISettingsTabInterface;

-import org.argouml.configuration.Configuration;

 import org.argouml.i18n.Translator;

 import org.argouml.kernel.ProjectManager;

 import org.argouml.kernel.ProjectSettings;

 import org.argouml.uml.diagram.ui.FigNodeModelElement;

 import org.argouml.uml.profile.Profile;

 import org.argouml.uml.profile.ProfileConfiguration;

+import org.argouml.uml.profile.ProfileException;

 import org.argouml.uml.profile.ProfileManager;

 import org.argouml.uml.profile.ProfileManagerImpl;

 import org.argouml.uml.profile.UserDefinedProfile;

@@ -101,7 +101,7 @@
 	private ProfileManager profileManager = ProfileManagerImpl

 		.getInstance();

 

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

          * @param arg0

@@ -118,8 +118,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -193,7 +192,7 @@
      * @author maurelio1234

      */

     private class UsedProfilesListModel implements ListModel {

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

 	 * @param arg0

@@ -210,8 +209,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -442,25 +440,24 @@
 

 	    int ret = fileChooser.showOpenDialog(this);

 	    if (ret == JFileChooser.APPROVE_OPTION) {

-		File file = fileChooser.getSelectedFile();

+                File file = fileChooser.getSelectedFile();

 

-		UserDefinedProfile profile = new UserDefinedProfile(file);

+                try {

+                    UserDefinedProfile profile = new UserDefinedProfile(file);

+                    ProfileManagerImpl.getInstance().registerProfile(profile);

 

-		if (profile.getModel() != null) {

-		    ProfileManagerImpl.getInstance().registerProfile(profile);

+                    ProjectManager.getManager().getCurrentProject()

+                            .getProfileConfiguration().addProfile(profile);

 

-		    ProjectManager.getManager().getCurrentProject()

-			    .getProfileConfiguration().addProfile(profile);

-

-		    UsedProfilesListModel model = 

-			((UsedProfilesListModel) usedList.getModel());

-		    model.fireListeners();

-		} else {

-		    JOptionPane.showMessageDialog(this,

-			    Translator.localize("tab.profiles.userdefined.errorloading"));

-		}

-	    }

-	}

+                    UsedProfilesListModel model = ((UsedProfilesListModel) usedList

+                            .getModel());

+                    model.fireListeners();

+                } catch (ProfileException e) {

+                    JOptionPane.showMessageDialog(this, Translator

+                            .localize("tab.profiles.userdefined.errorloading"));

+                }

+            }

+        }

 

 	availableList.validate();

 	usedList.validate();


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java	2007-08-14 11:06:40-0700
@@ -56,6 +56,7 @@
 import org.argouml.i18n.Translator;

 import org.argouml.uml.diagram.ui.FigNodeModelElement;

 import org.argouml.uml.profile.Profile;

+import org.argouml.uml.profile.ProfileException;

 import org.argouml.uml.profile.ProfileManager;

 import org.argouml.uml.profile.ProfileManagerImpl;

 import org.argouml.uml.profile.UserDefinedProfile;

@@ -118,7 +119,7 @@
 	private ProfileManager profileManager = ProfileManagerImpl

 		.getInstance();

 

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

          * @param arg0

@@ -135,8 +136,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -209,7 +209,7 @@
      * @author maurelio1234

      */

     private class DefaultProfilesListModel implements ListModel {

-	private Vector listeners = new Vector();

+	private Vector<ListDataListener> listeners = new Vector<ListDataListener>();

 

 	/**

 	 * @param arg0

@@ -226,8 +226,7 @@
 	    ListDataEvent evt = new ListDataEvent(this,

 		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

 	    for (int i = 0; i < listeners.size(); ++i) {

-		((ListDataListener) listeners.elementAt(i))

-			.contentsChanged(evt);

+		listeners.elementAt(i).contentsChanged(evt);

 	    }

 	}

 

@@ -492,21 +491,21 @@
 	    if (ret == JFileChooser.APPROVE_OPTION) {

 		File file = fileChooser.getSelectedFile();

 

-		UserDefinedProfile profile = new UserDefinedProfile(file);

+                try {

+                    UserDefinedProfile profile = new UserDefinedProfile(file);

 

-		if (profile.getModel() != null) {

-		    ProfileManagerImpl.getInstance().registerProfile(profile);

+                    ProfileManagerImpl.getInstance().registerProfile(profile);

 

-		    DefaultProfilesListModel model = 

-			((DefaultProfilesListModel) defaultList.getModel());

-		    model.fireListeners();

-		} else {

-		    JOptionPane.showMessageDialog(this,

-			    Translator.localize("tab.profiles.userdefined.errorloading"));

-		}

-	    }

+                    DefaultProfilesListModel model = ((DefaultProfilesListModel) defaultList

+                            .getModel());

+                    model.fireListeners();

+

+                } catch (ProfileException e) {

+                    JOptionPane.showMessageDialog(this, Translator

+                            .localize("tab.profiles.userdefined.errorloading"));

+                }

+            }

 

-        ///

         } else if (arg0.getSource() == removeDirectory) { 

             if (directoryList.getSelectedIndex() != -1) {

                 int idx = directoryList.getSelectedIndex();


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java	2007-08-14 11:06:40-0700
@@ -58,6 +58,7 @@
 import org.argouml.uml.diagram.ui.ActionSaveDiagramToClipboard;
 import org.argouml.uml.profile.Profile;
 import org.argouml.uml.profile.ProfileConfiguration;
+import org.argouml.uml.profile.ProfileException;
 import org.argouml.uml.ui.ActionActivityDiagram;
 import org.argouml.uml.ui.ActionAddPackage;
 import org.argouml.uml.ui.ActionClassDiagram;
@@ -693,14 +694,18 @@
         boolean found = selectedItem instanceof ProfileConfiguration ||
                             selectedItem instanceof Profile;
         
-        Iterator it = currentProject.getProfileConfiguration().getProfileModels().iterator();
-        while(!found && it.hasNext()) {
-            Object model = it.next();
-            
-            if ((Model.getFacade().getModel(selectedItem).equals(model))) {
-                found = true;
-                break;
-            }
+        for (Profile profile : currentProject.getProfileConfiguration().getProfiles()) {
+            Collection models;
+            try {
+                models = profile.getProfilePackages();
+                for (Object model : models) {
+                    if ((Model.getFacade().getModel(selectedItem).equals(model))) {
+                        found = true;
+                        break;
+                    }                
+                }
+            } catch (ProfileException e) {
+            }            
         }
         
         return found;

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java	2007-08-14 11:06:40-0700
@@ -91,20 +91,57 @@
                     throw new ClassCastException(e.getMessage());
                 }
             }
-        });            
-        Collection models =
-            ProjectManager.getManager().getCurrentProject().getModels();
+        });
+        
+//        Collection models =
+//            ProjectManager.getManager().getCurrentProject().getModels();
             
-        addAllUniqueModelElementsFrom(availableStereotypes, paths, Model
-                .getExtensionMechanismsHelper().getAllPossibleStereotypes(
-                        models, modelElement));
+//        addAllUniqueModelElementsFrom(availableStereotypes, paths, Model
+//                .getExtensionMechanismsHelper().getAllPossibleStereotypes(
+//                        models, modelElement));
+
+        // ir subindo na hierarquia!!!        
+        Object namespace = Model.getFacade().getNamespace(modelElement);
+        getApplicableStereotypesInNamespace(modelElement, paths,
+                availableStereotypes, namespace);
+        
         addAllUniqueModelElementsFrom(availableStereotypes, paths,
                 ProjectManager.getManager().getCurrentProject()
                         .getProfileConfiguration()
                         .findAllStereotypesForModelElement(modelElement));
+        
         return availableStereotypes;
     }
+
+    private static void getApplicableStereotypesInNamespace(
+            Object modelElement, Set paths, Set availableStereotypes,
+            Object namespace) {
+        Collection allProfiles = getAllProfilePackages(Model.getFacade()
+                .getModel(modelElement));
+        
+        for (Object profilePackage : allProfiles) {
+            Collection allDependencies = Model.getCoreHelper().getDependencies(
+                    profilePackage, namespace);
+
+            for (Object dependency : allDependencies) {
+                if (Model.getExtensionMechanismsHelper().hasStereotype(
+                        dependency, "appliedProfile")) {
+                    addAllUniqueModelElementsFrom(availableStereotypes, paths,
+                            getAllStereotypesFromPackage(profilePackage));
+                    break;
+                }
+            }
+        }
+    }
     
+    private static Collection getAllStereotypesFromPackage(Object profilePackage) {
+        return new ArrayList();
+    }
+
+    private static Collection getAllProfilePackages(Object model) {
+        return new ArrayList();
+    }
+
     /**
      * Helper method for buildModelList.
      * <p>

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java	2007-08-14 11:06:40-0700
@@ -48,9 +48,10 @@
     /**

      * @param modelFilename the model to be loaded

      * @return the profile model

+     * @throws ProfileException 

      * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)

      */

-    public Collection loadModel(String modelFilename) {

+    public Collection loadModel(String modelFilename) throws ProfileException {

         LOG.info("Loading profile from file'" + modelFilename + "'");

         InputStream is = null;

         //

@@ -62,8 +63,8 @@
             

             return super.loadModel(is);

         } catch (FileNotFoundException ex) {

+            throw new ProfileException("Model file not found!");

         }

-        return null;

     }

 

 }


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java	2007-08-14 11:06:40-0700
@@ -50,7 +50,8 @@
      */

     protected final void addProfileDependency(Profile p) throws IllegalArgumentException {

         if (importingProfiles.contains(p)) {

-            throw new IllegalArgumentException();

+            throw new IllegalArgumentException(

+                    "This profile causes a cycle in the profile dependency graph!");

         } else {

             importedProfiles.add(p);

             importedProfiles.addAll(p.importedProfiles);

@@ -77,6 +78,7 @@
      * @return the UML Model that contains the profile model

      * @deprecated by maurelio1234. Use {@link #getProfilePackages()} instead.

      */

+    @Deprecated

     public Object getModel() {

         Collection c = null;

         try {

@@ -109,7 +111,10 @@
      *    @param element element to represent.

      *    @param namespace context namespace (may be null).

      *    @return a string representing the model element

+     *   

+     *   @deprecated by maurelio1234. Use {@link #getFormatingStrategy()} instead.

      */

+    @Deprecated

     public String formatElement(Object element,

                                          Object namespace) {

         FormatingStrategy fs = getFormatingStrategy(); 

@@ -119,13 +124,17 @@
             return null;

         }

     }

+    

     /**

      *   This method produces a string the represents the collection

      *   of model elements in the context of the specified namespace.

      *   @param iter iterator over collection

      *   @param namespace context namespace (may be null).

      *   @return a string representing the collection

+     *   

+     *   @deprecated by maurelio1234. Use {@link #getFormatingStrategy()} instead.

      */

+    @Deprecated

     public String formatCollection(Iterator iter,

                                             Object namespace) {

         FormatingStrategy fs = getFormatingStrategy(); 

@@ -172,6 +181,7 @@
      * @throws ProfileException if the given file isn't a valid profile

      * @deprecated by maurelio1234

      */

+    @SuppressWarnings("unused")

     @Deprecated

     public void setProfileModelFilename(String filename)

         throws ProfileException {


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java	2007-08-14 11:06:40-0700
@@ -36,7 +36,6 @@
 import org.argouml.kernel.AbstractProjectMember;

 import org.argouml.kernel.Project;

 import org.argouml.model.Model;

-import org.argouml.ui.explorer.ActionExportProfileXMI;

 import org.argouml.ui.explorer.ExplorerEventAdaptor;

 /**

  *   This class captures represents the unique access point for the 

@@ -104,7 +103,7 @@
     /**

      * @return the list of applied profiles

      */

-    public Vector getProfiles() {

+    public Vector<Profile> getProfiles() {

         return profiles;

     }

     

@@ -137,11 +136,8 @@
         

     /**

      * @return the list of models of the currently applied profile.

-     * @deprecated by maurelio1234

      */

-    @SuppressWarnings("dep-ann")

-    @Deprecated

-    public Vector getProfileModels() {

+    private Vector getProfileModels() {

         return profileModels;

     }

 


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java	2007-08-14 11:06:40-0700
@@ -27,6 +27,7 @@
 import java.util.ArrayList;

 import java.util.Collection;

 

+import org.apache.log4j.Logger;

 import org.argouml.model.Model;

 

 /**

@@ -35,6 +36,10 @@
  * @author Marcos Aurélio

  */

 public class ProfileCpp extends Profile {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger.getLogger(ProfileCpp.class);

 

     private FormatingStrategy formatingStrategy;

     private ProfileModelLoader profileModelLoader;

@@ -46,7 +51,12 @@
      */

     public static ProfileCpp getInstance() {

         if (instance == null) {

-            instance = new ProfileCpp();

+            try {

+                instance = new ProfileCpp();

+            } catch (ProfileException e) {

+                LOG.error("Exception", e);

+                instance = null;

+            }

         }

         return instance;

     }

@@ -54,9 +64,10 @@
     

     /**

      * The default constructor for this class 

+     * @throws ProfileException 

      */

     @SuppressWarnings("unchecked")

-    private ProfileCpp() {

+    private ProfileCpp() throws ProfileException {

 	profileModelLoader = new ResourceModelLoader();

 	model = profileModelLoader

 		.loadModel("/org/argouml/default-cpp.xmi");


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java	2007-08-14 11:06:40-0700
@@ -27,6 +27,7 @@
 import java.util.ArrayList;

 import java.util.Collection;

 

+import org.apache.log4j.Logger;

 import org.argouml.model.Model;

 

 /**

@@ -36,6 +37,11 @@
  */

 public class ProfileJava extends Profile {

 

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger.getLogger(ProfileJava.class);

+

     private FormatingStrategy formatingStrategy;

     private ProfileModelLoader profileModelLoader;

     private Collection model;

@@ -46,16 +52,22 @@
      */

     public static ProfileJava getInstance() {

         if (instance == null) {

-            instance = new ProfileJava();

+            try {

+                instance = new ProfileJava();

+            } catch (ProfileException e) {

+                LOG.error("Exception", e);

+                instance = null;

+            }

         }

         return instance;

     }

     

     /**

      * The default constructor for this class 

+     * @throws ProfileException 

      */

     @SuppressWarnings("unchecked")

-    private ProfileJava() {

+    private ProfileJava() throws ProfileException {

 	profileModelLoader = new ResourceModelLoader();

 	model = profileModelLoader

 		.loadModel("/org/argouml/default-java.xmi");


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java	2007-08-14 11:06:40-0700
@@ -58,11 +58,11 @@
      */

     private boolean disableConfigurationUpdate = false;

     

-    private Vector profiles = new Vector();

+    private Vector<Profile> profiles = new Vector<Profile>();

 

-    private Vector defaultProfiles = new Vector();

+    private Vector<Profile> defaultProfiles = new Vector<Profile>();

 

-    private Vector searchDirectories = new Vector();

+    private Vector<String> searchDirectories = new Vector<String>();

 

     private ProfileManagerImpl() {

         defaultProfiles.add(ProfileUML.getInstance());

@@ -293,9 +293,13 @@
                         boolean found = findUserDefinedProfile(files[i]) != null;

 

                         if (!found) {

-                            UserDefinedProfile udp = new UserDefinedProfile(

-                                    files[i]);

-                            registerProfile(udp);

+                            UserDefinedProfile udp = null;

+                            try {

+                                udp = new UserDefinedProfile(files[i]);

+                                registerProfile(udp);

+                            } catch (ProfileException e) {

+                                // if an exception is raised this file is not useful

+                            }

                         }

                     }

                 }


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java	2007-08-14 11:06:40-0700
@@ -38,6 +38,7 @@
      * @param path the path where the profile can be found. <b>

      *             The expected string format is implementation specific! 

      * @return the set of defined packages

+     * @throws ProfileException if the profile could not be loaded for some reason

      */

-    Collection loadModel(String path);  

+    Collection loadModel(String path) throws ProfileException;  

 }


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java	2007-08-14 11:06:40-0700
@@ -27,6 +27,7 @@
 import java.util.ArrayList;

 import java.util.Collection;

 

+import org.apache.log4j.Logger;

 import org.argouml.model.Model;

 

 /**

@@ -36,6 +37,11 @@
  */

 public class ProfileUML extends Profile {

 

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger.getLogger(ProfileUML.class);

+    

     private FormatingStrategy formatingStrategy;

     private ProfileModelLoader profileModelLoader;

     private Collection model;

@@ -45,17 +51,23 @@
      * @return the unique instance for this profile

      */

     public static ProfileUML getInstance() {

-        if (instance == null) {

-            instance = new ProfileUML();

+        if (instance == null) {           

+            try {

+                instance = new ProfileUML();

+            } catch (ProfileException e) {

+                LOG.error("Exception", e);

+                instance = null;

+            }

         }

         return instance;

     }

     

     /**

      * The default constructor for this class 

+     * @throws ProfileException 

      */

     @SuppressWarnings("unchecked")

-    private ProfileUML() {

+    private ProfileUML() throws ProfileException {

         formatingStrategy = new JavaFormatingStrategy();

 	profileModelLoader = new ResourceModelLoader();

 	model = profileModelLoader


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java	2007-08-14 11:06:40-0700
@@ -63,12 +63,12 @@
     /**

      * @param path the model path

      * @return the model

+     * @throws ProfileException if the profile could not be loaded 

      * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)

      */

-    public Collection loadModel(String path) {

+    public Collection loadModel(String path) throws ProfileException {

         LOG.info("Loading profile from resource'" + path + "'");

-	return super.loadModel(this.classloader

-		.getResourceAsStream(path));

+        return super.loadModel(this.classloader.getResourceAsStream(path));

     }

 

 }


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java	2007-08-14 11:06:40-0700
@@ -42,21 +42,22 @@
     /**

      * Logger.

      */

-    private static final Logger LOG = Logger

-	    .getLogger(StreamModelLoader.class);

+    private static final Logger LOG = Logger.getLogger(StreamModelLoader.class);

 

     /**

      * @param path the path of the model

      * @return the loaded model

+     * @throws ProfileException

      * @see org.argouml.uml.profile.ProfileModelLoader#loadModel(java.lang.String)

      */

-    public abstract Collection loadModel(String path);

+    public abstract Collection loadModel(String path) throws ProfileException;

 

     /**

      * @param is the stream from where the model should be loaded

      * @return the model

+     * @throws ProfileException if the XMIReader couldn't read the input stream

      */

-    protected Collection loadModel(InputStream is) {

+    protected Collection loadModel(InputStream is) throws ProfileException {

         if (is != null) {

             try {

                 XmiReader xmiReader = Model.getXmiReader();

@@ -65,10 +66,10 @@
                 return elements;

             } catch (UmlException e) {

                 LOG.error("Exception while loading profile ", e);

-                return null;

+                throw new ProfileException("Invalid XMI data!");

             }

         }

         LOG.error("Profile not found");

-        return null;	

+        throw new ProfileException("Profile not found!");	

     }

 }


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java	2007-08-14 11:06:40-0700
@@ -43,8 +43,9 @@
      * The default constructor for this class

      * 

      * @param file the file from where the model should be read  

+     * @throws ProfileException if the profile could not be loaded

      */

-    public UserDefinedProfile(File file) {

+    public UserDefinedProfile(File file) throws ProfileException {

 	this.displayName = file.getName();

 	this.modelFile = file;

         this.model = new FileModelLoader().loadModel(modelFile.getPath());


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java	2007-08-14 11:06:40-0700
@@ -50,9 +50,10 @@
     /**

      * @param modelFilename the zip file

      * @return the loaded model

+     * @throws ProfileException if the profile could not be loaded

      * @see org.argouml.uml.profile.StreamModelLoader#loadModel(java.lang.String)

      */

-    public Collection loadModel(String modelFilename) {

+    public Collection loadModel(String modelFilename) throws ProfileException {

 	LOG.info("Loading profile from ZIP '" + modelFilename + "'");

 

 	InputStream is = null;

@@ -75,18 +76,19 @@
 	    } catch (MalformedURLException e) {

 		LOG.error("Exception while loading profile '" + modelFilename

 			+ "'", e);

-		return null;

+		throw new ProfileException(e);

 	    } catch (IOException e) {

 		LOG.error("Exception while loading profile '" + modelFilename

 			+ "'", e);

-		return null;

+                throw new ProfileException(e);

 	    }

 

 	    if (is != null) {

 		return super.loadModel(is);

 	    }

 	}

-	return null;

+	

+        throw new ProfileException("Profile could not be loaded!");

     }

 

     /**


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java?view=diff&rev=13344&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java&r1=13343&r2=13344
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java	2007-08-14 11:06:40-0700
@@ -28,6 +28,7 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.model.Model;
+import org.argouml.uml.profile.FormatingStrategy;
 import org.argouml.uml.profile.Profile;
 
 /**
@@ -52,7 +53,7 @@
 
     /** longName is composed of an identifier and a name as in Class: String */
     private String longName;
-    private Profile profile;
+    private FormatingStrategy formater;
 
     /** display name will be the same as shortName unless there
      *  is a name collision */
@@ -75,7 +76,12 @@
         element = modelElement;
         if (modelElement != null) {
             Object ns = Model.getFacade().getNamespace(modelElement);
-            shortName = theProfile.formatElement(modelElement, ns);
+            if (theProfile.getFormatingStrategy() != null) {
+                shortName = theProfile.getFormatingStrategy().formatElement(
+                        modelElement, ns);
+            } else {
+                // TODO What should we do here?
+            }
         } else {
             shortName = "";
         }
@@ -83,7 +89,7 @@
         //
         //   format the element in its own namespace
         //       should result in an name without packages
-        profile = theProfile;
+        formater = theProfile.getFormatingStrategy();
         longName = null;
         displayName = shortName;
         thisIsAPhantom = isPhantom;
@@ -103,7 +109,11 @@
     public void updateName() {
         if (element != null) {
             Object ns = Model.getFacade().getNamespace(element);
-            shortName = profile.formatElement(element, ns);
+            if (formater != null) {
+                shortName = formater.formatElement(element, ns);                
+            } else {
+                // TODO what should we do here?                
+            }
         }
     }
 
@@ -138,7 +148,11 @@
     public String getLongName() {
         if (longName == null) {
             if (element != null) {
-                longName = profile.formatElement(element, null);
+                if (formater != null) {
+                    longName = formater.formatElement(element, null);
+                } else {
+                    // TODO what should we do here?
+                }
             }
             else {
                 longName = "(unspecified)"; // TODO: I18N
@@ -294,7 +308,11 @@
     public void nameChanged(Object modelElement) {
         if (modelElement == element && element != null) {
             Object ns = Model.getFacade().getNamespace(element);
-            shortName = profile.formatElement(element, ns);
+            if (formater != null) {
+                shortName = formater.formatElement(element, ns);                
+            } else {
+                // TODO what should we do here?                
+            }
             displayName = shortName;
             longName = null;
         }
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.