svn commit: r18284 - branches/BRANCH_0_30_x: . modules/dev src/argouml-app src/argouml-app/src/org/argouml/notation/providers/uml src/argouml-app/src/org/argouml/profile src/argouml-app/src/org/argouml/profile/init src/argouml-app/src/org/argouml/profile/internal src/argouml-app/src/org/argouml/resource src/argouml-app/src/org/argouml/ui src/argouml-app/src/org/argouml/ui/cmd src/argouml-app/src/org/argouml/uml/cognitive/critics src/argouml-app/src/org/argouml/uml/diagram/state/ui src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms src/argouml-app/tests/org/argouml/kernel src/argouml-app/tests/org/argouml/model src/argouml-app/tests/org/argouml/notation/providers/uml src/argouml-app/tests/org/argouml/persistence src/argouml-app/tests/org/argouml/profile src/argouml-app/tests/org/argouml/profile/internal src/argouml-app/tests/org/argouml/ui src/

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: linus
Date: 2010-04-18 11:31:50-0700
New Revision: 18284

Added:
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/resource/fullmdr_console.lcf
      - copied unchanged from r18203, /trunk/src/argouml-app/src/org/argouml/resource/fullmdr_console.lcf
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java
      - copied, changed from r18235, /trunk/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/
      - copied from r18235, /trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tools/mdrsrc20050711.jar
      - copied unchanged from r18272, /trunk/src/argouml-core-model-mdr/tools/mdrsrc20050711.jar
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/META-INF/
      - copied from r18203, /trunk/src/argouml-core-umlpropertypanels/META-INF/
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/build.properties
      - copied unchanged from r18203, /trunk/src/argouml-core-umlpropertypanels/build.properties
Replaced:
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/TestUMLTagDefinitionComboBoxModel.java
      - copied unchanged from r18235, /trunk/src/argouml-app/tests/org/argouml/uml/ui/foundation/extension_mechanisms/TestUMLTagDefinitionComboBoxModel.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/META-INF/MANIFEST.MF
      - copied unchanged from r18203, /trunk/src/argouml-core-umlpropertypanels/META-INF/MANIFEST.MF
Removed:
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/TestUMLTagDefinitionComboBoxModel.java
Modified:
   branches/BRANCH_0_30_x/   (props changed)
   branches/BRANCH_0_30_x/modules/dev/ArgoUML dev.launch
   branches/BRANCH_0_30_x/src/argouml-app/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/build.xml
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/Profile.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/ProfileFacade.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileCodeGeneration.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileGoodPractices.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
   branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestAttributeAndOperationNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestEnumerationLiteralNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestProfileConfigurationFilePersister.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestXmiFilePersister.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestZargoFilePersister.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/   (props changed)
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ProfileMother.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileFacade.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileManager.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileMother.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestReaderModelLoader.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java
   branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestProfileDefault.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/AggregationKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeCommand.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeableKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommandStackImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ConcurrencyKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CopyHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DirectionKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/OrderingKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/PseudostateKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RunnableClass.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ScopeKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UMLUtil.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/VisibilityKindEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/.classpath
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReaderImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/AbstractMDRModelImplementationTestCase.java
   branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestReadCompressedFilesAndHref.java
   branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java
   branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/UmlFactory.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.classpath
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.project
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.core.prefs
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.ui.prefs
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
   branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
   branches/BRANCH_0_30_x/www/index.html

Log:
Merged the rest of the revisions (18178:18283) from trunk.

Modified: branches/BRANCH_0_30_x/modules/dev/ArgoUML dev.launch
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/modules/dev/ArgoUML%20dev.launch?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/modules/dev/ArgoUML dev.launch	(original)
+++ branches/BRANCH_0_30_x/modules/dev/ArgoUML dev.launch	2010-04-18 11:31:50-0700
@@ -37,5 +37,5 @@
 <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>

 <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.argouml.application.Main"/>

 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="argouml-module-dev"/>

-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512M -ea -Dlog4j.configuration=org/argouml/resource/full_console.lcf -Dargouml.modules=org.argouml.sequence2.SequenceDiagramModule;org.argouml.dev.DeveloperModule;org.argouml.core.propertypanels.module.XmlPropertyPanelsModule"/>

+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx512M -ea -Dlog4j.configuration=org/argouml/resource/fullmdr_console.lcf -Dargouml.modules=org.argouml.sequence2.SequenceDiagramModule;org.argouml.dev.DeveloperModule;org.argouml.core.propertypanels.module.XmlPropertyPanelsModule"/>

 </launchConfiguration>


Modified: branches/BRANCH_0_30_x/src/argouml-app/build.xml
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/build.xml?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/build.xml	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/build.xml	2010-04-18 11:31:50-0700
@@ -503,7 +503,7 @@
     <junit errorproperty="junit.failure" failureproperty="junit.failure" 
            fork="yes" dir="${basedir}" forkmode="perTest"
            haltonfailure="false"
-           maxmemory="48M" printsummary="${junit.printsummary}">
+           maxmemory="160M" printsummary="${junit.printsummary}">
       <sysproperty key="test.model.uml" 
             value="../argouml-core-model-mdr/src/org/argouml/model/mdr/mof/01-02-15.xml"/>
       <sysproperty key="argouml.model.implementation" 

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/notation/providers/uml/NotationUtilityUml.java	2010-04-18 11:31:50-0700
@@ -52,7 +52,6 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.kernel.ProjectSettings;
 import org.argouml.model.Model;
-import org.argouml.notation.NotationProvider;
 import org.argouml.uml.StereotypeUtility;
 import org.argouml.util.CustomSeparator;
 import org.argouml.util.MyTokenizer;

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/Profile.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/Profile.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/Profile.java	2010-04-18 11:31:50-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2007,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    maurelio1234 - Initial implementation
+ *    Tom Morris
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -38,17 +39,23 @@
 
 package org.argouml.profile;
 
-import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
 import org.argouml.cognitive.Critic;
 
 /**
- * Abstract class representing a Profile. It contains default types and
+ * Abstract class representing an ArgoUML Profile. It contains default types and
  * presentation characteristics that can be tailored to various modeling
  * environments.
+ * <p>
+ * An ArgoUML Profile consists of:<ul>
+ * <li>a UML profile (a special type of UML Model)
+ * <li>a set of ArgoUML Critics
+ * <li>a set of default types for parameters, etc
+ * <li>presentation characteristics for ...
  * 
  * @author maurelio1234
  */
@@ -143,10 +150,22 @@
      * @throws ProfileException if failed to get profile.
      */
     public Collection getProfilePackages() throws ProfileException {
-        return new ArrayList();
+        return Collections.emptyList();
     }
 
     /**
+     * Get just those top level profile packages which have been loaded into the
+     * model repository. Primarily for internal use. Applications should use
+     * {@link #getProfilePackages()}.
+     * 
+     * @return collection of top level UML profile packages.
+     * @throws ProfileException if failed to get profile.
+     */
+    public Collection getLoadedPackages() throws ProfileException {
+        return getProfilePackages();
+    }
+    
+    /**
      * @return the display name
      */
     @Override

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/ProfileFacade.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/ProfileFacade.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/ProfileFacade.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/ProfileFacade.java	2010-04-18 11:31:50-0700
@@ -1,13 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2007,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    maurelio1234 - initial implementation
+ *    Tom Morris
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -38,7 +39,9 @@
 
 package org.argouml.profile;
 
+import org.apache.log4j.Logger;
 import org.argouml.kernel.ProfileConfiguration;
+import org.argouml.model.InvalidElementException;
 
 /**
  * The <a href="http://en.wikipedia.org/wiki/Facade_pattern">Facade</a> of the 
@@ -50,6 +53,8 @@
  * @since 0.25.4
  */
 public class ProfileFacade {
+    
+    private static final Logger LOG = Logger.getLogger(ProfileFacade.class);
 
     /**
      * Register a profile in the {@link ProfileManager}.
@@ -89,7 +94,28 @@
         manager = profileManager;
     }
 
-    static void reset() {
+    /**
+     * Remove all registered profiles.
+     */
+    static void removeAllProfiles() {
+        if (manager != null) {
+            Profile[] profiles = manager.getRegisteredProfiles().toArray(
+                    new Profile[0]);
+            for (Profile p : profiles) {
+                try {
+                    manager.removeProfile(p);
+                } catch (InvalidElementException e) {
+                    LOG.debug("Attempted to delete extent twice in removeAllProfiles " + p);
+                }
+            }
+        }
+    }
+    
+    /**
+     * Reset profile subsystem to initial state (primarily for testing).
+     */
+    public static void reset() {
+        removeAllProfiles();
         manager = null;
     }
 

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/URLModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/URLModelLoader.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/URLModelLoader.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/URLModelLoader.java	2010-04-18 11:31:50-0700
@@ -58,10 +58,15 @@
 public class URLModelLoader implements ProfileModelLoader {
 
     /**
+     * Load a profile from a URL.  If a profile with the same public ID has 
+     * already been loaded, its contents are returned instead of loading the
+     * new profile.
+     * 
      * @param url the url/system id to load
      * @param publicId the publicId for which the model will be known - must be
      *                equal in different machines in order to be possible to
-     *                load the model.
+     *                load the model.  If a profile with this public ID has 
+     *                already been loaded, it is returned instead.
      * @return a collection of top level elements in the profile (usually a
      *         single package stereotyped <<profile>>
      * @throws ProfileException if the XMIReader couldn't read the profile
@@ -71,29 +76,33 @@
         if (url == null) {
             throw new ProfileException("Null profile URL");
         }
-        ZipInputStream zis = null;
-        try {
-            Collection elements = null;
-            XmiReader xmiReader = Model.getXmiReader();
-            if (url.getPath().toLowerCase().endsWith(".zip")) {
-                zis = new ZipInputStream(url.openStream());
-                ZipEntry entry = zis.getNextEntry();
-                // TODO: check if it's OK to just get the first zip entry
-                // since the zip file should contain only one xmi file - thn
-                if (entry != null) {
-                    url = makeZipEntryUrl(url, entry.getName());
+        
+        Collection elements = 
+            Model.getUmlFactory().getExtentPackages(publicId.toExternalForm());
+        if (elements == null) {
+            ZipInputStream zis = null;
+            try {
+                XmiReader xmiReader = Model.getXmiReader();
+                if (url.getPath().toLowerCase().endsWith(".zip")) {
+                    zis = new ZipInputStream(url.openStream());
+                    ZipEntry entry = zis.getNextEntry();
+                    // TODO: check if it's OK to just get the first zip entry
+                    // since the zip file should contain only one xmi file - thn
+                    if (entry != null) {
+                        url = makeZipEntryUrl(url, entry.getName());
+                    }
+                    zis.close();
                 }
-                zis.close();
+                InputSource inputSource = new InputSource(url.toExternalForm());
+                inputSource.setPublicId(publicId.toString());
+                elements = xmiReader.parse(inputSource, true);
+            } catch (UmlException e) {
+                throw new ProfileException("Error loading profile XMI file ", e);
+            } catch (IOException e) {
+                throw new ProfileException("I/O error loading profile XMI ", e);
             }
-            InputSource inputSource = new InputSource(url.toExternalForm());
-            inputSource.setPublicId(publicId.toString());
-            elements = xmiReader.parse(inputSource, true);
-            return elements;
-        } catch (UmlException e) {
-            throw new ProfileException("Error loading profile XMI file ", e);
-        } catch (IOException e) {
-            throw new ProfileException("I/O error loading profile XMI ", e);
         }
+        return elements;
     }
 
     /**

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/UserDefinedProfile.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2007,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    maurelio1234 - Initial implementation
  *    thn
  *    euluis
  *****************************************************************************
@@ -48,6 +49,7 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -84,11 +86,17 @@
 
     private File modelFile;
 
-    private Collection profilePackages;
+    private Collection profilePackages = null;
 
     private UserDefinedFigNodeStrategy figNodeStrategy 
         = new UserDefinedFigNodeStrategy();
 
+    private ProfileReference reference;
+    
+    private ProfileManager profileManager;
+
+    private boolean criticsLoaded = false;
+
     private class UserDefinedFigNodeStrategy implements FigNodeStrategy {
 
         private Map<String, Image> images = new HashMap<String, Image>();
@@ -117,7 +125,7 @@
         private int length;
 
         /**
-         * @return if this descriptor ir valid
+         * @return if this descriptor is valid
          */
         public boolean isValid() {
             return stereotype != null && src != null && length > 0;
@@ -137,16 +145,13 @@
         LOG.info("load " + file);
         displayName = file.getName();
         modelFile = file;
-        ProfileReference reference = null;
         try {
             reference = new UserProfileReference(file.getPath());
         } catch (MalformedURLException e) {
             throw new ProfileException(
                     "Failed to create the ProfileReference.", e);
         }
-        profilePackages = new FileModelLoader().loadModel(reference);
-
-        finishLoading(manager);
+        profileManager = manager;
     }
 
     /**
@@ -226,10 +231,8 @@
     public UserDefinedProfile(URL url, ProfileManager manager)
             throws ProfileException {
         LOG.info("load " + url);
-        ProfileReference reference = null;
         reference = new UserProfileReference(url.getPath(), url);
-        profilePackages = new URLModelLoader().loadModel(reference);
-        finishLoading(manager);
+        profileManager = manager;
     }
 
     /**
@@ -247,7 +250,9 @@
     }
 
     /**
-     * A constructor that reads a file from an URL associated with some profiles
+     * A constructor that reads a file from an URL associated with some 
+     * profiles.  Designed for use with URLs which represent entries in a 
+     * JAR or Zip file.
      * 
      * @param dn the display name of the profile
      * @param url the URL of the profile mode
@@ -263,21 +268,14 @@
         LOG.info("load " + url);
 
         this.displayName = dn;
-        if (url != null) {
-            ProfileReference reference = null;
-            reference = new UserProfileReference(url.getPath(), url);
-            profilePackages = new URLModelLoader().loadModel(reference);
-        } else {
-            profilePackages = new ArrayList(0);
-        }
+        reference = new UserProfileReference(url.getPath(), url);
 
         this.setCritics(critics);
 
         for (String profileID : dependencies) {
             addProfileDependency(profileID);
         }
-
-        finishLoading(manager);
+		profileManager = manager;
     }
 
     /**
@@ -311,61 +309,97 @@
      * @param manager the profile manager which will be used to resolve
      *        dependencies
      */
-    private void finishLoading(ProfileManager manager) {
-        Collection packagesInProfile = filterPackages();
-        
-        for (Object obj : packagesInProfile) {
-            // if there is only one package in the model, we should suppose it's
-            // the profile model, if there is more than one, we take the ones
-            // marked as <<profile>>
-            if (Model.getFacade().isAModelElement(obj)
-                    && (Model.getFacade().isAProfile(obj)
-                            || (packagesInProfile.size() == 1))) {
-
-                // load profile name
-                String name = Model.getFacade().getName(obj);
-                if (name != null) {
-                    displayName = name;
+    private void loadModel() {
+        if (profilePackages == null) {
+            try {
+                if (modelFile != null) {
+                    profilePackages = new FileModelLoader().loadModel(reference);
                 } else {
-                    if (displayName == null) {
-                        displayName = Translator
-                                .localize("misc.profile.unnamed");
-                    }
+                    profilePackages = new URLModelLoader().loadModel(reference);                    
                 }
-                LOG.info("profile " + displayName);
+            } catch (ProfileException e1) {
+                LOG.error("Exception loading profile " + reference.getPath(), 
+                        e1);
+                return;
+            }
 
-                if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
-                    // load profile dependencies
-                    String dependencyListStr = Model.getFacade()
-                            .getTaggedValueValue(obj, "Dependency");
-                    StringTokenizer st = new StringTokenizer(dependencyListStr,
-                            " ,;:");
-
-                    String dependencyName = null;
-
-                    while (st.hasMoreTokens()) {
-                        dependencyName = st.nextToken();
-                        if (dependencyName != null) {
-                            LOG.debug("Adding dependency " + dependencyName);
-                            Profile profile =
-                                manager.lookForRegisteredProfile(
-                                    dependencyName);
-                            if (profile != null) {
-                                addProfileDependency(profile);
-                            } else {
-                                LOG.warn("The profile \"" + displayName
-                                    + "\" has a dependency named \""
-                                    + dependencyName
-                                    + "\" which isn't solvable.");
-                            }
+            Collection packagesInProfile = filterPackages(profilePackages);
+
+            for (Object obj : packagesInProfile) {
+                // if there is only one package in the model, we should suppose it's
+                // the profile model, if there is more than one, we take the ones
+                // marked as <<profile>>
+                if (Model.getFacade().isAModelElement(obj)
+                        && (Model.getFacade().isAProfile(obj)
+                                || (packagesInProfile.size() == 1))) {
+
+                    // load profile name
+                    String name = Model.getFacade().getName(obj);
+                    if (name != null) {
+                        displayName = name;
+                    } else {
+                        if (displayName == null) {
+                            displayName = Translator
+                                    .localize("misc.profile.unnamed");
                         }
                     }
+                    LOG.info("profile " + displayName);
+
+                    loadDependentProfiles(obj);
+                }
+            }
+
+            loadFigNodes(packagesInProfile);
+        }
+    }
+
+
+    private void loadDependentProfiles(Object obj) {
+        if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
+            loadDependentProfilesUml1(obj);
+        }
+        // TODO: profile dependencies for UML2
+    }
+
+
+    /**
+     * For ArgoUML UML 1.4 profiles dependencies are encoded as a list of 
+     * profile names in the TaggedValue named "Dependency" on the profile pkg.
+     * 
+     * @param pkg profile package
+     */
+    private void loadDependentProfilesUml1(Object pkg) {
+        // load profile dependencies
+        String dependencyListStr = Model.getFacade().getTaggedValueValue(pkg,
+                "Dependency");
+        StringTokenizer st = new StringTokenizer(dependencyListStr, " ,;:");
+
+        String dependencyName = null;
+
+        while (st.hasMoreTokens()) {
+            dependencyName = st.nextToken();
+            if (dependencyName != null) {
+                LOG.debug("Adding dependency " + dependencyName);
+                Profile profile = profileManager
+                        .lookForRegisteredProfile(dependencyName);
+                if (profile != null) {
+                    addProfileDependency(profile);
+                } else {
+                    LOG.warn("The profile \"" + displayName
+                            + "\" has a dependency named \"" + dependencyName
+                            + "\" which isn't solvable.");
                 }
-                // TODO: profile dependencies for UML2
             }
         }
+    }
 
-        // load fig nodes
+
+    /**
+     * Load FigNodes from profile packages.
+     * 
+     * @param packagesInProfile
+     */
+    private void loadFigNodes(Collection packagesInProfile) {
         Collection allStereotypes = Model.getExtensionMechanismsHelper()
                 .getStereotypes(packagesInProfile);
         for (Object stereotype : allStereotypes) {
@@ -395,23 +429,32 @@
                 }
             }
         }
-
-        // load critiques
-        Set<Critic> myCritics = this.getCritics();         
-        myCritics.addAll(getAllCritiquesInModel());
-        this.setCritics(myCritics);
     }
 
+    @Override
+    public Set<Critic> getCritics() {
+        if (!criticsLoaded ) {
+            Set<Critic> myCritics = super.getCritics();         
+            myCritics.addAll(getAllCritiquesInModel());
+            this.setCritics(myCritics);        
+            criticsLoaded = true;
+        }
+        return super.getCritics();
+    }
+    
     /**
      * @return the packages in the <code>profilePackages</code>
      */
-    private Collection filterPackages() {
+    private Collection filterPackages(Collection packages) {
         Collection ret = new ArrayList();
-        for (Object object : profilePackages) {
+        
+        // TODO: All this profile loading/handling needs to move someplace in model subsystem probably
+        
+        for (Object object: packages) {
             if (Model.getFacade().isAPackage(object)) {
                 if (Model.getFacade().isAProfile(object)) {
                     object = Model.getExtensionMechanismsHelper()
-                        .makeProfileApplicable(object);
+                            .makeProfileApplicable(object);
                 }
                 ret.add(object);
             }
@@ -606,10 +649,11 @@
         return decision;
     }
 
+    // TODO: Is this (critics embedded in comments) actually used by anyone?
     private List<CrOCL> getAllCritiquesInModel() {
         List<CrOCL> ret = new ArrayList<CrOCL>();
 
-        Collection<Object> comments = getAllCommentsInModel(profilePackages);
+        Collection<Object> comments = getAllCommentsInModel(getProfilePackages());
 
         for (Object comment : comments) {
             if (Model.getExtensionMechanismsHelper().hasStereotype(comment,
@@ -645,6 +689,9 @@
      * @return the string that should represent this profile in the GUI.
      */
     public String getDisplayName() {
+        // TODO: Seems like overkill to load the model just to get the display
+        // name, but that's where it's stored currently - tfm
+        loadModel();
         return displayName;
     }
 
@@ -686,9 +733,19 @@
 
     @Override
     public Collection getProfilePackages() {
+        loadModel();
         return profilePackages;
     }
-
+    
+    @Override
+    public Collection getLoadedPackages() {
+        if (profilePackages == null) {
+            return Collections.emptySet();
+        } else {
+            return Collections.unmodifiableCollection(profilePackages);
+        }
+    }
+    
     private FigNodeDescriptor loadImage(String stereotype, File f)
         throws IOException {
         FigNodeDescriptor descriptor = new FigNodeDescriptor();

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/init/InitProfileSubsystem.java	2010-04-18 11:31:50-0700
@@ -60,6 +60,7 @@
 //            ProfileFacade.setManager(
 //                    new org.argouml.profile.internal.ProfileManagerImpl());
 //        }
+        ProfileFacade.reset();
         ProfileFacade.setManager(
                 new org.argouml.profile.internal.ProfileManagerImpl());
 

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileManagerImpl.java	2010-04-18 11:31:50-0700
@@ -302,7 +302,7 @@
             defaultProfiles.remove(p);
         }
         try {
-            Collection packages = p.getProfilePackages();
+            Collection packages = p.getLoadedPackages();
             if (packages != null && !packages.isEmpty()) {
                 // We assume profile is contained in a single extent
                 Model.getUmlFactory().deleteExtent(packages.iterator().next());

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileMeta.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2008,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    maas - Initial implementation
  *    tfmorris
  *****************************************************************************
  *
@@ -41,9 +42,11 @@
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.log4j.Logger;
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.model.Model;
@@ -64,9 +67,14 @@
  */
 public class ProfileMeta extends Profile {
 
+    private static final Logger LOG = Logger.getLogger(ProfileMeta.class);
+    
     private static final String PROFILE_FILE = "metaprofile.xmi";
-
-    private Collection model;
+    private ProfileReference profileReference = null;
+    
+    private Collection model = null;
+    
+    Set<Critic> critics = null;
 
     /**
      * Creates a new instance of this profile
@@ -75,26 +83,34 @@
      */
     @SuppressWarnings("unchecked")
     public ProfileMeta() throws ProfileException {
-        ProfileModelLoader profileModelLoader = new ResourceModelLoader();
-        ProfileReference profileReference = null;
+        super();
         try {
             profileReference = new CoreProfileReference(PROFILE_FILE);
         } catch (MalformedURLException e) {
             throw new ProfileException(
                     "Exception while creating profile reference.", e);
         }
-        model = profileModelLoader.loadModel(profileReference);
+    }
 
+    private Collection getModel() {
         if (model == null) {
-            model = new ArrayList();
-            model.add(Model.getModelManagementFactory().createModel());
+            ProfileModelLoader profileModelLoader = new ResourceModelLoader();
+            try {
+                model = profileModelLoader.loadModel(profileReference);
+            } catch (ProfileException e) {
+                LOG.error("Exception loading metaprofile " + PROFILE_FILE, e);
+            }
+
+            if (model == null) {
+                model = new ArrayList();
+                model.add(Model.getModelManagementFactory().createModel());
+            }
         }
-
-        loadWellFormednessRules();
+        return model;
     }
 
     private void loadWellFormednessRules() {
-        Set<Critic> critics = new HashSet<Critic>();
+        critics = new HashSet<Critic>();
                 
         try {
             critics.add(new CrOCL("context ModelElement inv: "
@@ -158,7 +174,25 @@
 
     @Override
     public Collection getProfilePackages() throws ProfileException {
-        return model;
+        return Collections.unmodifiableCollection(getModel());
     }
 
+
+    @Override
+    public Collection<Object> getLoadedPackages() {
+        if (model == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableCollection(model);
+        }
+    }
+    
+    @Override
+    public Set<Critic> getCritics() {
+        if (critics == null) {
+            loadWellFormednessRules();
+        }
+        return super.getCritics();
+    }
+    
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/profile/internal/ProfileUML.java	2010-04-18 11:31:50-0700
@@ -1,13 +1,15 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2008,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    maurelio1234 - Initial implementation
  *    thn
+ *    Tom Morris - lazy loading
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -41,9 +43,11 @@
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.log4j.Logger;
 import org.argouml.cognitive.Critic;
 import org.argouml.cognitive.ToDoItem;
 import org.argouml.cognitive.Translator;
@@ -98,6 +102,8 @@
  */
 public class ProfileUML extends Profile {
     
+    private static final Logger LOG = Logger.getLogger(ProfileUML.class);
+    
     private static final String PROFILE_UML14_FILE = "default-uml14.xmi";
     private static final String PROFILE_UML22_FILE = "default-uml22.xmi";
 
@@ -107,7 +113,11 @@
     private FormatingStrategy formatingStrategy;
     private ProfileModelLoader profileModelLoader;
     private Collection model;
-        
+    
+    private Set<Critic> critics = null;
+
+    private ProfileReference profileReference = null;
+
     /**
      * Construct a Profile for UML modeling. 
      * @throws ProfileException 
@@ -115,8 +125,6 @@
     @SuppressWarnings("unchecked")
     ProfileUML() throws ProfileException {
         formatingStrategy = new FormatingStrategyUML();
-        profileModelLoader = new ResourceModelLoader();
-        ProfileReference profileReference = null;
         try {
             if (Model.getFacade().getUmlVersion().charAt(0) == '1') {
                 profileReference =
@@ -131,22 +139,31 @@
             throw new ProfileException(
                 "Exception while creating profile reference.", e);
         }
-        model = profileModelLoader.loadModel(profileReference);
+    }
 
+    private Collection getModel() {
         if (model == null) {
-            model = new ArrayList();
-            model.add(Model.getModelManagementFactory().createProfile());
-        }
-        
-        for (Object p : model) {
-            Model.getExtensionMechanismsHelper().makeProfileApplicable(p);
+            profileModelLoader = new ResourceModelLoader();
+            try {
+                model = profileModelLoader.loadModel(profileReference);
+           } catch (ProfileException e) {
+                LOG.error("Error loading UML profile", e);
+            }
+
+            if (model == null) {
+                model = new ArrayList();
+                model.add(Model.getModelManagementFactory().createProfile());
+            }
+
+            for (Object p : model) {
+                Model.getExtensionMechanismsHelper().makeProfileApplicable(p);
+            }
         }
-        
-        loadWellFormednessRules();
+        return model;
     }
 
     private void loadWellFormednessRules() {
-        Set<Critic> critics = new HashSet<Critic>();
+        critics = new HashSet<Critic>();
         
         critics.add(new CrAssocNameConflict());
         critics.add(new CrAttrNameConflict());
@@ -456,14 +473,32 @@
 
 
     @Override
+    public Set<Critic> getCritics() {
+        if (critics == null) {
+            loadWellFormednessRules();
+        }
+        return super.getCritics();
+    }
+    
+    @Override
     public Collection getProfilePackages() {
-        return model;
+        return Collections.unmodifiableCollection(getModel());
     }
     
 
     @Override
+    public Collection<Object> getLoadedPackages() {
+        if (model == null) {
+            return Collections.emptyList();
+        } else {
+            return Collections.unmodifiableCollection(model);
+        }
+    }
+
+    @Override
     public DefaultTypeStrategy getDefaultTypeStrategy() {
         return new DefaultTypeStrategy() {
+            private Collection model = getModel();
             public Object getDefaultAttributeType() {
                 return ModelUtils.findTypeInModel("Integer", model.iterator()
                         .next());

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectBrowser.java	2010-04-18 11:31:50-0700
@@ -974,7 +974,7 @@
      * If a save is required then prompt the user if they wish to,
      * save and exit, exit without saving or cancel the exit operation.
      */
-    public void tryExit() {
+    public boolean tryExit() {
         LOG.info("Trying to exit the application");
         if (saveAction != null && saveAction.isEnabled()) {
             LOG.info("A save is needed - prompting the user");
@@ -997,14 +997,15 @@
                         && ProjectManager.getManager().getCurrentProject()
                                 .getURI() != null,
                                 false, true);
-                return;
+                return false;
             } else if (response == JOptionPane.CANCEL_OPTION) {
                 LOG.info("The user cancelled the save dialog");
-                return;
+                return false;
             }
         }
         LOG.info("We will now exit");
         exit();
+        return true;
     }
     
     

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/ProjectSettingsTabProfile.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2007-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Marcos Aurelio - design and initial implementation
  *    thn
  *    euluis
  *****************************************************************************
@@ -48,6 +49,7 @@
 import java.awt.event.ItemListener;
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 import javax.swing.BoxLayout;
@@ -244,6 +246,7 @@
     private JList createProfileList() {
         JList list = new JList();
         list.setMinimumSize(new Dimension(50, 50));
+        // TODO: Add double click listener 
         return list;
     }
     private void refreshLists() {
@@ -282,9 +285,9 @@
             ((MutableComboBoxModel) usedList.getModel());
 
         if (arg0.getSource() == addButton) {
-            if (availableList.getSelectedIndex() != -1) {
-                Profile selected = (Profile) modelAvailable
-                        .getElementAt(availableList.getSelectedIndex());
+            Object[] selections = availableList.getSelectedValues();
+            for (Object s : selections) {
+                Profile selected = (Profile) s;
                 modelUsed.addElement(selected);
                 modelAvailable.removeElement(selected);
 
@@ -294,11 +297,10 @@
                 }
             }
         } else if (arg0.getSource() == removeButton) {
-            if (usedList.getSelectedIndex() != -1) {
-                Profile selected = (Profile) modelUsed.getElementAt(usedList
-                        .getSelectedIndex());
-
-                List<Profile> dependents = getActiveDependents(selected);
+            Object[] selections = usedList.getSelectedValues();
+            for (Object s : selections) {
+                Profile selected = (Profile) s;
+                Collection<Profile> dependents = getActiveDependents(selected);
                 boolean remove = true;
 
                 if (!dependents.isEmpty()) {
@@ -340,9 +342,9 @@
                 }
             }
         } else if (arg0.getSource() == unregisterProfile) {
-            if (availableList.getSelectedIndex() != -1) {
-                Profile selected = (Profile) modelAvailable
-                        .getElementAt(availableList.getSelectedIndex());
+            Object[] selections = availableList.getSelectedValues();
+            for (Object s : selections) {
+                Profile selected = (Profile) s;
                 if (selected instanceof UserDefinedProfile) {
                     ProfileFacade.getManager().removeProfile(selected);
                     modelAvailable.removeElement(selected);

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/SettingsTabProfile.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+ * Copyright (c) 2007-2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Marcos Aur�lio - Design and initial implementation
  *    thn
  *    euluis
  *****************************************************************************
@@ -49,6 +50,7 @@
 import java.awt.event.ItemListener;
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 import javax.swing.BoxLayout;
@@ -343,17 +345,16 @@
                 .getModel());
 
         if (arg0.getSource() == addButton) {
-            if (availableList.getSelectedIndex() != -1) {
-                Profile selected = (Profile) modelAvl
-                        .getElementAt(availableList.getSelectedIndex());
+            Object[] selections = availableList.getSelectedValues();
+            for (Object s : selections) {
+                Profile selected = (Profile) s;
                 modelUsd.addElement(selected);
                 modelAvl.removeElement(selected);
             }
         } else if (arg0.getSource() == removeButton) {
-            if (defaultList.getSelectedIndex() != -1) {
-                Profile selected = (Profile) modelUsd.getElementAt(defaultList
-                        .getSelectedIndex());
-                
+            Object[] selections = defaultList.getSelectedValues();
+            for (Object s : selections) {
+                Profile selected = (Profile) s;
                 if (selected == ProfileFacade.getManager().getUMLProfile()
                         && Model.getFacade().getUmlVersion().charAt(0) != '1') {
                     JOptionPane.showMessageDialog(this, Translator
@@ -389,10 +390,11 @@
             }
 
         } else if (arg0.getSource() == removeDirectory) {
-            if (directoryList.getSelectedIndex() != -1) {
-                int idx = directoryList.getSelectedIndex();
-                ((MutableComboBoxModel) directoryList.getModel())
-                        .removeElementAt(idx);
+            MutableComboBoxModel model = 
+                ((MutableComboBoxModel) directoryList.getModel()); 
+            Object[] selections = directoryList.getSelectedValues();
+            for (Object o : selections) {
+                model.removeElement(o);
             }
         } else if (arg0.getSource() == refreshProfiles) {
             boolean refresh = JOptionPane.showConfirmDialog(this, Translator
@@ -424,18 +426,34 @@
             if (ret == JFileChooser.APPROVE_OPTION) {
                 File file = fileChooser.getSelectedFile();
 
-                String path = file.getAbsolutePath();
-
-                ((MutableComboBoxModel) directoryList.getModel())
-                        .addElement(path);
+                // find and add all subdirectories
+                Collection<File> dirs = new ArrayList<File>();
+                collectSubdirs(file, dirs);
+                
+                MutableComboBoxModel cbModel = 
+                    ((MutableComboBoxModel) directoryList.getModel());
+                for (File dir : dirs) {
+                    cbModel.addElement(dir.getAbsolutePath());
+                }
             }
-
         }
 
         availableList.validate();
         defaultList.validate();
     }
 
+    private void collectSubdirs(File file, Collection<File> subdirs) {
+        subdirs.add(file);
+        File[] files = file.listFiles();
+        if (files != null) {
+            for (File f : files) {
+                if (f.isDirectory() & !f.isHidden()) {
+                    collectSubdirs(f, subdirs);
+                }
+            }
+        }
+    }
+
     /**
      * @return the internationalization key that containing the name of this tab
      * @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()
@@ -452,9 +470,6 @@
         return this;
     }
 
-
-
-
     public void handleResetToDefault() {
         if (!initialized) {
             buildPanel();
@@ -463,7 +478,6 @@
     }
 
     public void handleSettingsTabCancel() {
-
     }
 
     public void handleSettingsTabRefresh() {

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/ui/cmd/GenericArgoMenuBar.java	2010-04-18 11:31:50-0700
@@ -1174,9 +1174,9 @@
     /**
      * Internal use only.  Do not use.
      */
-    public void macQuit() {
+    public boolean macQuit() {
         LOG.info("Quit has been chosen on a Mac");
-        exitAction.actionPerformed(null);
+        return ProjectBrowser.getInstance().tryExit();
     }
     
     /**

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileCodeGeneration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileCodeGeneration.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileCodeGeneration.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileCodeGeneration.java	2010-04-18 11:31:50-0700
@@ -53,7 +53,7 @@
  */
 public class ProfileCodeGeneration extends Profile {
 
-    private Set<Critic>  critics = new HashSet<Critic>();
+    private Set<Critic>  critics = null;
 
     private static Critic crMissingClassName;
     
@@ -86,9 +86,14 @@
      * @param profileGoodPractices the instance of the required profile 
      */
     public ProfileCodeGeneration(ProfileGoodPractices profileGoodPractices) {
-        
         crMissingClassName = profileGoodPractices.getCrMissingClassName();
+        addProfileDependency("GoodPractices");
+    }
 
+    private void loadCritics() {
+
+        critics = new HashSet<Critic>();
+        
         crCompoundConstructorNeeded = new CompoundCritic(
                 crMissingClassName, new CrConstructorNeeded());
 
@@ -133,8 +138,14 @@
         critics.add(noTrans2);                                  
         
         this.setCritics(critics);
-        
-        addProfileDependency("GoodPractices");
+    }
+    
+    @Override
+    public Set<Critic> getCritics() {
+        if (critics == null) {
+            loadCritics();
+        }
+        return super.getCritics();
     }
     
     @Override

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileGoodPractices.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileGoodPractices.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileGoodPractices.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/cognitive/critics/ProfileGoodPractices.java	2010-04-18 11:31:50-0700
@@ -52,16 +52,20 @@
  */
 public class ProfileGoodPractices extends Profile {
 
-    private Set<Critic>  critics = new HashSet<Critic>();
+    private Set<Critic>  critics = null;
 
     private CrMissingClassName crMissingClassName = new CrMissingClassName();
-    
+
     /**
      * Default Constructor 
      */
     public ProfileGoodPractices() {
-        
+        super();
+    }
+
+    private void loadCritics() {
         // general
+        critics = new HashSet<Critic>();
         critics.add(new CrEmptyPackage());
         critics.add(new CrNodesOverlap());
         critics.add(new CrZeroLengthEdge());
@@ -85,13 +89,20 @@
     }
     
     @Override
+    public Set<Critic> getCritics() {
+        if (critics == null ) {
+            loadCritics();
+        }
+        return super.getCritics();
+    }
+    
+    @Override
     public String getDisplayName() {
         return "Critics for Good Practices";
     }
 
-   /*
-    * @see org.argouml.profile.Profile#getProfileIdentifier()
-    */
+
+    @Override
     public String getProfileIdentifier() {
         return "GoodPractices";
     }

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/diagram/state/ui/UMLStateDiagram.java	2010-04-18 11:31:50-0700
@@ -59,13 +59,10 @@
 import org.argouml.uml.diagram.activity.ui.FigActionState;
 import org.argouml.uml.diagram.state.StateDiagramGraphModel;
 import org.argouml.uml.diagram.static_structure.ui.FigComment;
-import org.argouml.uml.diagram.static_structure.ui.FigPackage;
 import org.argouml.uml.diagram.ui.ActionSetMode;
 import org.argouml.uml.diagram.ui.FigNodeModelElement;
 import org.argouml.uml.diagram.ui.RadioAction;
 import org.argouml.uml.diagram.ui.UMLDiagram;
-import org.argouml.uml.diagram.use_case.ui.FigActor;
-import org.argouml.uml.diagram.use_case.ui.FigUseCase;
 import org.argouml.uml.ui.behavior.common_behavior.ActionNewActionSequence;
 import org.argouml.uml.ui.behavior.common_behavior.ActionNewCallAction;
 import org.argouml.uml.ui.behavior.common_behavior.ActionNewCreateAction;

Modified: branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/src/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	2010-04-18 11:31:50-0700
@@ -148,7 +148,7 @@
         return getSelectedItem();
     }
 
-    private Collection getApplicableTagDefinitions(Object element) {
+    Collection getApplicableTagDefinitions(Object element) {
         Set<List<String>> paths = new HashSet<List<String>>();
         Set<Object> availableTagDefs = 
             new TreeSet<Object>(new PathComparator());

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/kernel/TestProjectWithProfiles.java	2010-04-18 11:31:50-0700
@@ -83,21 +83,14 @@
     /*
      * @see junit.framework.TestCase#setUp()
      */
-    @SuppressWarnings("unchecked")
     @Override
     protected void setUp() throws Exception {
         super.setUp();
         InitializeModel.initializeMDR();
         new InitProfileSubsystem().init();
         
-        if (ApplicationVersion.getVersion() == null) {
-            Class argoVersionClass = 
-                Class.forName("org.argouml.application.ArgoVersion");
-            Method initMethod = argoVersionClass.getDeclaredMethod("init");
-            initMethod.setAccessible(true);
-            initMethod.invoke(null);
-            assertNotNull(ApplicationVersion.getVersion());
-        }
+        initAppVersion();
+        assertNotNull(ApplicationVersion.getVersion());
         String testCaseDirNamePrefix = getClass().getPackage().getName();
         testCaseDir = FileHelper.setUpDir4Test(testCaseDirNamePrefix);
     }
@@ -200,9 +193,7 @@
         // save the project into a new file
         File file = getFileInTestDir(
                 "testRemoveProfileWithModelThatRefersToProfile.zargo");
-        AbstractFilePersister persister = getProjectPersister(file);
-        project.setVersion(ApplicationVersion.getVersion());
-        persister.save(project, file);
+        AbstractFilePersister persister = saveProject(project, file);
         project.remove();
         
         // reopen the project and assert that the MetaProfile isn't part of 
@@ -294,9 +285,7 @@
         // save the project
         File file = getFileInTestDir(
             "testProjectWithUserDefinedProfilePersistency.zargo");
-        AbstractFilePersister persister = getProjectPersister(file);
-        project.setVersion(ApplicationVersion.getVersion());
-        persister.save(project, file);
+        AbstractFilePersister persister = saveProject(project, file);
         project.remove();
         
         // load the project
@@ -368,9 +357,7 @@
         Model.getCoreHelper().addStereotype(fooClass, stStereotype);
         // save the project
         File file = getFileInTestDir(testName + ".zargo");
-        AbstractFilePersister persister = getProjectPersister(file);
-        project.setVersion(ApplicationVersion.getVersion());
-        persister.save(project, file);
+        AbstractFilePersister persister = saveProject(project, file);
         // remove the user defined profile and the directory where it is
         profileManager.removeProfile(userDefinedProfile);
         profileManager.removeSearchPathDirectory(testCaseDir.getAbsolutePath());
@@ -390,13 +377,57 @@
         }
     }
 
-    private AbstractFilePersister getProjectPersister(File file) {
+    /**
+     * @param project the ArgoUML {@link Project} to save in file.
+     * @param file the {@link File} in which an ArgoUML {@link Project} will
+     * be persisted.
+     * @return the persister used and usable for file.
+     * @throws SaveException if saving the file goes wrong.
+     * @throws InterruptedException if an interrupt occurs while saving.
+     * TODO: move this to an helper class.
+     */
+    public static AbstractFilePersister saveProject(Project project, File file)
+        throws SaveException, InterruptedException {
+        AbstractFilePersister persister = getProjectPersister(file);
+        project.setVersion(ApplicationVersion.getVersion());
+        persister.save(project, file);
+        return persister;
+    }
+
+    /**
+     * Get an {@link AbstractFilePersister} for file.
+     *
+     * @param file the {@link File} in which an ArgoUML {@link Project} will
+     * be persisted.
+     * @return the appropriate persister for file or null if the file's
+     * extension doesn't match a supported persister.
+     * TODO: move this to an helper class.
+     */
+    public static AbstractFilePersister getProjectPersister(File file) {
         AbstractFilePersister persister = 
             PersistenceManager.getInstance().getPersisterFromFileName(
-                    file.getAbsolutePath());
+                file.getAbsolutePath());
         return persister;
     }
 
+    /**
+     * Initialize the ArgoUML application version, so that
+     * {@link ApplicationVersion#getVersion()} doesn't return null.
+     *
+     * @throws Exception if something goes wrong...
+     * TODO: move this to an helper class.
+     */
+    @SuppressWarnings("unchecked")
+    public static void initAppVersion() throws Exception {
+        if (ApplicationVersion.getVersion() == null) {
+            Class argoVersionClass = 
+                Class.forName("org.argouml.application.ArgoVersion");
+            Method initMethod = argoVersionClass.getDeclaredMethod("init");
+            initMethod.setAccessible(true);
+            initMethod.invoke(null);
+        }
+    }
+
     private File createUserProfileFile(File directory, String filename)
         throws IOException {
         ProfileMother mother = new ProfileMother();

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/model/TestModelEventPump.java	2010-04-18 11:31:50-0700
@@ -45,6 +45,7 @@
 
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -110,11 +111,12 @@
      */
     @Override
     protected void tearDown() throws Exception {
-        super.tearDown();
+        ProfileFacade.reset();
         if (elem != null) {
             Model.getUmlFactory().delete(elem);
         }
         listener = null;
+        super.tearDown();
     }
 
     /**

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestActionStateNotationUml.java	2010-04-18 11:31:50-0700
@@ -45,6 +45,7 @@
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.NotationSettings;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -91,6 +92,15 @@
         Model.getStateMachinesHelper().setContainer(aActionState, top);
     }
 
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * An extra setup method.
      */

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestAttributeAndOperationNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestAttributeAndOperationNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestAttributeAndOperationNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestAttributeAndOperationNotationUml.java	2010-04-18 11:31:50-0700
@@ -54,6 +54,7 @@
 import org.argouml.notation.NotationProvider;
 import org.argouml.notation.NotationSettings;
 import org.argouml.notation.providers.java.InitNotationJava;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -119,6 +120,9 @@
     private static final String NOPER09 = "name() : \'type\'";
     private static final String NOPER10 = "name() : (type)";
 
+    private Project project;
+    private Object model;
+    
     /**
      * The constructor.
      *
@@ -138,6 +142,17 @@
         (new InitNotation()).init();
         (new InitNotationUml()).init();
         (new InitNotationJava()).init();
+        project = ProjectManager.getManager().makeEmptyProject();
+        ProjectManager.getManager().setCurrentProject(project);
+        model = project.getUserDefinedModelList().iterator().next();
+    }
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
     }
 
     /**
@@ -148,10 +163,7 @@
     public void testAttributeName()
         throws ParseException {
         Object attr;
-
-        Project p = ProjectManager.getManager().getCurrentProject();
-        Object model = p.getModel();
-        Object attrType = p.getDefaultAttributeType();
+        Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
         Model.getCoreHelper().setNamespace(attr, model);
@@ -193,27 +205,25 @@
     public void testAttributeType() throws ParseException {
         Object attr;
 
-        Project project = ProjectManager.getManager().getCurrentProject();
-        Object ns = project.getModel();
         Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkType(attr, ATTR03, "void");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkType(attr, ATTR04, "int");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkType(attr, ATTR05, "int");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkType(attr, ATTR06, "int");
     }
@@ -228,11 +238,8 @@
     public void testAttributeNewTypeNamespace() throws ParseException {
         Object attr;
 
-        Project project = ProjectManager.getManager().getCurrentProject();
-        Object ns = project.getModel();
-        
         Object cl = Model.getCoreFactory().buildClass();
-        Model.getCoreHelper().setNamespace(cl, ns);
+        Model.getCoreHelper().setNamespace(cl, model);
         
         Object attrType = project.getDefaultAttributeType();
         attr = Model.getCoreFactory().buildAttribute2(cl, attrType);       
@@ -252,7 +259,7 @@
         assertNotNull("Namespace of the created type for the attribute must not be null",
                 namespace);
         assertEquals("The namespace of the created type is not the same than" +
-        		" the namespace of the original class.", ns, namespace);
+        		" the namespace of the original class.", model, namespace);
         
     }
 
@@ -264,44 +271,42 @@
     public void testAttributeVisibility() throws ParseException {
         Object attr;
 
-        Project project = ProjectManager.getManager().getCurrentProject();
-        Object ns = project.getModel();
         Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR02, "public");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR03, "private");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR04, "protected");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR05, "public");
         checkVisibility(attr, ATTR01, "public");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR06, "private");
         checkVisibility(attr, ATTR01, "private");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR08, "public");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkVisibility(attr, ATTR11, "public");
     }
@@ -324,23 +329,21 @@
             null,
         };
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object attrType = ProjectManager.getManager().getCurrentProject()
+        Object attrType = project
                 .getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkProperties(attr, ATTR04, res1);
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkProperties(attr, ATTR05, res2);
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkProperties(attr, ATTR06, res3);
     }
@@ -353,25 +356,22 @@
     public void testAttributeMultiplicity() throws ParseException {
         Object attr;
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object attrType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultAttributeType();
+        Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkMultiplicity(attr, ATTR04,
                 Model.getDataTypesFactory().createMultiplicity("1..1"));
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkMultiplicity(attr, ATTR05,
                 Model.getDataTypesFactory().createMultiplicity("1..*"));
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkMultiplicity(attr, ATTR06,
                 Model.getDataTypesFactory().createMultiplicity("*..*"));
@@ -383,13 +383,10 @@
     public void testAttributeParseExceptions() {
         Object attr;
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object attrType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultAttributeType();
+        Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkThrows(attr, NATTR01, true, false, false);
         checkThrows(attr, NATTR02, true, false, false);
@@ -414,45 +411,42 @@
     public void testAttributeValue() throws ParseException {
         Object attr;
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object attrType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultAttributeType();
+        Object attrType = project.getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR05, "0");
         checkValue(attr, ATTR01, "0");
         checkValue(attr, ATTR06, "15");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR07, "\'val[15] \'");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR08, "\"a <<string>>\"");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR09, "(a * (b+c) - d)");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR10, "2 * (b+c) - 10");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR11, "a[15]");
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkValue(attr, ATTR12, "a << 5");
     }
@@ -461,11 +455,8 @@
      * Add stereotype to a model element if it doesn't already have it.
      */
     private void softAddStereotype(String name, Object elem) {
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-
         for (Object s 
-                : Model.getExtensionMechanismsHelper().getStereotypes(ns)) {
+                : Model.getExtensionMechanismsHelper().getStereotypes(model)) {
             if (name.equals(Model.getFacade().getName(s))) {
                 return;
             }
@@ -473,7 +464,7 @@
         Model.getExtensionMechanismsFactory().buildStereotype(
             elem,
             name,
-            ns);
+            model);
     }
 
 
@@ -485,34 +476,32 @@
     public void testAttributeStereotype() throws ParseException {
         Object attr;
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object attrType = ProjectManager.getManager().getCurrentProject()
+        Object attrType = project
                 .getDefaultAttributeType();
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         softAddStereotype("attrstereo1", attr);
         softAddStereotype("attrstereo2", attr);
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkStereotype(attr, ATTR01, new String[] {});
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkStereotype(attr, ATTR10, new String[] {"attrstereo1"});
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkStereotype(attr, ATTR11, new String[] {"attrstereo2"});
 
         attr = Model.getCoreFactory().buildAttribute2(attrType);
-        Model.getCoreHelper().setNamespace(attr, ns);
+        Model.getCoreHelper().setNamespace(attr, model);
 
         checkStereotype(attr, ATTR13, new String[] {"attrstereo1",
                                                     "attrstereo2", });
@@ -528,11 +517,8 @@
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
 
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-
-        Model.getCoreHelper().setNamespace(cl, ns);
-        Object returnType = ProjectManager.getManager().getCurrentProject()
+        Model.getCoreHelper().setNamespace(cl, model);
+        Object returnType = project
                 .getDefaultReturnType();
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
@@ -554,11 +540,10 @@
     public void testOperationType() throws ParseException {
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns = ProjectManager.getManager().getCurrentProject().getModel();
-
-        Model.getCoreHelper().setNamespace(cl, ns);
+ 
+        Model.getCoreHelper().setNamespace(cl, model);
         Object returnType =
-            ProjectManager.getManager().getCurrentProject().findType("void");
+            project.findType("void");
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
         checkType(op, OPER01, "void");
@@ -580,10 +565,9 @@
     public void testOperationVisibility() throws ParseException {
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns = ProjectManager.getManager().getCurrentProject().getModel();
 
-        Model.getCoreHelper().setNamespace(cl, ns);
-        Object returnType = ProjectManager.getManager().getCurrentProject()
+        Model.getCoreHelper().setNamespace(cl, model);
+        Object returnType = project
                 .getDefaultReturnType();
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
@@ -608,13 +592,11 @@
      */
     public void testOperationParameters() throws ParseException {
         Object op;
+
+        Object returnType = project.getDefaultReturnType();
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
-        Object returnType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultReturnType();
 
-        Model.getCoreHelper().setNamespace(cl, ns);
+        Model.getCoreHelper().setNamespace(cl, model);
 
         String[] res1 = {
         };
@@ -651,12 +633,10 @@
      */
     public void testOperationProperties() throws ParseException {
         Object op;
+        Object returnType = project.getDefaultReturnType();
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns = ProjectManager.getManager().getCurrentProject().getModel();
-        Object returnType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultReturnType();
 
-        Model.getCoreHelper().setNamespace(cl, ns);
+        Model.getCoreHelper().setNamespace(cl, model);
 
         String[] res1 = {
             "abstract", null,
@@ -690,12 +670,9 @@
 
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
 
-        Model.getCoreHelper().setNamespace(cl, ns);
-        Object returnType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultReturnType();
+        Model.getCoreHelper().setNamespace(cl, model);
+        Object returnType = project.getDefaultReturnType();
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
         softAddStereotype("opstereo1", op);
@@ -719,12 +696,9 @@
     public void testOperationParseExceptions() {
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
-        Object ns =
-            ProjectManager.getManager().getCurrentProject().getModel();
 
-        Model.getCoreHelper().setNamespace(cl, ns);
-        Object returnType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultReturnType();
+        Model.getCoreHelper().setNamespace(cl, model);
+        Object returnType = project.getDefaultReturnType();
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
         checkThrows(op, NOPER01, true, false, false);
@@ -1083,11 +1057,8 @@
         Object op;
         Object cl = Model.getCoreFactory().buildClass();
 
-        Object ns = ProjectManager.getManager().getCurrentProject().getModel();
-
-        Model.getCoreHelper().setNamespace(cl, ns);
-        Object returnType = ProjectManager.getManager().getCurrentProject()
-                .getDefaultReturnType();
+        Model.getCoreHelper().setNamespace(cl, model);
+        Object returnType = project.getDefaultReturnType();
 
         op = Model.getCoreFactory().buildOperation(cl, returnType);
         

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestCallStateNotationUml.java	2010-04-18 11:31:50-0700
@@ -47,6 +47,7 @@
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.NotationSettings;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -100,6 +101,16 @@
         Model.getStateMachinesHelper().setContainer(aCallState, top);
     }
     
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
+    
     /**
      * An extra setup method.
      */

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestClassifierRoleNotationUml.java	2010-04-18 11:31:50-0700
@@ -44,8 +44,10 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -81,6 +83,15 @@
         InitializeModel.initializeDefault();
         new InitProfileSubsystem().init();
     }
+    
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
 
     /**
      * Test the name of the ClassifierRole.

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestEnumerationLiteralNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestEnumerationLiteralNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestEnumerationLiteralNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestEnumerationLiteralNotationUml.java	2010-04-18 11:31:50-0700
@@ -45,10 +45,12 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.InitNotation;
 import org.argouml.notation.NotationSettings;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -73,6 +75,9 @@
         (new InitProfileSubsystem()).init();
         (new InitNotation()).init();
         (new InitNotationUml()).init();
+        ProjectManager.getManager().setCurrentProject(
+                ProjectManager.getManager().makeEmptyProject());
+       
         Object model =
             Model.getModelManagementFactory().createModel();
         aEnumeration = Model.getCoreFactory().buildEnumeration("", model);
@@ -81,6 +86,15 @@
         npSettings = new NotationSettings();
     }
     
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * Test the resulting name after parsing the enumeration literal.
      * 
@@ -108,7 +122,7 @@
         checkName(aLiteral, "name;<<s2>>nameX", "name");
         checkLiterals(4, 
                 new String[] {"name", "nameX", "name4", "create second one"});
-        checkName(aLiteral, "µôèéà€ü$", "µôèéà€ü$");
+        checkName(aLiteral, "�������$", "�������$");
         checkName(aLiteral, "name;", "name");
         checkName(aLiteral, " \u00AB stereotype \u00BB name3", "name3");
         checkName(aLiteral, "name;\u00ABstereotype\u00BBname", "name");

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestMessageNotationUml.java	2010-04-18 11:31:50-0700
@@ -43,11 +43,13 @@
 
 import junit.framework.TestCase;
 
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
 import org.argouml.notation.InitNotation;
 import org.argouml.notation.NotationSettings;
 import org.argouml.notation.SDNotationSettings;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -87,7 +89,6 @@
     public void setUp() throws Exception {
 	super.setUp();
         InitializeModel.initializeDefault();
-//        new InitProfileSubsystem().init();
         assertTrue("Model subsystem init failed.", Model.isInitiated());
         (new InitProfileSubsystem()).init();
         (new InitNotation()).init();
@@ -96,6 +97,15 @@
         npSettings = new SDNotationSettings();
     }
 
+    
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     private void setupModel1() {
         pack = Model.getModelManagementFactory().buildPackage("p1");
         coll = Model.getCollaborationsFactory().buildCollaboration(pack);

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestStateBodyNotationUml.java	2010-04-18 11:31:50-0700
@@ -47,6 +47,7 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -89,6 +90,15 @@
             Model.getStateMachinesFactory().buildCompositeState(top);
     }
 
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * Test the parseStateBody() method: succesful creation.
      */

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/notation/providers/uml/TestTransitionNotationUml.java	2010-04-18 11:31:50-0700
@@ -48,6 +48,7 @@
 import org.argouml.model.Model;
 import org.argouml.notation.NotationProvider;
 import org.argouml.notation.NotationSettings;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
@@ -88,6 +89,13 @@
         aState = Model.getStateMachinesFactory().buildCompositeState(top);
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        ProjectManager.getManager().removeProject(
+                ProjectManager.getManager().getCurrentProject());
+        ProfileFacade.reset();
+        super.tearDown();
+    }
 
     /**
      * Test for the parseTransition() method.

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestProfileConfigurationFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestProfileConfigurationFilePersister.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestProfileConfigurationFilePersister.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestProfileConfigurationFilePersister.java	2010-04-18 11:31:50-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *    euluis
+ *    Tom Morris
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -60,12 +61,10 @@
 import org.argouml.model.Model;
 import org.argouml.model.UmlException;
 import org.argouml.model.XmiWriter;
-import org.argouml.profile.CoreProfileReference;
 import org.argouml.profile.FileModelLoader;
 import org.argouml.profile.Profile;
 import org.argouml.profile.ProfileException;
-import org.argouml.profile.ProfileModelLoader;
-import org.argouml.profile.ResourceModelLoader;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.UserProfileReference;
 import org.argouml.profile.init.InitProfileSubsystem;
 import org.argouml.profile.internal.ProfileUML;
@@ -86,6 +85,12 @@
         new InitProfileSubsystem().init();
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * Tests whether XmiWriterMDRImpl fails to write a profile 
      * (i.e., the file will contain no model) previously loaded from a file.
@@ -101,10 +106,8 @@
         throws ProfileException, FileNotFoundException, IOException, 
         UmlException {
         
-        ProfileModelLoader loader = new ResourceModelLoader();
-        Collection models = loader.loadModel(
-                new CoreProfileReference("default-uml14.xmi"));
-        Object umlModel = models.iterator().next();
+        Object umlModel = ProfileFacade.getManager().getUMLProfile()
+                .getProfilePackages().iterator().next();
         final String umlModelName = Model.getFacade().getName(umlModel);
         assertNotNull(umlModelName);
         File tempFile = File.createTempFile(umlModelName, ".xmi");

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestXmiFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestXmiFilePersister.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestXmiFilePersister.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestXmiFilePersister.java	2010-04-18 11:31:50-0700
@@ -49,6 +49,7 @@
 import org.argouml.model.Model;
 import org.argouml.model.XmiReferenceException;
 import org.argouml.profile.ProfileFacade;
+import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
  * Testclass for the XMIReader. Placeholder for all saving/loading tests
@@ -75,11 +76,14 @@
         if (!Model.isInitiated()) {
             InitializeModel.initializeMDR();
         }
-//        new InitProfileSubsystem().init();
-        // TODO: Why is this necessary? - tfm
-        // Always force reinitialization of Profile subsystem
-        ProfileFacade.setManager(
-                new org.argouml.profile.internal.ProfileManagerImpl());
+        new InitProfileSubsystem().init();
+    }
+    
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProfileFacade.reset();
+        super.tearDown();
     }
 
     /**
@@ -152,7 +156,6 @@
         
         persister = new XmiFilePersister();
         project = persister.doLoad(file);
-        ProjectManager.getManager().setCurrentProject(project);
         
         Object attType = checkFoo(project.findType("Foo", false));
 
@@ -178,6 +181,7 @@
      * @throws Exception if loading project fails
      */
     public void testLoadProject() throws Exception {
+        testSave(); // Create file
         File file = new File("test.xmi");
 
         XmiFilePersister persister = new XmiFilePersister();

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestZargoFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestZargoFilePersister.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestZargoFilePersister.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/persistence/TestZargoFilePersister.java	2010-04-18 11:31:50-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -53,6 +53,7 @@
 import org.argouml.notation.InitNotation;
 import org.argouml.notation.providers.java.InitNotationJava;
 import org.argouml.notation.providers.uml.InitNotationUml;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 import org.argouml.uml.diagram.activity.ui.InitActivityDiagram;
 import org.argouml.uml.diagram.collaboration.ui.InitCollaborationDiagram;
@@ -82,6 +83,13 @@
         (new InitUseCaseDiagram()).init();
         (new InitProfileSubsystem()).init();
     }
+    
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProfileFacade.reset();
+        super.tearDown();
+    }
 
     /**
      * The constructor.

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ProfileMother.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ProfileMother.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ProfileMother.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/ProfileMother.java	2010-04-18 11:31:50-0700
@@ -61,6 +61,7 @@
 import org.apache.log4j.Logger;
 
 import org.argouml.FileHelper;
+import org.argouml.model.InvalidElementException;
 import org.argouml.model.Model;
 import org.argouml.model.UmlException;
 import org.argouml.model.XmiReader;
@@ -104,8 +105,24 @@
      * "st" the example stereotype name.
      */
     public static final String STEREOTYPE_NAME_ST = "st";
-    
-    private final String DEFAULT_SIMPLE_PROFILE_NAME = "SimpleProfile";
+
+    /**
+     * "SimpleProfile" is the name of the SimpleProfile which ProfileMother
+     * uses for the most basic profile being used.
+     */
+    public static final String DEFAULT_SIMPLE_PROFILE_NAME = "SimpleProfile";
+
+    /**
+     * ".xmi" is the default profile file extension.
+     */
+    public static final String XMI_FILE_EXTENSION = ".xmi";
+
+    /**
+     * "TagDef" is the name of the Tag Definition applicable to model elements
+     * to which the stereotype named {@link ProfileMother#STEREOTYPE_NAME_ST}
+     * of SimpleProfile was applied.
+     */
+    public static final String TAG_DEFINITION_NAME_TD = "TagDef";
 
     /**
      * Create a simple profile model with name {@link ProfileMother#DEFAULT_SIMPLE_PROFILE_NAME}
@@ -127,11 +144,16 @@
      * @return the profile model.
      */
     public Object createSimpleProfileModel(String profileName) {
+        // TODO: should it remove the leftovers from other tests?
+//        cleanAllExtents();
+//        assert getFacade().getRootElements().size() == 0;
         Object model = getModelManagementFactory().createProfile();
         Object fooClass = Model.getCoreFactory().buildClass("foo", model);
-        getExtensionMechanismsFactory().buildStereotype(fooClass, 
-                STEREOTYPE_NAME_ST, model);
+        Object stereotype = getExtensionMechanismsFactory().buildStereotype(fooClass,
+            STEREOTYPE_NAME_ST, model);
         getCoreHelper().setName(model, profileName);
+        getExtensionMechanismsFactory().buildTagDefinition(
+            TAG_DEFINITION_NAME_TD, stereotype, null);
         return model;
     }
 
@@ -148,7 +170,7 @@
         }
         return null;
     }
-    
+
     private Object umlProfileModel;
 
     Object getUmlProfileModel() {
@@ -178,9 +200,10 @@
      */
     public void saveProfileModel(Object model, File file) throws IOException {
         FileOutputStream fileOut = new FileOutputStream(file);
+//        cleanAllExtentsBut(model); // TODO: why is this causing a crash?!?
         try {
             XmiWriter xmiWriter = Model.getXmiWriter(model, fileOut, "x(" 
-                    + UmlFilePersister.PERSISTENCE_VERSION + ")");
+                + UmlFilePersister.PERSISTENCE_VERSION + ")");
             xmiWriter.write();
             fileOut.flush();
         } catch (Exception e) {
@@ -192,6 +215,24 @@
         }
     }
 
+    public static void cleanAllExtents() {
+        cleanAllExtentsBut(null);
+    }
+
+    public static void cleanAllExtentsBut(Object extentNotToClean) {
+        // remove leftovers from other tests
+        Collection rootElements = Model.getFacade().getRootElements();
+        for (Object rootElement : rootElements) {
+            if (extentNotToClean != rootElement) {
+                try {
+                    Model.getUmlFactory().deleteExtent(rootElement);
+                } catch (InvalidElementException e) {
+                    // ignored
+                }
+            }
+        }
+    }
+
     /**
      * Create a XMI file that stores a UML profile which depends via XMI
      * of the profile stored in profileFromWhichDependsFile.
@@ -233,7 +274,7 @@
         dependencyCreator.create(profileFromWhichDependsModel,
             dependentProfile);
         File dependentProfileFile = File.createTempFile(
-            dependentProfileFilenamePrefix, ".xmi", profilesDir);
+            dependentProfileFilenamePrefix, XMI_FILE_EXTENSION, profilesDir);
         saveProfileModel(dependentProfile, dependentProfileFile);
         Model.getUmlFactory().deleteExtent(dependentProfile);
         xmiReader.removeSearchPath(profileFromWhichDependsFile.getParent());
@@ -253,7 +294,7 @@
             throws IOException, UmlException {
         File profilesDir = FileHelper.createTempDirectory();
         final File baseFile = File.createTempFile(
-            "baseProfile", ".xmi", profilesDir);
+            "baseProfile", XMI_FILE_EXTENSION, profilesDir);
         Object model = createSimpleProfileModel();
         saveProfileModel(model, baseFile);
         Model.getUmlFactory().deleteExtent(model);
@@ -300,13 +341,13 @@
         // ensure that model subsystem implementation doesn't remember the
         // profiles by changing their names and directories
         baseProfileFile = FileHelper.moveFileToNewTempDirectory(
-            baseProfileFile, "new-base-profile", ".xmi",
+            baseProfileFile, "new-base-profile", XMI_FILE_EXTENSION,
             ProfileMother.class.getCanonicalName());
         File dependentProfileFile = profileFiles.get(1);
         replaceStringInFile(dependentProfileFile, baseProfileFileName,
             baseProfileFile.getName());
         dependentProfileFile = FileHelper.moveFileToNewTempDirectory(
-            dependentProfileFile, "new-dependent-profile", ".xmi",
+            dependentProfileFile, "new-dependent-profile", XMI_FILE_EXTENSION,
             ProfileMother.class.getCanonicalName());
         profileFiles.clear();
         profileFiles.add(baseProfileFile);
@@ -353,4 +394,44 @@
             }
         }
     }
+
+    /**
+     * Create the SimpleProfile (see
+     * {@link ProfileMother#createSimpleProfileModel()}) in a way that it isn't
+     * neither loaded in the model neither remembered by it. The file name has
+     * the prefix {@link ProfileMother#DEFAULT_SIMPLE_PROFILE_NAME} and the
+     * extension {@link ProfileMother#XMI_FILE_EXTENSION}.
+     *
+     * @return the {@link File} where the profile was stored.
+     * @throws IOException
+     */
+    public File createUnloadedSimpleProfile() throws IOException {
+        return createUnloadedSimpleProfile(DEFAULT_SIMPLE_PROFILE_NAME);
+    }
+
+    /**
+     * Create the SimpleProfile (see
+     * {@link ProfileMother#createSimpleProfileModel()}) in a way that it isn't
+     * neither loaded in the model neither remembered by it. The file name has
+     * the prefix profileName and the
+     * extension {@link ProfileMother#XMI_FILE_EXTENSION}.
+     *
+     * @param profileName the name of the profile and the prefix of the
+     *        profile file name.
+     * @return the {@link File} where the profile was stored.
+     * @throws IOException
+     */
+    public File createUnloadedSimpleProfile(String profileName)
+            throws IOException {
+        Object model = createSimpleProfileModel(profileName);
+        File profileFile = File.createTempFile(profileName,
+            XMI_FILE_EXTENSION);
+        saveProfileModel(model, profileFile);
+        Model.getUmlFactory().deleteExtent(model);
+        File newProfileFile = File.createTempFile(profileName,
+            XMI_FILE_EXTENSION);
+        newProfileFile.delete();
+        profileFile.renameTo(newProfileFile);
+        return newProfileFile;
+    }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileFacade.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileFacade.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileFacade.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileFacade.java	2010-04-18 11:31:50-0700
@@ -38,10 +38,12 @@
 
 package org.argouml.profile;
 
-import org.easymock.MockControl;
+import java.util.Collections;
 
 import junit.framework.TestCase;
 
+import org.easymock.MockControl;
+
 /**
  *
  * @author Luis Sergio Oliveira (euluis)
@@ -65,6 +67,7 @@
     @Override
     protected void tearDown() throws Exception {
         ProfileFacade.reset();
+        managerCtrl.verify();
         super.tearDown();
     }
 
@@ -72,6 +75,10 @@
      * Test {@link ProfileFacade#getManager()} before initialization.
      */
     public void testGetManagerBeforeInitialisationThrows() {
+        manager.getRegisteredProfiles();
+        managerCtrl.setReturnValue(Collections.emptyList());
+        managerCtrl.replay();
+        
         ProfileFacade.reset();
         try {
             ProfileFacade.getManager();
@@ -86,10 +93,14 @@
      */
     public void testRegister() {
         manager.registerProfile(null);
+
+        // Called during teardown
+        manager.getRegisteredProfiles();
+        managerCtrl.setReturnValue(Collections.emptyList());
+
         managerCtrl.replay();
         
         ProfileFacade.register(null);
-        managerCtrl.verify();
     }
 
     /**
@@ -97,9 +108,13 @@
      */
     public void testRemove() {
         manager.removeProfile(null);
+
+        // Called during teardown
+        manager.getRegisteredProfiles();
+        managerCtrl.setReturnValue(Collections.emptyList());
+
         managerCtrl.replay();
         
         ProfileFacade.remove((Profile) null);
-        managerCtrl.verify();
     }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileManager.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileManager.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileManager.java	2010-04-18 11:31:50-0700
@@ -85,14 +85,6 @@
     }
 
     /**
-     * Test the {@link ProfileManager#registerProfile(Profile)} method.
-     */
-    public void testRegisterProfile() {
-        manager.registerProfile(mockProfile);
-        assertTrue(manager.getRegisteredProfiles().contains(mockProfile));
-    }
-    
-    /**
      * Test the {@link ProfileManager#removeProfile(Profile)} method.
      */
     public void testRemoveProfile() {
@@ -132,6 +124,7 @@
         assertEquals(initialDefaultProfiles.size(), 
                 manager.getDefaultProfiles().size());
         assertFalse(manager.getDefaultProfiles().contains(mockProfile));
+        manager.removeProfile(mockProfile);
     }
     
     /**

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileMother.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileMother.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileMother.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestProfileMother.java	2010-04-18 11:31:50-0700
@@ -75,6 +75,11 @@
         mother = new ProfileMother();
     }
     
+    protected void tearDown() throws Exception {
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * Test the creation of a profile model.
      */
@@ -85,6 +90,7 @@
         assertEquals(1, profileStereotypes.size());
         assertEquals(ProfileMother.STEREOTYPE_NAME_PROFILE, 
             getFacade().getName(profileStereotypes.iterator().next()));
+        Model.getUmlFactory().delete(model);
     }
     
     /**
@@ -110,6 +116,7 @@
         assertNotNull("\"st\" stereotype not found in model.", st);
         assertTrue(Model.getExtensionMechanismsHelper().isStereotype(st, 
             ProfileMother.STEREOTYPE_NAME_ST, "Class"));
+        Model.getUmlFactory().delete(model);
     }
     
     /**
@@ -123,6 +130,7 @@
         mother.saveProfileModel(model, file);
         assertTrue("The file to where the file was supposed to be saved " 
             + "doesn't exist.", file.exists());
+        Model.getUmlFactory().delete(model);
     }
     
     /**
@@ -157,6 +165,11 @@
             + "from which the dependent profile depends must occur in the "
             + "file.",
             file.getName(), dependentProfileFile);
+        // Clean up our two models and the extent that we read profile in to
+        Model.getUmlFactory().delete(model);
+        Model.getUmlFactory().delete(model2);
+        Model.getUmlFactory().deleteExtent(
+                simpleModelTopElements.iterator().next());
     }
     
     /**
@@ -205,6 +218,10 @@
             true);
         assertEquals("There should exist only one top level element.",
             1, dependentProfileModelTopElements.size());
+        // Clean up our model and the extent that we read profile in to
+        Model.getUmlFactory().delete(model);
+        Model.getUmlFactory().deleteExtent(
+                dependentProfileModelTopElements.iterator().next());
     }
 
     private void assertStringInLineOfFile(String failureMsg, String str,
@@ -239,4 +256,25 @@
         File dependentFile = profilesFiles.get(1);
         assertStringInLineOfFile("", baseFile.getName(), dependentFile);
     }
+
+    /**
+     * Test {@link ProfileMother#createUnloadedSimpleProfile()}.
+     *
+     * @throws IOException when file IO goes wrong...
+     * @throws UmlException when UML manipulation goes wrong...
+     */
+    public void testCreateUnloadedSimpleProfile() throws IOException,
+            UmlException {
+        File profileFile = mother.createUnloadedSimpleProfile();
+        profileFile.deleteOnExit();
+        assertTrue("It doesn't exist or isn't a file.",
+            profileFile.exists() && profileFile.isFile());
+        XmiReader xmiReader = Model.getXmiReader();
+        InputSource inputSource = new InputSource(
+            profileFile.toURI().toURL().toExternalForm());
+        Collection topModelElements = xmiReader.parse(inputSource, true);
+        assertEquals("Unexpected number of top model elements.",
+            1, topModelElements.size());
+        Model.getUmlFactory().deleteExtent(topModelElements.iterator().next());
+    }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestReaderModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestReaderModelLoader.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestReaderModelLoader.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestReaderModelLoader.java	2010-04-18 11:31:50-0700
@@ -47,6 +47,7 @@
 
 import org.argouml.FileHelper;
 import org.argouml.model.InitializeModel;
+import org.argouml.model.Model;
 
 import junit.framework.TestCase;
 
@@ -84,5 +85,7 @@
             loadModel(profileReference);
         assertNotNull(models);
         assertTrue(models.size() >= 1);
+        Model.getUmlFactory().deleteExtent(models.iterator().next());
     }
+    
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/TestUserDefinedProfile.java	2010-04-18 11:31:50-0700
@@ -83,6 +83,7 @@
 
     @Override
     protected void tearDown() throws Exception {
+        ProfileFacade.reset();
         FileHelper.delete(testDir);
         super.tearDown();
     }
@@ -104,6 +105,7 @@
         Profile profile = new UserDefinedProfile(profileFile,
             ProfileFacade.getManager());
         assertEquals(profileName, profile.getDisplayName());
+        ProfileFacade.getManager().removeProfile(profile);
     }
 
     /**
@@ -117,7 +119,7 @@
 
         // create profile model
         ProfileMother profileMother = new ProfileMother();
-        Object model = profileMother.createSimpleProfileModel();
+        Object model = profileMother.createSimpleProfileModel("displayName");
         // save the profile into a xmi file
         File profileFile = new File(testDir, "testLoadingConstructor.xmi");
         profileMother.saveProfileModel(model, profileFile);
@@ -135,5 +137,6 @@
         assertEquals(profile.getDisplayName(), "displayName");
         assertTrue(profile.getDependencies().contains(pm.getUMLProfile()));
         assertTrue(profile.getCritics().contains(critic));
+        ProfileFacade.getManager().removeProfile(profile);
     }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/profile/internal/TestProfileManagerImpl.java	2010-04-18 11:31:50-0700
@@ -47,7 +47,6 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.Vector;
 
 import junit.framework.TestCase;
 
@@ -55,6 +54,7 @@
 import org.argouml.model.UmlException;
 import org.argouml.profile.Profile;
 import org.argouml.profile.ProfileException;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.ProfileManager;
 import org.argouml.profile.ProfileMother;
 import org.argouml.uml.cognitive.critics.ProfileGoodPractices;
@@ -73,8 +73,16 @@
         super.setUp();
         InitializeModel.initializeDefault();
         manager = new ProfileManagerImpl();
+        ProfileFacade.setManager(manager);
     }
 
+
+    @Override
+    protected void tearDown() throws Exception {
+        ProfileFacade.reset();
+        super.tearDown();
+    }
+    
     /**
      * test profile manager 
      */
@@ -129,7 +137,7 @@
 
             @Override
             public Collection getProfilePackages() throws ProfileException {
-                return new Vector();
+                return Collections.emptyList();
             }
             
         };
@@ -164,12 +172,16 @@
         Collections.reverse(profileFiles);
         
         ProfileManagerImpl managerImpl = (ProfileManagerImpl) manager;
+        manager.addSearchPathDirectory(profileFiles.get(0).getParent());
+        manager.addSearchPathDirectory(profileFiles.get(1).getParent());
         managerImpl.loadProfiles(profileFiles);
         
         List<Profile> registeredProfilesAfter =
             manager.getRegisteredProfiles();
         assertEquals("Now we should have two more registered profiles.",
             numRegisteredBefore + 2, registeredProfilesAfter.size());
+        manager.removeSearchPathDirectory(profileFiles.get(0).getParent());
+        manager.removeSearchPathDirectory(profileFiles.get(1).getParent());
     }
 
     /**
@@ -196,15 +208,16 @@
         dependentProfileList.add(dependentProfileFile);
         
         ProfileManagerImpl managerImpl = (ProfileManagerImpl) manager;
+        manager.addSearchPathDirectory(baseProfileFile.getParent());
         managerImpl.loadProfiles(dependentProfileList);
-        assertEquals("We should have exaclty the same number of registered "
-            + "profiles as in the begining.",
-            numRegisteredBefore, manager.getRegisteredProfiles().size());
+        assertEquals("We should have one more registered profiles as in the beginning.",
+            numRegisteredBefore + 1, manager.getRegisteredProfiles().size());
         
         ArrayList<File> baseProfileList = new ArrayList<File>();
         baseProfileList.add(baseProfileFile);
         managerImpl.loadProfiles(baseProfileList);
         assertEquals("Now we should have two more registered profiles.",
             numRegisteredBefore + 2, manager.getRegisteredProfiles().size());
+        manager.removeSearchPathDirectory(baseProfileFile.getParent());
     }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/ui/TestDetailsPane.java	2010-04-18 11:31:50-0700
@@ -39,6 +39,7 @@
 package org.argouml.ui;
 
 import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
 
 import junit.framework.TestCase;
 
@@ -98,7 +99,18 @@
     /**
      * Test setting a target.
      */
-    public void testTargetSet() {
+    public void testTargetSet() throws Exception {
+        // Make sure this test happens on the AWT event thread
+        SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                intTestTargetSet();
+            }});
+    }
+    
+    /**
+     * Test setting a target.
+     */
+    public void intTestTargetSet() {
         DetailsPane pane = new DetailsPane("South", Horizontal.getInstance());
         for (AbstractArgoJPanel tab : new InitUmlUI().getDetailsTabs()) {
             pane.addTab(tab, false);

Modified: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestProfileDefault.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestProfileDefault.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestProfileDefault.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestProfileDefault.java	2010-04-18 11:31:50-0700
@@ -43,19 +43,24 @@
 import junit.framework.TestCase;
 
 import org.argouml.kernel.ProfileConfiguration;
+import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
 import org.argouml.model.Model;
+import org.argouml.profile.Profile;
+import org.argouml.profile.ProfileException;
+import org.argouml.profile.ProfileFacade;
 import org.argouml.profile.init.InitProfileSubsystem;
 
 /**
- * 
- * @author euluis
+ * Automated integration tests that guarantee that the default profiles work.
+ * @author Luis Sergio Oliveira (euluis)
  * @since 0.20
- * @version 0.00
  */
 public class TestProfileDefault extends TestCase {
 
+    private Project proj;
+
     /**
      * The constructor.
      *
@@ -75,18 +80,31 @@
         new InitProfileSubsystem().init();
     }
 
+    @Override
+    protected void tearDown() throws Exception {
+        if (proj != null) {
+            ProjectManager.getManager().removeProject(proj);
+        }
+        super.tearDown();
+    }
     /**
      * Test whether we can load default profile.
+     * @throws ProfileException if {@link Profile} operations throw.
      */
-    public void testLoadProfileModel() {
-        // TODO: This depends on the profile configuration of the user running
-        // the test.  It needs to be made independent of that.
-        ProfileConfiguration config = ProjectManager.getManager()
-                .getCurrentProject().getProfileConfiguration();
+    public void testLoadProfileModel() throws ProfileException {
+        proj = ProjectManager.getManager().makeEmptyProject();
+        ProfileConfiguration config = proj.getProfileConfiguration();
         assertNotNull("Can't load profile configuration", config);
+        Profile umlProfile = ProfileFacade.getManager().getUMLProfile();
+        assertNotNull(umlProfile);
+        assertTrue(!umlProfile.getProfilePackages().isEmpty());
+        Object model = proj.getUserDefinedModelList().iterator().next();
+        if (!config.getProfiles().contains(umlProfile)) {
+            config.addProfile(umlProfile, model);
+        }
         Collection stereos = config.findAllStereotypesForModelElement(Model
-                .getCoreFactory().createClass());
+            .getCoreFactory().createClass());
         assertTrue("No stereotypes found in default profiles", 
-                stereos.size() > 0);
+            stereos.size() > 0);
     }
 }

Copied: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java (from r18235, /trunk/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java)
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java?view=diff&pathrev=18284&r1=18235&r2=18284
==============================================================================
--- /trunk/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/TestStereotypeUtility.java	2010-04-18 11:31:50-0700
@@ -18,6 +18,8 @@
 import java.util.List;
 import java.util.Set;
 
+import junit.framework.TestCase;
+
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.InitializeModel;
@@ -27,8 +29,6 @@
 import org.argouml.profile.UserDefinedProfile;
 import org.argouml.profile.init.InitProfileSubsystem;
 
-import junit.framework.TestCase;
-
 /**
  * Integration tests for {@link StereotypeUtility} class.
  *
@@ -53,6 +53,7 @@
         if (proj != null) {
             ProjectManager.getManager().removeProject(proj);
         }
+        ProfileFacade.reset();
         super.tearDown();
     }
 
@@ -96,6 +97,7 @@
             profileStereotype);
         Model.getCoreHelper().addStereotype(aClass, profileStereotype);
         // FIXME: fails here.
+        // The current behavior appears intentional (ie the test is wrong) - tfm
 //        assertNull("The profile stereotype named \""
 //            + ProfileMother.STEREOTYPE_NAME_ST + "\" shouldn't be found.",
 //            findModelElementFromNamespace(

Removed: branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/TestUMLTagDefinitionComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-app/tests/org/argouml/uml/ui/TestUMLTagDefinitionComboBoxModel.java?view=markup&pathrev=18283

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsFactoryEUMLlImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial framework
+ *******************************************************************************/
 
 package org.argouml.model.euml;
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ActivityGraphsHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.Collection;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/AggregationKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/AggregationKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/AggregationKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/AggregationKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AggregationKind;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeCommand.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeCommand.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeCommand.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeCommand.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Bogdan Pistol and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.eclipse.emf.common.notify.impl.NotificationImpl;
@@ -47,6 +18,8 @@
  * <p>
  * The label of this command can contain the character '#' that will be replaced
  * with information about an object when the label is returned.
+ * <p>
+ * TODO: Switch this to use Java string formatting instead of private # notation?
  * 
  * @author Bogdan Pistol
  */
@@ -68,16 +41,21 @@
         super(modelImplementation.getEditingDomain(), runnable, label);
         if (!isValid(label, objects)) {
             throw new IllegalArgumentException(
-                    "The label is not compatible with the objects"); //$NON-NLS-1$
+                    "The label is not compatible with the # of objects"); //$NON-NLS-1$
         }
         this.objects = objects;
         modelImpl = modelImplementation;
     }
 
+    /**
+     * TODO: Document! What does this do?  Interacts with event pump in some manner
+     * 
+     * @param objects new objeccts
+     */
     public void setObjects(Object... objects) {
         if (!isValid(label, objects)) {
             throw new IllegalArgumentException(
-                    "The label is not compatible with the objects"); //$NON-NLS-1$
+                    "The label is not compatible with the # of objects"); //$NON-NLS-1$
         }
         this.objects = objects;
         modelImpl.getModelEventPump().notifyChanged(

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeableKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeableKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeableKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ChangeableKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.ChangeableKind;
@@ -49,21 +20,24 @@
  * @deprecated This is a simple binary choice (isReadOnly or not) in UML2, so
  *             this is purely for backward compatibility.
  */
+@Deprecated
 class ChangeableKindEUMLImpl implements ChangeableKind {
 
-
+    @Deprecated
     public Object getAddOnly() {
     // TODO: Change to throw exception when uses are fixed
 //        throw new NotImplementedException();
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
+    @Deprecated
     public Object getChangeable() {
-        return "changeable";
+        return "changeable"; //$NON-NLS-1$
     }
 
+    @Deprecated
     public Object getFrozen() {
-        return "frozen";
+        return "frozen"; //$NON-NLS-1$
     }
 
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,47 +1,23 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.CollaborationsFactory;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Collaboration;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.Message;
 import org.eclipse.uml2.uml.UMLFactory;
 
 /**
@@ -106,15 +82,21 @@
         return null;
     }
 
-    public Object buildCollaboration(Object handle) {
-        // TODO: Auto-generated method stub
-        return null;
+    // TODO: All build/create methods need Undo support - tfm
+
+    public Collaboration buildCollaboration(Object handle) {
+        Collaboration collab = createCollaboration();
+        ((Element) handle).getOwnedElements().add(collab);
+        return collab;
     }
 
-    public Object buildCollaboration(Object namespace, 
+    public Collaboration buildCollaboration(Object namespace, 
             Object representedElement) {
+        Collaboration collab = buildCollaboration(namespace);
+        Classifier cls = (Classifier) representedElement;
+
         // TODO: Auto-generated method stub
-        return null;
+        return collab;
     }
 
     public Object buildInteraction(Object handle) {
@@ -122,9 +104,9 @@
         return null;
     }
 
-    public Object buildMessage(Object acollab, Object arole) {
+    public Message buildMessage(Object acollab, Object arole) {
         // TODO: Auto-generated method stub
-        return null;
+        return createMessage();
     }
 
     public Object createAssociationEndRole() {
@@ -142,7 +124,7 @@
         return null;
     }
 
-    public Object createCollaboration() {
+    public Collaboration createCollaboration() {
         return UMLFactory.eINSTANCE.createCollaboration();
     }
 
@@ -151,7 +133,7 @@
         return null;
     }
 
-    public Object createInteraction() {
+    public Interaction createInteraction() {
         return UMLFactory.eINSTANCE.createInteraction();
     }
 
@@ -160,7 +142,7 @@
         return null;
     }
 
-    public Object createMessage() {
+    public Message createMessage() {
         return UMLFactory.eINSTANCE.createMessage();
     }
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CollaborationsHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.Collection;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommandStackImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommandStackImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommandStackImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommandStackImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Bogdan Pistol and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 //import org.argouml.model.CommandStack;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-/// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AbstractModelFactory;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CommonBehaviorHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.Collection;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ConcurrencyKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ConcurrencyKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ConcurrencyKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ConcurrencyKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.ConcurrencyKind;
@@ -61,5 +32,4 @@
         return CallConcurrencyKind.SEQUENTIAL_LITERAL;
     }
 
-
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CopyHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CopyHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CopyHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CopyHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.CopyHelper;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,41 +1,16 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - undo support & large piece of initial implementation
  *    bobtarling
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -882,6 +857,7 @@
                 if (name != null) {
                     operation.setName(name);
                 } else {
+                    // TODO: Remove?  Can't be localized
                     operation.setName("newOperation");
                 }
                 getParams().add(operation);
@@ -912,6 +888,7 @@
             public void run() {
                 Parameter param = createParameter();
                 param.setType((Type) type);
+                // TODO: Remove?  Can't be localized
                 param.setName("arg" +
                     ((BehavioralFeature) o).getOwnedParameters().size());
                 ((BehavioralFeature) o).getOwnedParameters().add(param);
@@ -1064,7 +1041,17 @@
     }
 
     public Association createAssociation(Object extent) {
-        return UMLFactory.eINSTANCE.createAssociation();
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createAssociation());
+            }
+        };
+        ChangeCommand cmd = new ChangeCommand(
+                modelImpl, run,
+                "Create an association");
+        editingDomain.getCommandStack().execute(cmd);
+//        cmd.setObjects(run.getParams().get(0));
+        return (Association) run.getParams().get(0);
     }
     
     public AssociationClass createAssociationClass() {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,41 +1,16 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial framework & prototype implementation
+ *    Bogdan Pistol - initial implementation
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -47,6 +22,7 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.log4j.Logger;
 import org.argouml.model.CoreHelper;
 import org.argouml.model.Model;
 import org.argouml.model.NotImplementedException;
@@ -98,6 +74,8 @@
  */
 class CoreHelperEUMLImpl implements CoreHelper {
 
+    private static final Logger LOG = Logger.getLogger(CoreHelperEUMLImpl.class);
+    
     /**
      * The model implementation.
      */
@@ -274,7 +252,8 @@
                 editingDomain, owner, null, element, index);
         if (cmd == null || !cmd.canExecute()) {
             throw new UnsupportedOperationException(
-                    "The element " + element + " cannot be added to the element " + owner); //$NON-NLS-1$//$NON-NLS-2$
+                    "The element " + element  //$NON-NLS-1$
+                    + " cannot be added to the element " + owner); //$NON-NLS-1$
         }
         RunnableClass run = new RunnableClass() {
             public void run() {
@@ -385,7 +364,8 @@
     }
 
     public void addOwnedElement(Object handle, Object me) {
-        addOwnedElement(handle, me, "Add the owned element # to the owner #", me, handle);
+        addOwnedElement(handle, me, "Add the owned element # to the owner #", 
+                me, handle);
     }
 
     public void addParameter(Object handle, int index, Object parameter) {
@@ -432,13 +412,15 @@
     }
 
     public void addRaisedException(Object handle, Object exception) {
-        if (!(handle instanceof Operation)) {
-            throw new IllegalArgumentException( "The operation must be an instance of Operation");
-        }
-        if (!(exception instanceof Type)) {
-            throw new IllegalArgumentException( "The exception must be an instance of Type");
-        }
-        (((Operation)handle).getRaisedExceptions()).add((Type)exception);
+        UMLUtil.checkArgs(new Object[] {handle, exception},
+                new Class[] {Operation.class, Type.class});
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(
+                        modelImpl, getRunnableClassForAddCommand(
+                                (Operation) handle,
+                                (Type) exception),
+                        "Add the Exception # to the Operation #", exception,
+                        handle));
     }
     
     public void addSourceFlow(Object handle, Object flow) {
@@ -529,36 +511,42 @@
     }
 
     public Collection getAllBehavioralFeatures(Object element) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(element, BehavioralFeature.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                element, BehavioralFeature.class);
     }
 
     public Collection getAllClasses(Object ns) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(ns, org.eclipse.uml2.uml.Class.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                ns, org.eclipse.uml2.uml.Class.class);
     }
 
     public Collection getAllClassifiers(Object namespace) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(namespace, Classifier.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                namespace, Classifier.class);
     }
 
     public Collection getAllComponents(Object ns) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(ns, org.eclipse.uml2.uml.Component.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                ns, org.eclipse.uml2.uml.Component.class);
     }
 
     public Collection getAllDataTypes(Object ns) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(ns, DataType.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                ns, DataType.class);
     }
-    
+
     public Collection getAllInterfaces(Object ns) {
-        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(ns, Interface.class);
+        return modelImpl.getModelManagementHelper().getAllModelElementsOfKind(
+                ns, Interface.class);
     }
 
-    public Collection getAllMetaDatatypeNames() {
+    public Collection<String> getAllMetaDatatypeNames() {
         // TODO: not implemented
         return Collections.emptySet();
     }
     
-    public Collection getAllMetatypeNames() {
-        Collection result = new ArrayList();
+    public Collection<String> getAllMetatypeNames() {
+        Collection<String> result = new ArrayList<String>();
         for (Field f : UMLPackage.Literals.class.getDeclaredFields()) {
             Object o;
             try {
@@ -642,12 +630,12 @@
         return result;
     }
 
-    public Collection getAssociatedClassifiers(Object aclassifier) {
+    public Collection<Classifier> getAssociatedClassifiers(Object aclassifier) {
         if (!(aclassifier instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "aclassifier must be instance of Classifier"); //$NON-NLS-1$
         }
-        Collection result = new ArrayList();
+        Collection<Classifier> result = new ArrayList<Classifier>();
         for (Association a : ((Classifier) aclassifier).getAssociations()) {
             for (Type t : a.getEndTypes()) {
                 if (t != aclassifier && t instanceof Classifier) {
@@ -658,7 +646,7 @@
         return result;
     }
 
-    public Object getAssociationEnd(Object type, Object assoc) {
+    public Property getAssociationEnd(Object type, Object assoc) {
         if (!(type instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "type must be instance of Classifier"); //$NON-NLS-1$
@@ -670,18 +658,18 @@
         return ((Association) assoc).getMemberEnd(null, (Classifier) type);
     }
 
-    public Collection getAssociations(Object from, Object to) {
+    public Collection<Association> getAssociations(Object from, Object to) {
         // TODO: The javadoc specifies that null should be returned if 'from' or
         // 'to' are null or if there are no associations between them. We should
         // return an empty collection instead and the javadoc should be changed.
         if (from == null || to == null) {
-            return Collections.EMPTY_LIST;
+            return Collections.emptyList();
         }
         if (!(from instanceof Classifier) || !(to instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "'from' and 'to' must be instances of Classifier"); //$NON-NLS-1$
         }
-        Collection result = new ArrayList();
+        Collection<Association> result = new ArrayList<Association>();
         for (Association a : ((Classifier) from).getAssociations()) {
             if (((Classifier) to).getAssociations().contains(a)) {
                 result.add(a);
@@ -754,12 +742,12 @@
         return results;
     }
 
-    public Collection getDependencies(Object supplierObj, Object clientObj) {
+    public Collection<Dependency> getDependencies(Object supplierObj, Object clientObj) {
         if (!(supplierObj instanceof NamedElement) || !(clientObj instanceof NamedElement)) {
             throw new IllegalArgumentException(
                     "supplierObj and clientObj must be instances of NamedElement"); //$NON-NLS-1$
         }
-        Collection result = new ArrayList();
+        Collection<Dependency>  result = new ArrayList<Dependency> ();
         for (Dependency d : ((NamedElement) clientObj).getClientDependencies()) {
             if (d.getSuppliers().contains(supplierObj)) {
                 result.add(d);
@@ -768,7 +756,7 @@
         return result;
     }
 
-    public Collection getExtendedClassifiers(Object element) {
+    public Collection<Classifier> getExtendedClassifiers(Object element) {
         // TODO: Does CoreHelper#getExtendedClassifiers(Object element) means
         // all parents (direct and indirect) or only the direct parents?
         if (!(element instanceof Classifier)) {
@@ -810,7 +798,7 @@
         return result;
     }
 
-    public Object getFirstSharedNamespace(Object ns1, Object ns2) {
+    public Namespace getFirstSharedNamespace(Object ns1, Object ns2) {
         if (!(ns1 instanceof Namespace) || !(ns2 instanceof Namespace)) {
             throw new IllegalArgumentException(
                     "ns1 and ns2 must be instances of Namespace"); //$NON-NLS-1$
@@ -841,7 +829,7 @@
         throw new NotYetImplementedException();
     }
 
-    public Object getGeneralization(Object achild, Object aparent) {
+    public Generalization getGeneralization(Object achild, Object aparent) {
         if (!(achild instanceof Classifier) 
                 || !(aparent instanceof Classifier)) {
             throw new IllegalArgumentException(
@@ -851,7 +839,7 @@
         return ((Classifier) achild).getGeneralization((Classifier) aparent);
     }
 
-    public Collection getOperationsInh(Object classifier) {
+    public Collection<Operation> getOperationsInh(Object classifier) {
         if (!(classifier instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "'classifier' must be instance of Classifier"); //$NON-NLS-1$
@@ -859,7 +847,7 @@
         return ((Classifier) classifier).getAllOperations();
     }
 
-    public Collection getRealizedInterfaces(Object cls) {
+    public Collection<Interface> getRealizedInterfaces(Object cls) {
         if (!(cls instanceof org.eclipse.uml2.uml.Class)) {
             throw new IllegalArgumentException(
                     "'cls' must be instance of UML2 Class"); //$NON-NLS-1$
@@ -1003,7 +991,7 @@
         return results;
     }
 
-    public Collection getSupertypes(Object generalizableElement) {
+    public Collection<Classifier> getSupertypes(Object generalizableElement) {
         if (!(generalizableElement instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "'generalizableElement' must be instance of Classifier"); //$NON-NLS-1$
@@ -1168,16 +1156,20 @@
         throw new NotYetImplementedException();
     }
 
-    public void removeStereotype(Object handle, Object stereo) {
-        if (!(handle instanceof Element)) {
-            throw new IllegalArgumentException(
-                    "handle must be instance of Element"); //$NON-NLS-1$
-        }
-        if (!(stereo instanceof Stereotype)) {
-            throw new IllegalArgumentException(
-                    "stereo must be instance of Stereotype"); //$NON-NLS-1$
+
+    public void removeStereotype(final Object handle, final Object stereo) {
+        UMLUtil.checkArgs(new Object[] {handle, stereo},
+                new Class[] {Element.class, Stereotype.class});
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                ((Element) handle).unapplyStereotype((Stereotype) stereo);
         }
-        ((Element) handle).unapplyStereotype((Stereotype) stereo);
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(
+                        modelImpl, run,
+                        "Remove the stereotype # from the element #",
+                        stereo, handle));
     }
 
     public void removeSupplierDependency(final Object supplier,
@@ -1331,7 +1323,7 @@
         ((Comment) handle).setBody(body);
     }
 
-    @SuppressWarnings("deprecation")
+    @Deprecated
     public void setChangeability(Object handle, Object ck) {
         throw new NotImplementedException();
     }
@@ -1359,15 +1351,20 @@
                         child, handle));
     }
 
-    public void setConcurrency(Object handle, Object concurrencyKind) {
-        if (handle instanceof Operation
-                && concurrencyKind instanceof CallConcurrencyKind) {
-            ((Operation) handle).
-                    setConcurrency((CallConcurrencyKind) concurrencyKind);
-            return;
+    public void setConcurrency(final Object handle, final Object concurrencyKind) {
+        UMLUtil.checkArgs(new Object[] {handle, concurrencyKind},
+                new Class[] {Element.class, CallConcurrencyKind.class});
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                ((Operation) handle).setConcurrency((CallConcurrencyKind) concurrencyKind);
         }
-        throw new IllegalArgumentException("handle: " + handle //$NON-NLS-1$
-                + " or concurrencyKind: " + concurrencyKind); //$NON-NLS-1$
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(
+                        modelImpl,
+                        run,
+                        "Set the concurrencyKind # of the element #",
+                        concurrencyKind, handle));
     }
 
     public void setConnections(Object handle, Collection ends) {
@@ -1408,7 +1405,9 @@
     }
 
     public void setKind(Object handle, Object kind) {
-	if( handle instanceof Parameter && kind instanceof ParameterDirectionKind) {
+        // TODO: Needs undo support
+	if( handle instanceof Parameter 
+	        && kind instanceof ParameterDirectionKind) {
 		((Parameter)handle).setDirection( (ParameterDirectionKind)kind);
 		return;
 	}
@@ -1416,7 +1415,8 @@
 		((Pseudostate)handle).setKind( (PseudostateKind)kind);
 		return;
 	}
-        throw new IllegalArgumentException( "handle: " + handle + " or kind: " + kind);
+        throw new IllegalArgumentException( "handle: " + handle  //$NON-NLS-1$
+                + " or kind: " + kind); //$NON-NLS-1$
     }
 
     public void setLeaf(final Object handle, final boolean isLeaf) {
@@ -1449,30 +1449,26 @@
         if (arg instanceof String) {
             String s = (String) arg;
             int lower = 1, upper = 1;
-            
-            try {
-                if ("*".equals(s.trim())) {
-                    lower = 0;
+
+            if ("*".equals(s.trim())) { //$NON-NLS-1$
+                lower = 0;
+                upper = -1;
+            } else if (s.contains("..")) { //$NON-NLS-1$
+                String[] pieces = s.trim().split("\\.\\."); //$NON-NLS-1$
+                if (pieces.length > 2) {
+                    throw new IllegalArgumentException((String) arg);
+                }
+                lower = Integer.parseInt(pieces[0]);
+                if ("*".equals(pieces[1])) { //$NON-NLS-1$
                     upper = -1;
-                } else if (s.contains("..")) {
-                    String[] pieces = s.trim().split("\\.\\.");
-                    if (pieces.length > 2) {
-                        throw new IllegalArgumentException((String) arg);
-                    }
-                    lower = Integer.parseInt(pieces[0]);
-                    if ("*".equals(pieces[1])) {
-                        upper = -1;
-                    } else {
-                        upper = Integer.parseInt(pieces[1]);
-                    }
-                } else { 
-                    lower = Integer.parseInt(s);
-                    upper = lower;
+                } else {
+                    upper = Integer.parseInt(pieces[1]);
                 }
-            } catch (NumberFormatException e) {
-                // TODO: lower..upper
-                throw new NotYetImplementedException();
+            } else { 
+                lower = Integer.parseInt(s);
+                upper = lower;
             }
+            
             final int lower_ = lower, upper_ = upper;
             RunnableClass run = new RunnableClass() {
                 public void run() {
@@ -1500,6 +1496,12 @@
 
     public void setName(final Object handle, final String name) {
         if (!(handle instanceof NamedElement)) {
+            if (handle instanceof Generalization) {
+                LOG.warn("Attempting to set the name of a generalization "
+                        + "which is no longer a NamedElement in UML 2" + name
+                        + handle.toString());
+                return;
+            }
             throw new IllegalArgumentException(
                     "handle must be instance of NamedElement"); //$NON-NLS-1$
         }
@@ -1691,11 +1693,12 @@
                         isStatic, feature));
     }
 
+    @Deprecated
     public void setTaggedValue(Object handle, String tag, String value) {
         throw new NotYetImplementedException();
     }
 
-    @SuppressWarnings("deprecation")
+    @Deprecated
     public void setTargetScope(Object handle, Object targetScope) {
         // Don't implement - deprecated method in interface.
         throw new NotImplementedException();

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,15 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - multiplicity workaround 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.List;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DataTypesHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2009 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.List;
@@ -48,7 +19,6 @@
 import org.eclipse.uml2.uml.OpaqueExpression;
 import org.eclipse.uml2.uml.PseudostateKind;
 
-
 /**
  * The implementation of the DataTypesHelper for EUML2.
  */
@@ -123,7 +93,7 @@
         } else {
             return DataTypesFactoryEUMLImpl.boundToString(
                     mult.getLower())
-                    + ".."
+                    + ".." //$NON-NLS-1$
                     + DataTypesFactoryEUMLImpl.boundToString(mult.getUpper());
         }
     }
@@ -132,7 +102,7 @@
         List<String> bodies = ((OpaqueExpression) handle).getBodies();
         // TODO: Support more than one body/language
         if (bodies.size() > 1) {
-            throw new IllegalStateException("Only one body/lang supported");
+            throw new IllegalStateException("Only one body/lang supported"); //$NON-NLS-1$
         }
         bodies.clear();
         bodies.add(body);
@@ -143,7 +113,7 @@
         List<String> langs = ((OpaqueExpression) handle).getLanguages();
         // TODO: Support more than one body/language
         if (langs.size() > 1) {
-            throw new IllegalStateException("Only one body/lang supported");
+            throw new IllegalStateException("Only one body/lang supported"); //$NON-NLS-1$
         }
         langs.clear(); 
         langs.add(language);

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DirectionKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DirectionKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DirectionKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/DirectionKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.DirectionKind;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	2010-04-18 11:31:50-0700
@@ -1,53 +1,23 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - undo support
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
+ *    
  * This implementation uses ideas and code snippets from the 
  * "org.eclipse.uml2.uml.editor.presentation" package.
  * 
  * The package "org.eclipse.uml2.uml.editor.presentation" is part of the
  * Eclipse UML2 plugin and it is available under the terms of 
  * the Eclipse Public License v1.0.
- * 
- * The Eclipse Public License v1.0 is available at 
- * http://www.eclipse.org/legal/epl-v10.html.
- */
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -92,9 +62,13 @@
  * them.
  * <p>
  * The implementation of this subsystem was generously sponsored by Google as
- * part of the Google Summer of Code 2007. The bulk of the implementation was
+ * part of the Google Summer of Code 2007. A large part of the implementation was
  * built by the sponsored student, Bogdan Ciprian Pistol, who was mentored by
  * Tom Morris.
+ * <p>
+ * This implementation uses ideas and code snippets from the 
+ * "org.eclipse.uml2.uml.editor.presentation" package which is part of the
+ * Eclipse UML2 plugin.
  * 
  * @author Bogdan Ciprian Pistol
  * @author Tom Morris <[email protected]>
@@ -250,6 +224,7 @@
 
             path = path.replace('\\', '/');
             // These lines were one cause for issue 5915: (Were they needed?)
+            // TODO: Review - tfm
             //if (Character.isLetter(path.charAt(0))) {
             //    path = '/' + path;
             //}

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,62 +1,27 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
 import java.util.Collection;
 
-import org.apache.log4j.Logger;
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.ExtensionMechanismsFactory;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.uml2.uml.Model;
+import org.eclipse.emf.edit.domain.EditingDomain;
 import org.eclipse.uml2.uml.Namespace;
 import org.eclipse.uml2.uml.Package;
 import org.eclipse.uml2.uml.Stereotype;
 import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.resource.UMLResource;
 
 /**
  * The implementation of the ExtensionMechanismsFactory for EUML2.
@@ -64,19 +29,13 @@
 class ExtensionMechanismsFactoryEUMLImpl implements
         ExtensionMechanismsFactory, AbstractModelFactory {
 
-    private static final Logger LOG = Logger
-            .getLogger(ExtensionMechanismsFactoryEUMLImpl.class);
-
     /**
      * The model implementation.
      */
     private EUMLModelImplementation modelImpl;
+    private EditingDomain editingDomain;
+
 
-    /**
-     * The UML metamodel (lazily loaded singleton).
-     */
-    private static UMLPackage metamodel = null;
-    
     /**
      * Constructor.
      * 
@@ -86,55 +45,45 @@
     public ExtensionMechanismsFactoryEUMLImpl(
             EUMLModelImplementation implementation) {
         modelImpl = implementation;
+        editingDomain = implementation.getEditingDomain();
     }
 
-    public Object buildStereotype(Object theModelElementObject, Object theName,
-            Object theNamespaceObject) {
-        
-        if (theModelElementObject == null || theName == null
-                || theNamespaceObject == null) {
-            throw new IllegalArgumentException(
-                    "one of the arguments is null: modelElement=" //$NON-NLS-1$
-                    + theModelElementObject
-                    + " name=" + theName //$NON-NLS-1$
-                    + " namespace=" + theNamespaceObject); //$NON-NLS-1$
-        }
-        
-        //ModelElement me = (ModelElement) theModelElementObject;
-        
-        String text = (String) theName;
-        Namespace ns = (Namespace) theNamespaceObject;
-        Stereotype stereo = (Stereotype)buildStereotype(text, ns);
-        /*
-        stereo.getBaseClass().add(modelImpl.getMetaTypes().getName(me));
-        // TODO: this doesn't look right - review - tfm
-        Stereotype stereo2 = (Stereotype) extensionHelper.getStereotype(ns,
-                stereo);
-        if (stereo2 != null) {
-            me.getStereotype().add(stereo2);
-            modelImpl.getUmlFactory().delete(stereo);
-            return stereo2;
-        }
-        stereo.setNamespace(ns);
-        me.getStereotype().add(stereo);
-        */
+    public Stereotype buildStereotype(Object element, Object name,
+            Object namespace) {
+        Stereotype stereo = buildStereotype((String) name, 
+                (Namespace) namespace);
+        // TODO: Add base classes - the following might not even be close!
+//        for (Class i : ((Element) element).getClass().getInterfaces()) {
+//            if (i instanceof umlmetaclass) {
+//                stereo.getExtendedMetaclasses().add(i);
+//            }
+//        }
         return stereo;
     }
 
-    public Object buildStereotype(Object theModelElementObject, String theName,
+    public Object buildStereotype(Object element, String name,
             Object model, Collection models) {
         // TODO: Auto-generated method stub
         return null;
     }
 
-    public Object buildStereotype(String text, Object ns) {
-        Stereotype stereo = UMLFactory.eINSTANCE.createStereotype();
-        stereo.setName(text);
-        // more checking needed?
-        if (ns instanceof Package) {
-            stereo.setPackage((Package)ns);
+    public Stereotype buildStereotype(final String name, final Object namespace) {
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                Stereotype stereo = createStereotype();
+                stereo.setName(name);
+                if (namespace instanceof Package) {
+                    stereo.setPackage((Package) namespace);
+                }
+                getParams().add(stereo);
         }
-        return stereo;
+        };
+        ChangeCommand cmd = new ChangeCommand(
+                modelImpl, run,
+                "Build a stereotype");
+        editingDomain.getCommandStack().execute(cmd);
+//        cmd.setObjects(run.getParams().get(0));
+        return (Stereotype) run.getParams().get(0);
     }
 
     public Object buildTagDefinition(String name, Object stereotype, Object ns) {
@@ -148,6 +97,7 @@
         return null;
     }
 
+    @Deprecated
     public Object buildTaggedValue(String tag, String value) {
         // TODO: Auto-generated method stub
         return null;
@@ -158,7 +108,7 @@
         return null;
     }
 
-    public Object copyStereotype(Object source, Object ns) {
+    public Stereotype copyStereotype(Object source, Object ns) {
         // TODO: Auto-generated method stub
         return null;
     }
@@ -173,8 +123,18 @@
 
     }
 
-    public Object createStereotype() {
-        return UMLFactory.eINSTANCE.createStereotype();
+    public Stereotype createStereotype() {
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createStereotype());
+            }
+        };
+        ChangeCommand cmd = new ChangeCommand(
+                modelImpl, run,
+                "Create a stereotype");
+        editingDomain.getCommandStack().execute(cmd);
+//        cmd.setObjects(run.getParams().get(0));
+        return (Stereotype) run.getParams().get(0);
     }
 
     public Object createTagDefinition() {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ExtensionMechanismsHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,47 +1,21 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial framework 
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the ArgoUML Project nor the
-//       names of its contributors may be used to endorse or promote products
-//       derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE ArgoUML PROJECT ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE ArgoUML PROJECT BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
@@ -211,22 +185,19 @@
     }
 
     public Collection<Stereotype> getStereotypes(Object ns) {
-        List<Stereotype> l = new ArrayList<Stereotype>();
         if (ns instanceof Profile) {
-            Iterator iter = ((Profile) ns).getOwnedStereotypes().iterator();
-            while (iter.hasNext()) {
-                l.add((Stereotype) iter.next());
-            }
+            return new ArrayList<Stereotype>(((Profile) ns).getOwnedStereotypes());
         }
-        return l;
+        return Collections.emptySet();
     }
 
     public Collection<Stereotype> getStereotypes(Collection models) {
-        List<Stereotype> l = new ArrayList<Stereotype>();
+        Collection<Stereotype> l = new ArrayList<Stereotype>();
         if (models != null) {
             for (Object ns : models) {
                 if (ns instanceof Profile) {
                     l.addAll(((Profile) ns).getOwnedStereotypes());
+                    // TODO: Do we really want stereotypes from nested packages?
                     Iterator<Package> iter = ((Profile) ns).getNestedPackages()
                             .iterator();
                     while (iter.hasNext()) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,41 +1,17 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009-2010 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - initial implementation
  *    Bob Tarling
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -49,11 +25,15 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.model.Facade;
+import org.eclipse.emf.common.notify.Notifier;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.common.util.Enumerator;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.uml2.uml.Abstraction;
 import org.eclipse.uml2.uml.Action;
 import org.eclipse.uml2.uml.ActivityPartition;
@@ -134,10 +114,12 @@
 import org.eclipse.uml2.uml.StructuralFeature;
 import org.eclipse.uml2.uml.TemplateBinding;
 import org.eclipse.uml2.uml.TemplateParameter;
+import org.eclipse.uml2.uml.TemplateParameterSubstitution;
 import org.eclipse.uml2.uml.TemplateableElement;
 import org.eclipse.uml2.uml.TimeEvent;
 import org.eclipse.uml2.uml.Transition;
 import org.eclipse.uml2.uml.Trigger;
+import org.eclipse.uml2.uml.Type;
 import org.eclipse.uml2.uml.TypedElement;
 import org.eclipse.uml2.uml.UMLPackage;
 import org.eclipse.uml2.uml.Usage;
@@ -145,6 +127,7 @@
 import org.eclipse.uml2.uml.ValueSpecification;
 import org.eclipse.uml2.uml.Vertex;
 import org.eclipse.uml2.uml.VisibilityKind;
+import org.eclipse.uml2.uml.resource.UMLResource;
 
 
 /**
@@ -277,12 +260,12 @@
         return null;
     }
 
-    public Collection getAssociationEnds(Object handle) {
+    public Collection<Property> getAssociationEnds(Object handle) {
         if (!(handle instanceof Classifier)) {
             throw new IllegalArgumentException(
                     "handle must be instance of Classifier"); //$NON-NLS-1$
         }
-        Collection result = new ArrayList();
+        Collection<Property> result = new ArrayList<Property>();
         for (Property p : ((Classifier) handle).getAttributes()) {
             if (p.getAssociation() != null) {
                 result.add(p);
@@ -295,7 +278,7 @@
         // TODO: In UML 2.0, ClassifierRole, AssociationRole, and
         // AssociationEndRole have been replaced by the internal 
         // structure of the Collaboration
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     public List<Property> getAttributes(Object handle) {
@@ -319,26 +302,19 @@
         if (handle instanceof Extend) {
             return ((Extend) handle).getExtendedCase();
         } else if (handle instanceof Include) {
-            return ((Include) handle).getAddition();
+            return ((Include) handle).getIncludingCase();
         }
         throw new NotYetImplementedException();
     }
 
     public Collection<String> getBaseClasses(Object handle) {
-        if (isAStereotype(handle)) {
-            // TODO: it's an implementation, but is it correct? - thn
-            EList<Class> eList =
-                ((Stereotype) handle).getAllExtendedMetaclasses();
-            ArrayList<String> list = new ArrayList<String>();
-            Iterator iter = eList.iterator();
-            while (iter.hasNext()) {
-                list.add(((Class) iter.next()).getName());
+        Collection<String> result = new ArrayList<String>();
+        for (org.eclipse.uml2.uml.Class metaclass 
+                : ((Stereotype) handle).getAllExtendedMetaclasses()) {
+            result.add(metaclass.getName());
             }
-            return list;
+        return result;
         }
-        throw new IllegalArgumentException(
-                "handle must be instance of Stereotype"); //$NON-NLS-1$
-    }
 
     public Collection getBases(Object handle) {
         throw new NotYetImplementedException();
@@ -346,16 +322,12 @@
     }
 
     public Object getBehavioralFeature(Object handle) {
-        if (!(handle instanceof Parameter)) {
-            throw new IllegalArgumentException(
-                    "handle must be instance of Parameter"); //$NON-NLS-1$
-        }
         return ((Parameter) handle).getOperation();
     }
 
     public Collection getBehaviors(Object handle) {
         // TODO:
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     public Object getBinding(Object handle) {
@@ -418,10 +390,6 @@
     }
 
     public Object getSpecific(Object handle) {
-        if (!(handle instanceof Generalization)) {
-            throw new IllegalArgumentException(
-                    "handle must be instance of Generalization"); //$NON-NLS-1$
-        }
         return ((Generalization) handle).getSpecific();
     }
     
@@ -430,15 +398,14 @@
     }
 
     public Object getClassifier(Object handle) {
-        Property prop = (Property) handle;
-        return prop.getType();
+        return ((Property) handle).getType();
     }
 
     public Collection getClassifierRoles(Object handle) {
         // TODO: In UML 2.0, ClassifierRole, AssociationRole, and
         // AssociationEndRole have been replaced by the internal 
         // structure of the Collaboration
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     public Collection getClassifiers(Object handle) {
@@ -654,7 +621,6 @@
 	    }
 	}
 	return result;
-        // throw new NotYetImplementedException();
     }
 
     public Collection getElementResidences(Object handle) {
@@ -683,9 +649,12 @@
     }
 
     public Collection getExtendedElements(Object handle) {
+//        public Collection<Element> getExtendedElements(Object handle) {
         if (!(handle instanceof Stereotype)) {
             throw new IllegalArgumentException();
         }
+        
+        // TODO: Is this returning extended elements or base classes?
         EList<Class> eList = ((Stereotype) handle).getExtendedMetaclasses();
         ArrayList<Class> list = new ArrayList<Class>();
         Iterator iter = eList.iterator();
@@ -693,6 +662,17 @@
             list.add((Class) iter.next());
         }
         return list;
+        
+        // TODO: Untested alternative to investigate
+//        Collection<Element> result = new ArrayList<Element>();
+//        TreeIterator it = modelImpl.getEditingDomain().getResourceSet().getAllContents();
+//        while (it.hasNext()) {
+//            Object o = it.next();
+//            if (handle.getClass().isAssignableFrom(o.getClass())) {
+//                result.add((Element) o);
+//            }
+//        }
+//        return result;
     }
 
     public Collection getExtenders(Object handle) {
@@ -704,8 +684,22 @@
         if (handle instanceof UseCase) {
             return ((UseCase) handle).getExtends();
         } else if (handle instanceof ExtensionPoint) {
-            // TODO:
-            throw new NotYetImplementedException();
+            ExtensionPoint ep = (ExtensionPoint) handle;
+            Collection<Extend> result = new ArrayList<Extend>();
+            // Can't be done in the general case of federated repositories, 
+            // but at least get what we can find for the current resource set
+            TreeIterator<Notifier> ti = 
+                ep.eResource().getResourceSet().getAllContents();            
+            while (ti.hasNext()) {
+                Notifier elem = ti.next();
+                if (elem instanceof Extend) {
+                    Extend extend = (Extend) elem;
+                    if (extend.getExtensionLocations().contains(ep)) {
+                        result.add(extend);
+                    }
+                }
+            }
+            return result;
         }
         throw new IllegalArgumentException();
     }
@@ -820,7 +814,7 @@
     public Collection getInstances(Object handle) {
         // TODO: InstanceSpecification -> Classifier association isn't
         // navigable in this direction
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     public Object getInteraction(Object handle) {
@@ -862,12 +856,12 @@
 
     public Collection getLinks(Object handle) {
         // TODO: no Links in UML 2
-        return Collections.EMPTY_SET;
+        return Collections.emptySet();
     }
 
     public String getLocation(Object handle) {
         // TODO: Removed from UML2
-        return "";
+        return ""; //$NON-NLS-1$
     }
 
     public int getLower(Object handle) {
@@ -889,26 +883,31 @@
         throw new NotYetImplementedException();
     }
 
-    public Object getInnerContainingModel(Object handle) {
+    public Element getInnerContainingModel(Object handle) {
         if (!(handle instanceof Element)) {
             throw new IllegalArgumentException();
         }
-        return ((Element) handle).getModel();        
+        // TODO: What is the behavior of this in the case of nested models?
+        Element result = ((Element) handle).getModel();
+        if (result == null) {
+            result = getOutermostOwner((Element) handle);
+        }
+        return result;
+    }
+    
+    private Element getOutermostOwner(Element element) {
+        Element result = element;
+        while (result.getOwner() != null) {
+            result = result.getOwner();
+        }
+        return result;
     }
     
-    public Object getRoot(Object handle) {
+    public Element getRoot(Object handle) {
         if (!(handle instanceof Element)) {
             throw new IllegalArgumentException();
         }
-        Object root = ((Element) handle).getModel();
-        if (root == null) {
-            // root is not a model, so we climb up the owners
-            root = handle;
-            while (((Element) root).getOwner() != null) {
-                root = ((Element) root).getOwner();
-            }
-        }
-        return root;
+        return getOutermostOwner((Element) handle);
     }
 
     public Object getModelElement(Object handle) {
@@ -962,11 +961,10 @@
         } else {
             // TODO: Some elements such as Generalization are
             // no longer named.  For a transitional period we'll
-            // return a String to debug can continue, but the
+            // return a String so debug can continue, but the
             // calling code should probably be fixed. - tfm 20070607
-            return handle.toString();
+            return getUMLClassName(handle) + " <not nameable>";
         }
-//        throw new IllegalArgumentException();
     }
 
     public Object getNamespace(Object handle) {
@@ -1045,11 +1043,11 @@
         throw new NotYetImplementedException();
     }
 
-    public Collection getOtherAssociationEnds(Object handle) {
+    public Collection<Property> getOtherAssociationEnds(Object handle) {
         if (!isAAssociationEnd(handle)) {
             throw new IllegalArgumentException();
         }
-        List l = new ArrayList(
+        Collection<Property> l = new ArrayList<Property>(
                 ((Property) handle).getAssociation().getMemberEnds());
         l.remove(handle);
         return l;
@@ -1262,7 +1260,10 @@
 
     }
 
-    public Collection getSources(Object handle) {
+    public Collection getSources(Object element) {
+        if (element instanceof DirectedRelationship) {
+            return ((DirectedRelationship) element).getSources();
+        }
         throw new NotYetImplementedException();
 
     }
@@ -1292,7 +1293,7 @@
         if (handle instanceof Property) {
             // TODO: unimplemented
 //          return ((Property) handle).gets
-            return Collections.EMPTY_SET;
+            return Collections.emptySet();
         } else if (handle instanceof org.eclipse.uml2.uml.Class) {
             return ((org.eclipse.uml2.uml.Class) handle).getInterfaceRealizations();
         }
@@ -1304,7 +1305,7 @@
         throw new NotYetImplementedException();
     }
 
-    public Object getStateMachine(Object handle) {
+    public StateMachine getStateMachine(Object handle) {
         if (handle instanceof Pseudostate) {
             return ((Pseudostate) handle).getStateMachine();
         } else if (handle instanceof Region) {
@@ -1317,10 +1318,7 @@
         throw new NotYetImplementedException();
     }
 
-    public Collection getStereotypes(Object handle) {
-        if (!(handle instanceof Element)) {
-            throw new IllegalArgumentException();
-        }
+    public Collection<Stereotype> getStereotypes(Object handle) {
         return ((Element) handle).getAppliedStereotypes();
     }
 
@@ -1381,7 +1379,7 @@
 
     }
 
-    public Collection getTagDefinitions(Object handle) {
+    public Collection<Property> getTagDefinitions(Object handle) {
         if (!(handle instanceof Stereotype)) {
             throw new IllegalArgumentException();
         }
@@ -1708,7 +1706,7 @@
     }
 
     public boolean isACreateAction(Object handle) {
-        // Double check - tfm
+        // TODO: Double check - tfm
         return handle instanceof CreateObjectAction;
     }
 
@@ -2051,7 +2049,8 @@
     }
 
     public boolean isATemplateArgument(Object handle) {
-        throw new NotYetImplementedException();
+        // TODO: Not exact, but close
+        return handle instanceof TemplateParameterSubstitution;
     }
 
     public boolean isATemplateParameter(Object handle) {
@@ -2234,10 +2233,13 @@
     }
 
     public boolean isStereotype(Object handle, String stereotypename) {
-        throw new NotYetImplementedException();
+        return ((Element) handle).getAppliedStereotype(stereotypename) != null;
     }
 
     public boolean isSynch(Object handle) {
+        if (handle instanceof CallAction) {
+            return ((CallAction) handle).isSynchronous();
+        }
         throw new NotYetImplementedException();
     }
 
@@ -2279,7 +2281,7 @@
         Namespace ns = (Namespace) handle;
 
         for (;;) {
-            int idx = sb.indexOf("::");
+            int idx = sb.indexOf("::"); //$NON-NLS-1$
 
             if (idx != -1) {
                 NamedElement subspace = getElementByName(ns, sb.substring(
@@ -2336,19 +2338,42 @@
     }
 
     public String[] getMetatypeNames() {
-        // TODO: Auto-generated method stub
-        throw new NotYetImplementedException();
+        Resource resource = modelImpl
+                .getEditingDomain()
+                .getResourceSet()
+                .getResource(URI.createURI(UMLResource.UML_METAMODEL_URI), true);
+        
+        Model metamodel = (Model) EcoreUtil.getObjectByType(resource
+                .getContents(), UMLPackage.Literals.PACKAGE);
+        
+        List<String> result = new ArrayList<String>();
+        for (Type t : metamodel.getOwnedTypes()) {
+            result.add(t.getName());
+        }
+        return result.toArray(new String[0]);
     }
 
     public boolean isA(String metatypeName, Object element) {
         return getUMLClassName(element).equals(metatypeName);
     }
 
-    public Collection getTargets(Object handle) {
-        // TODO: Auto-generated method stub
-        throw new NotYetImplementedException();
+    Namespace getImportingNamespace(Object element) {
+        if (element instanceof PackageImport) {
+            return ((PackageImport) element).getImportingNamespace();
+        } else if (element instanceof ElementImport) {
+            return ((ElementImport) element).getImportingNamespace();
+        }
+        throw new IllegalArgumentException("Element must be one of PackageImport or ElementImport");
+    }
+    
+    org.eclipse.uml2.uml.Package getImportedPackage(Object element) {
+        return ((PackageImport) element).getImportedPackage();
     }
 
+    public Collection<Element> getTargets(Object element) {
+        return ((DirectedRelationship) element).getTargets();
+    }
+    
     public boolean isADirectedRelationship(Object handle) {
         return handle instanceof DirectedRelationship;
     }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/MetaTypesEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,15 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -379,7 +352,7 @@
         String name = clazz.getName();
 
         // The name of the meta type is the class name (after the last .)
-        // and before the next $ or end of class name.
+        // and before the "Impl" or end of class name.
         int startName = name.lastIndexOf('.') + 1;
 
         // Eclipse UML2 implementation classes often start with "UML"
@@ -415,6 +388,8 @@
     public Object getObject() {
         // is used as InstanceSpecification, see UMLDeploymentDiagram
         return org.eclipse.uml2.uml.InstanceSpecification.class;
+        // TODO: what about ObjectNode?
+//        return org.eclipse.uml2.uml.ObjectNode.class;        
     }
 
     public Object getObjectFlowState() {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.beans.PropertyChangeEvent;
@@ -57,7 +29,6 @@
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.AttributeChangeEvent;
 import org.argouml.model.DeleteInstanceEvent;
-import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
 import org.eclipse.emf.common.command.CommandStackListener;
 import org.eclipse.emf.common.notify.Notification;
@@ -76,6 +47,7 @@
     /**
      * A list of model elements that when removed should not create delete
      * events. See issue 
+
      */
     final private List<Property> deleteEventIgnoreList =
         new ArrayList<Property>();
@@ -325,10 +297,6 @@
                 + " New: " + newValue //$NON-NLS-1$
                 + " From: " + notification.getNotifier()); //$NON-NLS-1$
         
-        if (featureName.equals("navigableOwnedEnd")) { //$NON-NLS-1$
-            featureName = "navigableOwnedEnd"; //$NON-NLS-1$
-        }
-        
         class EventAndListeners {
             public EventAndListeners(PropertyChangeEvent e,
                     List<PropertyChangeListener> l) {
@@ -452,11 +420,12 @@
     }
     
     /**
-     * Determine of we should create a delete event for the given property
+     * Determine if we should create a delete event for the given property
      * when EMF tells us it has been removed. This is currently used to
      * work around the problem discussed in issue 5853.
+     * 
      * @param element
-     * @return
+     * @return true if 
      */
     private boolean isDeleteEventRequired(
             final Object element) {
@@ -471,6 +440,12 @@
         return true;
     }
     
+    /**
+     * Add Element to list which will cause the next delete event to
+     * be ignored.
+     * 
+     * @param property
+     */
     void addElementForDeleteEventIgnore(Property property) {
         synchronized (deleteEventIgnoreList) {
             deleteEventIgnoreList.add(property);

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,41 +1,16 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - Undo support
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -49,8 +24,8 @@
 import org.eclipse.uml2.uml.ElementImport;
 import org.eclipse.uml2.uml.Model;
 import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.Package;
 import org.eclipse.uml2.uml.PackageableElement;
+import org.eclipse.uml2.uml.Profile;
 import org.eclipse.uml2.uml.UMLFactory;
 
 
@@ -67,7 +42,7 @@
     
     private EditingDomain editingDomain;
     
-    private Package theRootModel;
+    private org.eclipse.uml2.uml.Package theRootModel;
 
     /**
      * Constructor.
@@ -83,15 +58,9 @@
 
     public ElementImport buildElementImport(final Object pack, 
             final Object me) {
+        UMLUtil.checkArgs(new Object[] {pack, me}, 
+                new Class[] {Namespace.class, PackageableElement.class});
         
-        if (!(pack instanceof Namespace)) {
-            throw new IllegalArgumentException(
-                    "pack must be instance of Namespace"); //$NON-NLS-1$
-        }
-        if (!(me instanceof PackageableElement)) {
-            throw new IllegalArgumentException(
-                    "me must be instance of PackageableElement"); //$NON-NLS-1$
-        }
         RunnableClass run = new RunnableClass() {
             public void run() {
                 ElementImport elementImport = createElementImport();
@@ -107,12 +76,20 @@
     }
 
 
-    public Package buildPackage(String name) {
-        Package pkg = (Package) createPackage();
+    public org.eclipse.uml2.uml.Package buildPackage(final String name) {
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                org.eclipse.uml2.uml.Package pkg =
+                    (org.eclipse.uml2.uml.Package) createPackage();
         if (name != null) {
             pkg.setName(name);
         }
-        return pkg;
+            getParams().add(pkg);
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+        return (org.eclipse.uml2.uml.Package) run.getParams().get(0);
     }
     
     public Object copyPackage(Object source, Object ns) {
@@ -121,22 +98,50 @@
     }
 
     public ElementImport createElementImport() {
-        return UMLFactory.eINSTANCE.createElementImport();
+       RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createElementImport());
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+        return (ElementImport) run.getParams().get(0);
     }
 
     public Model createModel() {
         // TODO: Check for Resource to hold this and create if necessary?
         // This is a discrepancy between MDR which does it here and eUML which
         // does it as part of setRootModel
-        return UMLFactory.eINSTANCE.createModel();
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createModel());
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+        return (Model) run.getParams().get(0);
     }
 
-    public Package createPackage() {
-        return UMLFactory.eINSTANCE.createPackage();
+    public org.eclipse.uml2.uml.Package createPackage() {
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createPackage());
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+        return (org.eclipse.uml2.uml.Package) run.getParams().get(0);
     }
 
-    public Package createProfile() {
-        return UMLFactory.eINSTANCE.createProfile();
+    public Profile createProfile() {
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                getParams().add(UMLFactory.eINSTANCE.createProfile());
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+        return (Profile) run.getParams().get(0);
     }
 
     @Deprecated
@@ -147,13 +152,14 @@
 
     // TODO: get/setRootModel aren't specific to the Model implementation
     // they could probably be moved elsewhere - tfm - 20070530
+    @Deprecated
     public void setRootModel(Object rootModel) {
         // TODO: Hook this creating of a new resource in to someplace more
         // more appropriate (perhaps createModel() ?)
         // Better yet add a new method to Model API to create a new top level 
         // project/model/xmi file so we don't depend on side effects
         if (rootModel != null 
-                && !(rootModel instanceof Package)) {
+                && !(rootModel instanceof org.eclipse.uml2.uml.Package)) {
             throw new IllegalArgumentException(
                     "The rootModel supplied must be a Package. Got a " //$NON-NLS-1$
                     + rootModel.getClass().getName());
@@ -161,7 +167,7 @@
 	if (theRootModel != null && theRootModel.eResource() != null) {
 	    EcoreUtil.remove(theRootModel);
 	}
-        theRootModel = (Package) rootModel;
+        theRootModel = (org.eclipse.uml2.uml.Package) rootModel;
 	if (rootModel != null) {
             Resource r = UMLUtil.getResource(modelImpl, UMLUtil.DEFAULT_URI, 
                     Boolean.FALSE);
@@ -170,7 +176,8 @@
         modelImpl.getModelEventPump().setRootContainer(theRootModel);
     }
 
-    public Package getRootModel() {
+    @Deprecated
+    public org.eclipse.uml2.uml.Package getRootModel() {
         return theRootModel;
     }
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ModelManagementHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,49 +1,21 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework 
+ *    Bogdan Pistol - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Vector;
 
 import org.argouml.model.ModelManagementHelper;
 import org.eclipse.uml2.uml.Classifier;
@@ -135,7 +107,8 @@
                     "type must be instance of Class or String"); //$NON-NLS-1$
         }
         if (!Element.class.isAssignableFrom(theType)) {
-            throw new IllegalArgumentException("type must represent an Element"); //$NON-NLS-1$
+            throw new IllegalArgumentException(
+                    "type must represent an Element"); //$NON-NLS-1$
         }
 
         Collection<Element> result = new ArrayList<Element>();

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/NotYetImplementedException.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial API and implementation
+ *******************************************************************************/
 
 package org.argouml.model.euml;
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/OrderingKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/OrderingKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/OrderingKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/OrderingKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,41 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 
 package org.argouml.model.euml;
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/PseudostateKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/PseudostateKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/PseudostateKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/PseudostateKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 
 package org.argouml.model.euml;
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RootContainerAdapter.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RootContainerAdapter.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RootContainerAdapter.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007, 2008 Bogdan Pistol and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the ArgoUML Project nor the
-//       names of its contributors may be used to endorse or promote products
-//       derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE ArgoUML PROJECT ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE ArgoUML PROJECT BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.ArrayList;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RunnableClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RunnableClass.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RunnableClass.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/RunnableClass.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Bogdan Pistol and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.ArrayList;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ScopeKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ScopeKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ScopeKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/ScopeKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -49,14 +21,17 @@
  * @deprecated This is no longer used in UML 2.  We return literal placeholder
  * values for any code that still uses this.
  */
+@Deprecated
 class ScopeKindEUMLImpl implements ScopeKind {
 
+    @Deprecated
     public Object getClassifier() {
-        return "classifier";
+        return "classifier"; //$NON-NLS-1$
     }
 
+    @Deprecated
     public Object getInstance() {
-        return "instance";
+        return "instance"; //$NON-NLS-1$
     }
 
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial framework 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AbstractModelFactory;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/StateMachinesHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.Collection;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UMLUtil.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UMLUtil.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UMLUtil.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UMLUtil.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Bogdan Pistol and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Bogdan Pistol - initial API and implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.eclipse.emf.common.command.Command;
@@ -120,7 +92,7 @@
         };
         copyCommand.append(copyToClipboard);
         copyCommand.append(pasteFromClipboard);
-        copyCommand.setLabel("Copy a tree of UML elements to a destination");
+        copyCommand.setLabel("Copy a tree of UML elements to a destination"); //$NON-NLS-1$
         if (copyCommand.canExecute()) {
             modelImplementation.getModelEventPump().getRootContainer().setHoldEvents(
                     true);
@@ -191,9 +163,9 @@
     static Resource getResource(
             EUMLModelImplementation modelImplementation, URI uri,
             boolean readOnly) {
-        if (!"xmi".equals(uri.fileExtension())) {
+        if (!"xmi".equals(uri.fileExtension())) { //$NON-NLS-1$
             // Make sure we have a recognized file extension
-            uri = uri.appendFileExtension("xmi");
+            uri = uri.appendFileExtension("xmi"); //$NON-NLS-1$
         }
         Resource r = modelImplementation.getEditingDomain().getResourceSet()
                 .getResource(uri, false);
@@ -202,11 +174,25 @@
                     .createResource(uri);
         }
         if (r == null) {
-            throw new NullPointerException("Failed to create resource for URI " + uri);
+            throw new NullPointerException("Failed to create resource for URI "  //$NON-NLS-1$
+                    + uri);
         }
         modelImplementation.getReadOnlyMap().put(r, Boolean.valueOf(readOnly));
         return r;
     }
 
 
+    @SuppressWarnings("unchecked")
+    static void checkArgs(Object[] args, Class[] types) {
+        if (args.length != types.length) {
+            throw new IllegalArgumentException(
+                    "Mismatched array lengths for args and types"); //$NON-NLS-1$
+        }
+        for (int i = 0; i < args.length; i++) {
+            if (!types[i].isAssignableFrom(args[i].getClass())) {
+                throw new IllegalArgumentException(
+                        "Parameter " + i + " must be of type " + types[i]);  //$NON-NLS-1$//$NON-NLS-2$
+            }
+        }
+    }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,46 +1,22 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial framework
+ *    Bogdan Pistol - initial implementation
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the ArgoUML Project nor the
-//       names of its contributors may be used to endorse or promote products
-//       derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE ArgoUML PROJECT ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE ArgoUML PROJECT BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Bob Tarling
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -65,6 +41,7 @@
 import org.eclipse.uml2.uml.DataType;
 import org.eclipse.uml2.uml.Dependency;
 import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ElementImport;
 import org.eclipse.uml2.uml.Enumeration;
 import org.eclipse.uml2.uml.EnumerationLiteral;
 import org.eclipse.uml2.uml.Extend;
@@ -112,14 +89,15 @@
      * A map of valid connections keyed by the connection type. The constructor
      * builds this from the data in the VALID_CONNECTIONS array
      */
-    private Map validConnectionMap = new HashMap();
+    private Map<Class<? extends Element>, List> validConnectionMap = 
+        new HashMap<Class<? extends Element>, List>();
     
     /**
      * A map of the valid model elements that are valid to be contained 
      * by other model elements.
      */
-    private HashMap<Class<?>, Class<?>[]> validContainmentMap = 
-        new HashMap<Class<?>, Class<?>[]>();
+    private HashMap<Class<? extends Element>, Class<?>[]> validContainmentMap = 
+        new HashMap<Class<? extends Element>, Class<?>[]>();
     
     /**
      * An array of valid connections, the combination of connecting class and
@@ -147,7 +125,7 @@
      */
     // TODO: This should be built by reflection from the metamodel - tfm
     //       Update for UML 2.x metamodel if not replaced by reflection
-    private static final Object[][] VALID_CONNECTIONS = {
+    private static final Class[][] VALID_CONNECTIONS = {
         {Generalization.class,   Classifier.class, },
         {Dependency.class,       Element.class, },
         // Although Usage & Permission are Dependencies, they need to
@@ -193,7 +171,8 @@
             Object unidirectional, Object namespace)
             throws IllegalModelElementConnectionException {
 
-        IllegalModelElementConnectionException exception = new IllegalModelElementConnectionException(
+        IllegalModelElementConnectionException exception = 
+            new IllegalModelElementConnectionException(
                 "Cannot make a " + elementType.getClass().getName() //$NON-NLS-1$
                         + " between a " + fromElement.getClass().getName() //$NON-NLS-1$
                         + " and a " + toElement.getClass().getName()); //$NON-NLS-1$
@@ -378,7 +357,7 @@
         };
         modelImpl.getEditingDomain().getCommandStack().execute(
                 new ChangeCommand(
-                        modelImpl, run, "Remove from the model the element #",
+                        modelImpl, run, "Remove from the model the element #", //$NON-NLS-1$
                         elem));
     }
     
@@ -429,6 +408,8 @@
     }
     
     // TODO: Can we get this info from UML2 plugin?
+    // Perhaps collect all References in the metamodel, filter for those
+    // which represent containments and find the types on either end - tfm
     public boolean isContainmentValid(Object metaType, Object container) {
         
         // find the passed in container in validContainmentMap
@@ -486,7 +467,7 @@
         // A list of valid connections between elements, the
         // connection type first and then the elements to be connected
 
-        Object connection = null;
+        Class<Element> connection = null;
         for (int i = 0; i < VALID_CONNECTIONS.length; ++i) {
             connection = VALID_CONNECTIONS[i][0];
             List validItems = (ArrayList) validConnectionMap.get(connection);
@@ -546,15 +527,10 @@
                 Signal.class
             });
                 
-        // specifies valid elements for a Profile to contain
+        // valid elements for a Profile to contain
         validContainmentMap.put(Profile.class, 
             new Class<?>[] {
-                Profile.class, Package.class, Actor.class,
-                UseCase.class, org.eclipse.uml2.uml.Class.class,
-                Interface.class, Component.class,
-                Node.class, Stereotype.class,
-                Enumeration.class, DataType.class,
-                Signal.class
+                Stereotype.class, ElementImport.class, PackageImport.class
             });
                 
         // specifies valid elements for a class to contain
@@ -636,7 +612,7 @@
                     Parameter.class
                 });
 
-        // specifies valid elements for a Attribute to contain
+        // valid elements for a Stereotype to contain
         validContainmentMap.put(Stereotype.class,
                 new Class<?>[] {
                     Property.class
@@ -648,10 +624,15 @@
         if (resource != null) {
             modelImpl.unloadResource(resource);
         } else {
-            LOG.warn("Tried to delete null resource");
+            LOG.warn("Tried to delete null resource"); //$NON-NLS-1$
             throw new InvalidElementException(
-                    element != null ? element.toString() : "Null" );
+                    element != null ? element.toString() : "Null" ); //$NON-NLS-1$
         }
     }
 
+    public Collection getExtentPackages(String extentName) {
+        // TODO: Auto-generated method stub
+        return null;
+    }
+
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UmlHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,59 +1,39 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    bobtarling
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
+import java.util.List;
 
+import org.argouml.model.Model;
 import org.argouml.model.UmlHelper;
 import org.eclipse.uml2.uml.Action;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Enumeration;
 import org.eclipse.uml2.uml.EnumerationLiteral;
 import org.eclipse.uml2.uml.Extend;
 import org.eclipse.uml2.uml.ExtensionPoint;
+import org.eclipse.uml2.uml.Feature;
 import org.eclipse.uml2.uml.Operation;
 import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterSet;
 import org.eclipse.uml2.uml.Property;
 import org.eclipse.uml2.uml.Relationship;
 import org.eclipse.uml2.uml.Transition;
-
+import org.eclipse.uml2.uml.UseCase;
 
 /**
  * The implementation of the UmlHelper for EUML2.
@@ -122,7 +102,140 @@
         }
         throw new IllegalArgumentException();
     }
+
+   /*
+     * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)
+     */
+    public void move(Object parent, Object element, Direction direction) {
+        if (false) {
+            //TODO: More work require - code below is from MDR implementation
+//        if (element instanceof Argument) {
+//            final Argument arg = (Argument) element;
+//            final Action action = arg.getAction();
+//            final List<Argument> f = action.getActualArgument();
+//            final int oldIndex = f.indexOf(arg);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(arg);
+//            f.add(newIndex, arg);
+//        } else if (element instanceof Action) {
+//            final Action act = (Action) element;
+//            final ActionSequence actionSequence = act.getInGroups();
+//            final List<Action> f = actionSequence.getAction();
+//            final int oldIndex = f.indexOf(act);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(actionSequence);
+//            f.add(newIndex, actionSequence);
+//        } else if (element instanceof AssociationEnd) {
+//            final AssociationEnd assEnd = (AssociationEnd) element;
+//            final UmlAssociation assoc = assEnd.getAssociation();
+//            final List<AssociationEnd> f =  assoc.getConnection();
+//            final int oldIndex = f.indexOf(assEnd);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(assEnd);
+//            f.add(newIndex, assEnd);
+//        } else if (element instanceof Property && parent instanceof AssociationEnd) {
+//            final Attribute attr = (Attribute) element;
+//            final AssociationEnd assocEnd = attr.getAssociationEnd();
+//            final List<Attribute> f = assocEnd.getQualifier();
+//            final int oldIndex = f.indexOf(assocEnd);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(attr);
+//            f.add(newIndex, attr);
+        } else if (element instanceof Feature) {
+            final Feature att = (Feature) element;
+            final Element cls = att.getOwner();
+            final List f = Model.getFacade().getFeatures(cls);
+            final int oldIndex = f.indexOf(att);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            Model.getCoreHelper().removeFeature(cls, att);
+            Model.getCoreHelper().addFeature(cls, newIndex, att);
+
+        } else if (element instanceof Parameter && parent instanceof Behavior) {
+            final Parameter param = (Parameter) element;
+            final Behavior behavior = (Behavior) parent;
+            final List<Parameter> f = behavior.getOwnedParameters();
+            final int oldIndex = f.indexOf(param);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(param);
+            f.add(newIndex, param);
+        } else if (element instanceof Parameter && parent instanceof ParameterSet) {
+            final Parameter param = (Parameter) element;
+            final ParameterSet set = (ParameterSet) parent;
+            final List<Parameter> f = set.getParameters();
+            final int oldIndex = f.indexOf(param);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(param);
+            f.add(newIndex, param);
+            // UML 1.4 case
+//        } else if (element instanceof Parameter && parent instanceof Event) {
+//            final Parameter param = (Parameter) element;
+//            final Event event = (Event) parent;
+//            final List<Parameter> f = event.getParameter();
+//            final int oldIndex = f.indexOf(param);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(param);
+//            f.add(newIndex, param);
+        } else if (element instanceof Parameter) {
+            final Parameter param = (Parameter) element;
+            final Operation operation = param.getOperation();
+            final List<Parameter> f = operation.getOwnedParameters();
+            final int oldIndex = f.indexOf(param);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(param);
+            f.add(newIndex, param);
+        } else if (element instanceof EnumerationLiteral) {
+            final EnumerationLiteral lit = (EnumerationLiteral) element;
+            final Enumeration enumeration = lit.getEnumeration();
+            final List<EnumerationLiteral> f = enumeration.getOwnedLiterals();
+            final int oldIndex = f.indexOf(lit);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(lit);
+            f.add(newIndex, lit);
+        } else if (element instanceof ExtensionPoint && parent instanceof Extend) {
+            final ExtensionPoint ep = (ExtensionPoint) element;
+            final Extend extend = (Extend) parent;
+            final List<ExtensionPoint> f = extend.getExtensionLocations();
+            final int oldIndex = f.indexOf(ep);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(ep);
+            f.add(newIndex, ep);
+//        } else if (element instanceof LinkEnd) {
+//            final LinkEnd le = (LinkEnd) element;
+//            final Link link = le.getLink();
+//            final List f = new ArrayList(Model.getFacade().getConnections(link));
+//            final int oldIndex = f.indexOf(le);
+//            final int newIndex = newPosition(oldIndex, f.size(), direction);
+//            f.remove(le);
+//            f.add(newIndex, le);
+//            Model.getCoreHelper().setConnections(link, f);
+        } else if (element instanceof ExtensionPoint && parent instanceof UseCase) {
+            final ExtensionPoint ep = (ExtensionPoint) element;
+            final UseCase extend = ep.getUseCase();
+            final List f = new ArrayList(Model.getFacade().getExtensionPoints(extend));
+            final int oldIndex = f.indexOf(ep);
+            final int newIndex = newPosition(oldIndex, f.size(), direction);
+            f.remove(ep);
+            f.add(newIndex, ep);
+            Model.getUseCasesHelper().setExtensionPoints(ep, f);
+        }
+    }
     
+    private int newPosition(int index, int size, Direction direction) {
+        final int posn;
+        if (direction == Direction.DOWN) {
+            posn = index + 1;
+        } else if (direction == Direction.UP) {
+            posn = index - 1;
+        } else if (direction == Direction.TOP) {
+            posn = 0;
+        } else if (direction == Direction.BOTTOM) {
+            posn = size;
+        } else {
+            posn = 0;
+        }
+        return posn;
+    }
+
     /*
      * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)
      */
@@ -138,11 +251,5 @@
         return Arrays.asList(movableMetaType).contains(metaType);
     }
 
-    /*
-     * @see org.argouml.model.UmlHelper#move(java.lang.Object, org.argouml.model.UmlHelper.Direction)
-     */
-    public void move(Object parent, Object element, Direction direction) {
-        throw new NotYetImplementedException();
-    }
 
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesFactoryEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,58 +1,27 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework
+ *    Bogdan Pistol - Initial implementation 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.AbstractModelFactory;
-import org.argouml.model.NotImplementedException;
 import org.argouml.model.UseCasesFactory;
 import org.eclipse.uml2.uml.Actor;
 import org.eclipse.uml2.uml.Extend;
 import org.eclipse.uml2.uml.ExtensionPoint;
 import org.eclipse.uml2.uml.Include;
-import org.eclipse.uml2.uml.InstanceSpecification;
 import org.eclipse.uml2.uml.Namespace;
 import org.eclipse.uml2.uml.UMLFactory;
 import org.eclipse.uml2.uml.UseCase;
 
-
 /**
  * The implementation of the UseCasesFactory for EUML2.
  */

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/UseCasesHelperEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,15 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial framework
+ *    Bogdan Pistol - initial implementation 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.util.Collection;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/VisibilityKindEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/VisibilityKindEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/VisibilityKindEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/VisibilityKindEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,43 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+ *    Tom Morris - initial implementation 
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import org.argouml.model.VisibilityKind;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,42 +1,16 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris - initial implementation
+ *    Bogdan Pistol - undo support & UUID maps for diagrams
  *    thn
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-/// Copyright (c) 2007,2009 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *****************************************************************************/
 
 package org.argouml.model.euml;
 
@@ -55,11 +29,17 @@
 import java.util.Set;
 
 import org.apache.log4j.Logger;
+import org.argouml.model.NotImplementedException;
 import org.argouml.model.UmlException;
 import org.argouml.model.XmiReader;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.BasicFeatureMapEntry;
+import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry;
 import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.FeatureMap.Entry;
+import org.eclipse.emf.ecore.xml.type.AnyType;
+import org.eclipse.uml2.uml.Element;
 import org.xml.sax.InputSource;
 
 /**
@@ -89,20 +69,19 @@
     }
 
     public int getIgnoredElementCount() {
-        // TODO: Auto-generated method stub
         return 0;
     }
 
     public String[] getIgnoredElements() {
-        // TODO: Auto-generated method stub
+        // Not needed currently for UML 2
         return new String[0];
     }
 
-    public Map getXMIUUIDToObjectMap() {
+    public Map<String, Object> getXMIUUIDToObjectMap() {
         if (resource == null) {
             throw new IllegalStateException();
         }
-        Map<String, EObject> map = new HashMap<String, EObject>();
+        Map<String, Object> map = new HashMap<String, Object>();
         Iterator<EObject> it = resource.getAllContents();
         while (it.hasNext()) {
             EObject o  = it.next();
@@ -128,14 +107,14 @@
         if (name == null) {
             name = inputSource.toString();
         }
-        LOG.debug("Parsing " + name);
+        LOG.debug("Parsing " + name); //$NON-NLS-1$
         if (inputSource.getByteStream() != null) {
             is = inputSource.getByteStream();
         } else if (inputSource.getSystemId() != null) {
             try {
                 URL url = new URL(inputSource.getSystemId());
                 if (url != null) {
-                    LOG.debug("Parsing URL " + url);
+                    LOG.debug("Parsing URL " + url); //$NON-NLS-1$
                     is = url.openStream();
                     if (is != null) {
                         is = new BufferedInputStream(is);
@@ -153,6 +132,8 @@
             throw new UnsupportedOperationException();
         }
 
+        // TODO: Review - priority of public ID vs system ID has been reversed
+        // from original implementation
         String id = inputSource.getPublicId();
         if (id == null) {
             id = inputSource.getSystemId();
@@ -172,6 +153,13 @@
             modelImpl.getModelEventPump().stopPumpingEvents();
             r.unload();
             r.load(is, null);
+            // TODO: Some import-only UML 2 profiles trigger this - Investigate.
+//            if (!isUML2(r)) {
+//                throw new UmlException("Attempted to load non-UML 2.x file");
+//            }
+            if (isUML14(r)) {
+                throw new UmlException("Attempted to load UML 1.4 file"); //$NON-NLS-1$
+            }
         } catch (IOException e) {
             throw new UmlException(e);
         } finally {
@@ -185,15 +173,84 @@
             }
         }
         resource = r;
-        LOG.debug("Parsed resource " + resource 
-                + " with " + resource.getContents().size() + " elements");
+        LOG.debug("Parsed resource " + resource  //$NON-NLS-1$
+                + " with " + resource.getContents().size() + " elements"); //$NON-NLS-1$ //$NON-NLS-2$
         return r.getContents();
     }
 
-    public boolean setIgnoredElements(String[] elementNames) {
-        // TODO: Auto-generated method stub
+    /**
+     * Test whether this is a UML2 file. Returns as soon as the first UML2
+     * element is seen.
+     * 
+     * @param r resource containing loaded UML model
+     * @return true if any of the contained objects are instances of UML2
+     *         Element.
+     */
+    private boolean isUML2(Resource r) {
+        for (EObject eobj: r.getContents()) {
+            if (eobj instanceof Element) {
+                return true;
+            }
+        }
         return false;
     }
+    
+    /**
+     * Attempt to detect ArgoUML/NetBeans MDR style UML 1.4 XMI files. These can
+     * be loaded without complaint by EMF, but they won't do us any good.
+     * 
+     * @param r resource containing the loaded file
+     * @return true if XMI.header/XMI.metamodel contains xmi.name="UML" and
+     *         xmi.version="1.4"
+     */
+    private boolean isUML14(Resource r) {
+        for (EObject eobj : r.getContents()) {
+            if ("XMI.header".equals(eobj.eClass().getName())) { //$NON-NLS-1$
+                for (Entry e1 : ((AnyType) eobj).getMixed()) {
+                    if (e1 instanceof BasicFeatureMapEntry) {
+                        BasicFeatureMapEntry x1 = (BasicFeatureMapEntry) e1;
+                        String n1 = x1.getEStructuralFeature().getName();
+                        if ("XMI.metamodel".equals(n1)) { //$NON-NLS-1$
+                            AnyType v = (AnyType) x1.getValue();
+                            for (Entry e2 : v.getAnyAttribute()) {
+                                if (e2 instanceof SimpleFeatureMapEntry) {
+                                    SimpleFeatureMapEntry x = (SimpleFeatureMapEntry) e2;
+                                    String n = x.getEStructuralFeature().getName();
+                                    if ("xmi.name".equals(n)) { //$NON-NLS-1$
+                                        if (!("UML".equals((String) x.getValue()))) { //$NON-NLS-1$
+                                            LOG.warn("Tried to parse XMI file with "
+                                                            + "XMI.header/XMI.metamodel/xmi.name = "
+                                                            + (String) x.getValue());
+                                            return false;
+                                        }
+                                    } else if ("xmi.version".equals(n)) { //$NON-NLS-1$
+                                        String version = (String) x.getValue();
+                                        if (version != null
+                                                && version.startsWith("1.4")) { //$NON-NLS-1$
+                                            LOG.debug("Tried to parse XMI file with "
+                                                    + "XMI.header/XMI.metamodel/xmi.version = "
+                                                    + version);
+                                            return true;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    public boolean setIgnoredElements(String[] elementNames) {
+        if (elementNames == null) {
+            return true;
+        }
+        throw new NotImplementedException("setIgnoredElements not implemented for UML 2.x");
+        // TODO: Silently ignore instead?
+//        return false;
+    }
 
     public String getTagName() {
         if (resource == null) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	2010-04-18 11:31:50-0700
@@ -1,44 +1,14 @@
-/* $Id$
- *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+// $Id$
+/*******************************************************************************
+ * Copyright (c) 2007,2010 Tom Morris and other contributors
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
- *****************************************************************************
- *
- * Some portions of this file was previously release using the BSD License:
- */
-
-// Copyright (c) 2007,2008 Tom Morris and other contributors
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of the project or its contributors may be used 
-//       to endorse or promote products derived from this software without
-//       specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
-// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
+ *    Tom Morris - initial implementation
+ *******************************************************************************/
 package org.argouml.model.euml;
 
 import java.io.IOException;

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/.classpath?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/.classpath	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/.classpath	2010-04-18 11:31:50-0700
@@ -3,7 +3,7 @@
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="tests"/>
 	<classpathentry exported="true" kind="lib" path="lib/jmi.jar"/>
-	<classpathentry exported="true" kind="lib" path="lib/jmiutils.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/jmiutils.jar" sourcepath="tools/mdrsrc20050711.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/mdrapi.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/mof.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/nbmdr.jar"/>

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ExtensionMechanismsHelperMDRImpl.java	2010-04-18 11:31:50-0700
@@ -104,7 +104,7 @@
     
     public Collection<Stereotype> getStereotypes(Object ns) {
         if (!(ns instanceof Namespace)) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("A namespace was expected we got " + ns);
         }
         
         List<Stereotype> l = new ArrayList<Stereotype>();

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	2010-04-18 11:31:50-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *******************************************************************************
- * Copyright (c) 2010 Contributors - see below
+ * Copyright (c) 2005,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -4127,12 +4127,7 @@
                 if (ref == null) {
                     return mofId;
                 } else {
-                    String systemId = ref.getSystemId();
-                    if (systemId == null || systemId.equals("")) {
-                        return ref.getXmiId();
-                    } else {
-                        return systemId + "#" + ref.getXmiId();
-                    }
+                    return ref.getXmiId();
                 }
             }
         } catch (InvalidObjectException e) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/MDRModelImplementation.java	2010-04-18 11:31:50-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2005,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    Tom Morris
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -52,6 +52,7 @@
 import javax.jmi.model.ModelPackage;
 import javax.jmi.model.MofPackage;
 import javax.jmi.reflect.InvalidObjectException;
+import javax.jmi.reflect.RefObject;
 import javax.jmi.reflect.RefPackage;
 import javax.jmi.xmi.MalformedXMIException;
 
@@ -191,6 +192,12 @@
      */
     private Map<String, String> public2SystemIds = 
         Collections.synchronizedMap(new HashMap<String, String>());
+    
+    /**
+     * Index of objects keyed by system ID, then xmi.id within that file
+     */
+    private Map<String, Map<String, Object>> idToObject = 
+        Collections.synchronizedMap(new HashMap<String, Map<String, Object>>());
 
     private List<String> searchDirs = new ArrayList<String>();
     
@@ -198,9 +205,32 @@
     /**
      * Set of extents and their read-only status. 
      */
-    private Map<UmlPackage, Boolean> extents = 
-        new HashMap<UmlPackage, Boolean>(10, (float) .5);
+    private Map<UmlPackage, Extent> extents = 
+        new HashMap<UmlPackage, Extent>(10, (float) .5);
 
+    private class Extent {
+        int refCount = 0;
+        boolean readOnly = false;
+        String name;
+        
+        Extent(String name, boolean readOnly) {
+            this.name = name;
+            this.readOnly = readOnly;
+        }
+        
+        int getRefCount() {
+            return refCount;
+        }
+        
+        synchronized int decrementCount() {
+            return refCount--;
+        }
+        
+        synchronized int incrementCount() {
+            return refCount++;
+        }
+    }
+    
     /**
      * @return Returns the root UML Factory package for user model.
      * @deprecated for 0.26. Use RefObject.refOutermostPackage instead if at all
@@ -222,8 +252,8 @@
             synchronized (extents) {
                 UmlPackage extent = (UmlPackage) getRepository().createExtent(
                         name, getMofPackage());
-                extents.put(extent, Boolean.valueOf(readOnly));
-
+                extents.put(extent, new Extent(name,readOnly));
+                
                 if (!readOnly) {
                     // TODO: This will need to change when we support multiple
                     // user models.
@@ -252,6 +282,22 @@
         }
     }
 
+
+    /**
+     * Delete all extents except those for the UML metamodel and the 
+     * meta-meta model (ie MOF).
+     */
+    private void cleanExtents() {
+        String[] names = repository.getExtentNames();
+        for (String n : names) {
+            if (!MOF_EXTENT_NAME.equals(n) && !"MOF".equals(n)) {
+                RefPackage extent = repository.getExtent(n);
+                extent.refDelete();
+                LOG.debug("Deleting extent " + n);
+            }
+        }
+    }
+    
     void deleteExtent(UmlPackage extent) {
         synchronized (extents) {
             if (umlPackage.equals(extent)) {
@@ -267,8 +313,34 @@
 
     private void deleteExtentUnchecked(UmlPackage extent) {
         synchronized (extents) {
-            extents.remove(extent);
-            extent.refDelete();
+            Extent e = extents.get(extent);
+            if (e == null) {
+                LOG.warn("No listing for extent " + extent);
+                extent.refDelete();
+            } else {
+                if (e.decrementCount() == 0) {
+
+                    String name = extents.remove(extent).name;
+                    if (public2SystemIds.remove(name) == null) {
+                        if (!"model extent".equals(name)) {
+                            LOG.warn("No system id found for extent "
+                                    + (name == null ? "" : name) + " : "
+                                    + extent);
+                        }
+                    }
+                    if (idToObject.remove(name) == null) {
+                        if (!"model extent".equals(name)) {
+                            LOG.warn("No ID map found for extent "
+                                    + (name == null ? "" : name) + " : "
+                                    + extent);
+                        }
+                    }
+                    // TODO: Need to clean up objectToId
+                    // (can we do it based on modelelement delete
+                    // notifications?)
+                    extent.refDelete();
+                }
+            }
         }
     }
     
@@ -276,14 +348,18 @@
         return Collections.unmodifiableSet(extents.keySet());
     }
     
+    public UmlPackage getExtent(String name) {
+        return (UmlPackage) repository.getExtent(name);
+    }
+    
     boolean isReadOnly(Object extent) {
         synchronized (extents) {
-            Boolean result = extents.get(extent);
+            Extent result = extents.get(extent);
             if (result == null) {
-                LOG.warn("Unable to find extent " + extent);
+//                LOG.warn("Unable to find extent " + extent);
                 return false;
-            }
-            return result.booleanValue();
+            } 
+            return result.readOnly;
         }
     }
     
@@ -347,6 +423,7 @@
     public MDRModelImplementation() throws UmlException {
         this(getDefaultRepository());
 
+        cleanExtents();
         createDefaultExtent();
         if (umlPackage == null) {
             throw new UmlException("Could not create UML extent");
@@ -774,14 +851,55 @@
     }
 
     /**
-     * Return the Object to ID Map.
+     * Return map of MOF ID to XmiReference (system id + xmi.id).
      *
      * @return the map
      */
-    protected Map<String, XmiReference> getObjectToId() {
+    Map<String, XmiReference> getObjectToId() {
         return objectToId;
     }
+
+    /**
+     * Return map of maps keyed first by system id, then xmi.id with object as
+     * value.
+     * 
+     * @return the map
+     */
+    Map<String, Map<String, Object>> getIdToObject() {
+        return idToObject;
+    }
     
+    /**
+     * Remove an element from indexes mapping it back to its original xmi.id.
+     * 
+     * @param mofId MOF ID of element to be removed from indexes
+     * @return false if no index entries were removed
+     */
+    boolean removeElement(String mofId) {
+        XmiReference xref = objectToId.remove(mofId);
+        if (xref != null) {
+            Map<String,Object> m = idToObject.get(xref.getSystemId());
+            if (m != null) {
+                Object o = m.remove(xref.getXmiId());
+                if (o != null) {
+                    if (!mofId.equals(((RefObject) o).refMofId())) {
+                        LOG.error("Internal index inconsistency for mof ID " 
+                                + mofId + " (got " + ((RefObject) o).refMofId());
+                    }
+                    return true;
+                }
+            }
+        }
+        // Elements created after file load won't have index entries
+        LOG.debug("Failed to remove index entries for mof ID " + mofId);
+        return false;
+    }
+    
+    /**
+     * Return map of MOF ID to XmiReference (system id + xmi.id).
+     *
+     * @return the map
+     */
     Map<String, String> getPublic2SystemIds() {
         return public2SystemIds;
     }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelEventPumpMDRImpl.java	2010-04-18 11:31:50-0700
@@ -1,13 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2005,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
- *    tfmorris
+ *    Tom Morris
  *****************************************************************************
  *
  * Some portions of this file was previously release using the BSD License:
@@ -284,6 +284,9 @@
             InstanceEvent ie = (InstanceEvent) mdrEvent;
             events.add(new DeleteInstanceEvent(ie.getSource(),
                     "remove", null, null, mdrEvent));
+            // Clean up index entries
+            String mofid = ((InstanceEvent)mdrEvent).getInstance().refMofId();
+            modelImpl.removeElement(mofid);
         } else if (mdrEvent instanceof AssociationEvent) {
             AssociationEvent ae = (AssociationEvent) mdrEvent;
             if (ae.isOfType(AssociationEvent.EVENT_ASSOCIATION_ADD)) {
@@ -836,8 +839,10 @@
         boolean added = names.get(typeName).add(propertyName);
         if (LOG.isDebugEnabled()) {
             if (!added) {
-                LOG.debug("Duplicate property name found - " + typeName + ":"
-                        + propertyName);
+                // Because we map both ends of an association we'll see many
+                // names twice
+//                LOG.debug("Duplicate property name found - " + typeName + ":"
+//                        + propertyName);
             } else {
                 LOG.debug("Added property name - " + typeName + ":"
                         + propertyName);

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlFactoryMDRImpl.java	2010-04-18 11:31:50-0700
@@ -39,6 +39,7 @@
 package org.argouml.model.mdr;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -1617,5 +1618,13 @@
             throw new InvalidElementException(e);
         }
     }
+    
+    public Collection getExtentPackages(String name) {
+        org.omg.uml.UmlPackage pkg = modelImpl.getExtent(name);
+        if (pkg == null) {
+            return null;
+        }
+        return pkg.getModelManagement().getUmlPackage().refAllOfType();
+    }
 
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReaderImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReaderImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReaderImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReaderImpl.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,14 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2005,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Bob Tarling
+ *    Tom Morris
  *    euluis
  *****************************************************************************
  *
@@ -45,7 +47,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -147,9 +148,9 @@
         
         Collection<RefObject> newElements = Collections.emptyList();
 
-        String extentBase = inputSource.getSystemId();
+        String extentBase = inputSource.getPublicId();
         if (extentBase == null) {
-            extentBase = inputSource.getPublicId();
+            extentBase = inputSource.getSystemId();
         }
         if (extentBase == null) {
             extentBase = MDRModelImplementation.MODEL_EXTENT_NAME;
@@ -177,11 +178,29 @@
             config.setUnknownElementsListener(this);
             config.setUnknownElementsIgnored(true);
 
+            String pId = inputSource.getPublicId();
+            String sId = modelImpl.getPublic2SystemIds().get(pId);
+            if (sId != null) {
+                if (sId.equals(inputSource.getSystemId())) {
+                    LOG.info("Attempt to reread profile - ignoring - "
+                            + "publicId = \"" + pId + "\";  systemId = \""
+                            + sId + "\".");
+                    return Collections.emptySet();
+                } else {
+                    throw new UmlException("Profile with the duplicate publicId "
+                            + "is being loaded! publicId = \"" + pId
+                            + "\"; existing systemId = \""
+                            + modelImpl.getPublic2SystemIds().get(pId)
+                            + "\"; new systemId = \"" + sId + "\".");
+                }
+            }
             resolver = new XmiReferenceResolverImpl(new RefPackage[] {extent},
                     config, modelImpl.getObjectToId(), 
-                    modelImpl.getPublic2SystemIds(), modelImpl.getSearchPath(), 
+                    modelImpl.getPublic2SystemIds(), modelImpl.getIdToObject(), 
+                    modelImpl.getSearchPath(), 
                     readOnly, 
-                    inputSource.getPublicId(), inputSource.getSystemId());
+                    inputSource.getPublicId(), inputSource.getSystemId(),
+                    modelImpl);
             config.setReferenceResolver(resolver);
             config.setHeaderConsumer(this);
             
@@ -221,9 +240,16 @@
 
             try {
                 String systemId = inputSource.getSystemId();
-                File file = copySource(inputSource);
-                systemId = file.toURI().toURL().toExternalForm();
-                inputSource = new InputSource(systemId);
+                // If we've got a streaming input, copy it to make sure we'll
+                // be able to rewind it if necessary
+                if (inputSource.getByteStream() != null
+                        || inputSource.getCharacterStream() != null) {
+                    File file = copySource(inputSource);
+                    systemId = file.toURI().toURL().toExternalForm();
+                    String publicId = inputSource.getPublicId();
+                    inputSource = new InputSource(systemId);
+                    inputSource.setPublicId(publicId);                    
+                }
                 MDRepository repository = modelImpl.getRepository();
                 
                 // Use a transaction to avoid the performance penalty (3x) of 
@@ -321,19 +347,6 @@
         return newElements;
     }
 
-    
-    private void deleteElements(Collection<RefObject> elements) {
-        Collection<RefObject> toDelete = new ArrayList<RefObject>(elements);
-        for (RefObject refObject : toDelete) {
-            try {
-                refObject.refDelete();
-            } catch (InvalidObjectException e) {
-                // Just continue.  We tried to delete something 
-                // twice, probably because it was contained in 
-                // another element that we already deleted.
-            }
-        }
-    }
 
     private Collection<RefObject> convertAndLoadUml13(String systemId,
             RefPackage extent, XMIReader xmiReader, InputSource input)
@@ -350,6 +363,7 @@
         // InputSource xformedInput = chainedTransform(transformFiles, pIs);
         InputSource xformedInput = serialTransform(transformFiles,
                 input);
+        xformedInput.setPublicId(input.getPublicId());
         return xmiReader.read(xformedInput.getByteStream(), xformedInput
                 .getSystemId(), extent);
     }
@@ -475,6 +489,7 @@
                 myInput =
                     new SAXSource(new InputSource(new FileInputStream(
                         tmpOutFile)));
+                myInput.setSystemId(tmpOutFile.toURI().toURL().toExternalForm());
             }
             return myInput.getInputSource();
         } catch (IOException e) {

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/src/org/argouml/model/mdr/XmiReferenceResolverImpl.java	2010-04-18 11:31:50-0700
@@ -1,12 +1,13 @@
 /* $Id$
  *****************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2005,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
  *
  * Contributors:
+ *    Tom Morris
  *    euluis
  *****************************************************************************
  *
@@ -46,7 +47,6 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -56,11 +56,12 @@
 import javax.jmi.reflect.RefPackage;
 
 import org.apache.log4j.Logger;
+import org.argouml.model.UmlException;
 import org.argouml.model.XmiReferenceRuntimeException;
 import org.netbeans.api.xmi.XMIInputConfig;
 import org.netbeans.lib.jmi.util.DebugException;
 import org.netbeans.lib.jmi.xmi.XmiContext;
-import org.omg.uml.foundation.core.ModelElement;
+import org.xml.sax.InputSource;
 
 /**
  * Custom resolver to use with XMI reader.
@@ -71,7 +72,12 @@
  * <li>Records the mapping of <code>xmi.id</code>'s to MDR objects as they
  * are resolved so that the map can be used to lookup objects by xmi.id later
  * (used by diagram subsystem to associate GEF/PGML objects with model
- * elements).
+ * elements).  This map is also used to resolve cross references (HREFs) to 
+ * other files when reading multiple files linked together.
+ * <li>Keeps an inverse map of objects to the xmi.id that they were read in from
+ * which can be used to maintain stable xmi.id values on output.
+ * <li>Handles search special processing for profiles including the search list
+ * of directories which an be used to look them up.
  * <li>Resolves a System ID to a fully specified URL which can be used by MDR
  * to open and read the referenced content. The standard MDR resolver is
  * extended to support that "jar:" protocol for URLs, allowing it to handle
@@ -93,13 +99,17 @@
     private static final Logger LOG =
         Logger.getLogger(XmiReferenceResolverImpl.class);
     
-    private Map<String, Object> idToObjects = 
-        Collections.synchronizedMap(new HashMap<String, Object>());
+    /**
+     * Map of href/id to object.  IDs for top level document will have no
+     * leading URL piece while others will be in <url>#<id> form
+     */
+    private Map<String, Map<String, Object>> idToObject = 
+        Collections.synchronizedMap(new HashMap<String, Map<String, Object>>());
 
     /**
-     * Map indexed by MOF ID.
+     * Map indexed by MOF ID containing XmiReference objects.
      */
-    private Map<String, XmiReference> objectsToId;
+    private Map<String, XmiReference> mofidToXmiref;
 
     /**
      * System ID of top level document
@@ -107,6 +117,11 @@
     private String topSystemId;
 
     /**
+     * Most recent system ID (public ID in our context) translated by toURL
+     */
+    private Map<String, URL> pendingProfiles = new HashMap<String, URL>();
+    
+    /**
      * URI form of topSystemID for use in relativization.
      */
     private URI baseUri;
@@ -128,18 +143,26 @@
     private Map<String, URL> urlMap = new HashMap<String, URL>();
     
     /**
-     * Mapping from URL or absolute reference back to the original SystemID
+     * Mapping from absolute resolved URL to the original SystemID
      * that was read from the input file.  We'll preserve this mapping when
      * we write things back out again.
      */
     private Map<String, String> reverseUrlMap = new HashMap<String, String>();
     
+    /**
+     * True if top level file is a profile/readonly
+     */
     private boolean profile;
 
+    /**
+     * Mapping from public ID to system ID for files which have been read.
+     */
     private Map<String, String> public2SystemIds;
 
     private String modelPublicId;
 
+    private MDRModelImplementation modelImpl;
+
     /**
      * Constructor.
      * @param systemId 
@@ -148,23 +171,39 @@
      */
     // CHECKSTYLE:OFF - ignore too many parameters since API is fixed by MDR
     XmiReferenceResolverImpl(RefPackage[] extents, XMIInputConfig config,
-            Map<String, XmiReference> objectToIdMap, 
-            Map<String, String> publicIds, List<String> searchDirs, 
-            boolean isProfile, String publicId, String systemId) {
+            Map<String, XmiReference> objectToXmiref, 
+            Map<String, String> publicIds, 
+            Map<String, Map<String, Object>> idToObject, 
+            List<String> searchDirs,
+            boolean isProfile, String publicId, String systemId,
+            MDRModelImplementation modelImplementation) {
     // CHECKSTYLE:ON
         super(extents, config);
-        objectsToId = objectToIdMap;
+        modelImpl = modelImplementation;
+        mofidToXmiref = objectToXmiref;
         modulesPath = searchDirs;
         profile = isProfile;
         public2SystemIds = publicIds;
+        this.idToObject = idToObject;
         modelPublicId = publicId;
         if (isProfile) {
+            if (publicId == null) {
+                LOG.warn("Profile load with null public ID.  Using system ID - "
+                        + systemId);
+                modelPublicId = publicId = systemId;
+            }
             if (public2SystemIds.containsKey(modelPublicId)) {
-                LOG.warn("Either an already loaded profile is being re-read " 
-                    + "or a profile with the same publicId is being loaded! " 
-                    + "publicId = \"" + publicId + "\"; existing systemId = \""
-                    + public2SystemIds.get(publicId) + "\"; new systemId = \"" 
-                    + systemId + "\".");
+                if (systemId.equals(public2SystemIds.get(publicId))) {
+                    LOG.warn("Loaded profile is being re-read "
+                            + "publicId = \"" + publicId + "\";  systemId = \""
+                            + systemId + "\".");
+                } else {
+                    LOG.warn("Profile with the duplicate publicId "
+                            + "is being loaded! publicId = \"" + publicId
+                            + "\"; existing systemId = \""
+                            + public2SystemIds.get(publicId)
+                            + "\"; new systemId = \"" + systemId + "\".");
+                }
             }
             public2SystemIds.put(publicId, systemId);
         }
@@ -207,67 +246,107 @@
         String resolvedSystemId = systemId;
         if (profile && systemId.equals(topSystemId)) {
             resolvedSystemId = modelPublicId;
-        } else if (systemId.equals(topSystemId)) {
-            resolvedSystemId = null;
         } else if (reverseUrlMap.get(systemId) != null) {
             resolvedSystemId = reverseUrlMap.get(systemId);
         } else {
             LOG.debug("Unable to map systemId - " + systemId);
         }
-        
-        String key;
-        if (resolvedSystemId == null || "".equals(resolvedSystemId)) {
-            // No # here because PGML parser needs bare UUID/xmi.id
-            key = xmiId;            
-        } else {
-            key = resolvedSystemId + "#" + xmiId;                
-        }
 
-        if (!idToObjects.containsKey(key) 
-                && !objectsToId.containsKey(object.refMofId())) {
-            super.register(resolvedSystemId, xmiId, object);
-            idToObjects.put(key, object);
-            objectsToId.put(object.refMofId(),
-                    new XmiReference(resolvedSystemId, xmiId));
-        } else {
-            if (idToObjects.containsKey(key) 
-                    && idToObjects.get(key) != object) {
-                ((ModelElement) idToObjects.get(key)).getName();
-                LOG.error("Collision - multiple elements with same xmi.id : "
-                        + xmiId);
-                throw new IllegalStateException(
-                        "Multiple elements with same xmi.id");
-            }
-            if (objectsToId.containsKey(object.refMofId())) {
+        RefObject o = getReferenceInt(resolvedSystemId, xmiId);
+        if (o == null) {
+            if (mofidToXmiref.containsKey(object.refMofId())) {
+                XmiReference ref = mofidToXmiref.get(object.refMofId());
                 // For now just skip registering this and ignore the request, 
                 // but the real issue is that MagicDraw serializes the same 
                 // object in two different composition associations, first in
                 // the referencing file and second in the referenced file
                 LOG.debug("register called twice for the same object "
                         + "- ignoring second");
-                XmiReference ref = objectsToId.get(object.refMofId());
                 LOG.debug(" - first reference = " + ref.getSystemId() + "#"
                         + ref.getXmiId());
                 LOG.debug(" - 2nd reference   = " + systemId + "#" + xmiId);
+                LOG.debug(" -   resolved system id   = " + resolvedSystemId );
+            } else {
+                registerInt(resolvedSystemId, xmiId, object);
+                super.register(resolvedSystemId, xmiId, object);
+            }
+        } else {
+            if (o.equals(object)) {
+                // Object from a different file, register with superclass so it
+                // can resolve all references
+                super.register(resolvedSystemId, xmiId, object);            
+            } else {
+               LOG.error("Collision - multiple elements with same xmi.id : "
+                        + xmiId);
+                throw new IllegalStateException(
+                        "Multiple elements with same xmi.id");
             }
         }
     }
 
+    private RefObject getReferenceInt(String docId, String xmiId)  {
+        Map<String, Object> map = idToObject.get(docId);
+        if (map != null) {
+            RefObject result = (RefObject) map.get(xmiId);
+            if (result == null && LOG.isDebugEnabled()) {
+                LOG.debug("No internal reference for - " + docId 
+                        + "#" + xmiId);
+            }
+            return result;
+        }
+        return null;
+    }
+    
+    private void registerInt(String docId, String xmiId, RefObject object) {
+        Map<String, Object> map = idToObject.get(docId);
+        if (map == null) {
+            map = new HashMap<String, Object>();
+            idToObject.put(docId,map);
+        }
+        map.put(xmiId, object);
+        mofidToXmiref.put(object.refMofId(), new XmiReference(docId, xmiId));
+    }
+    
+    /*
+     * @see org.netbeans.lib.jmi.xmi.XmiContext#getReference(java.lang.String, java.lang.String)
+     */
+    public RefObject getReference (String docId, String xmiId) {
+        RefObject ro = getReferenceInt(docId, xmiId);
+        if (ro == null && !idToObject.containsKey(docId)) {
+            ro = super.getReference(docId, xmiId);
+        }
+        if (ro == null) {
+            // TODO: Distinguish between deferred resolution and things which
+            // are unresolved at end of load and should be reported to user.
+            LOG.error("Failed to resolve " + docId + "#" + xmiId );
+        }
+        // TODO: Count/report unresolved references
+        return ro;
+    }
+
     /**
-     * Return complete map of all registered objects.
+     * Return map of all registered objects for top level document.
      * 
      * @return map of xmi.id to RefObject correspondences
      */
-    public Map<String, Object> getIdToObjectMap() {
-        return idToObjects;
+    Map<String, Object> getIdToObjectMap() {
+        return getIdToObjectMaps().get(topSystemId);
     }
 
     /**
+     * @return map of maps from xmi ID to object
+     */
+    Map<String, Map<String, Object>> getIdToObjectMaps() {
+        return idToObject;
+    }
+    
+    /**
      * Reinitialize the object id maps to the empty state.
      */
-    public void clearIdMaps() {
-        idToObjects.clear();
-        objectsToId.clear();
+    void clearIdMaps() {
+        getIdToObjectMap().clear();
+        mofidToXmiref.clear();
+        topSystemId = null;
     }
     
     
@@ -276,7 +355,9 @@
     /////////////////////////////////////////////////////
 
     /**
-     * Convert a System ID from an HREF (typically filespec-like) to a URL.
+     * Convert a System ID from an HREF which may be relative or otherwise in
+     * need of resolution to an absolute URL.
+     * 
      * Copied from AndroMDA 3.1 by Ludo (rastaman)
      * see @link org.andromda.repositories.mdr.MDRXmiReferenceResolverContext
      * @see org.netbeans.lib.jmi.xmi.XmiContext#toURL(java.lang.String)
@@ -287,6 +368,9 @@
             LOG.debug("attempting to resolve Xmi Href --> '" + systemId + "'");
         }
 
+        // TODO: Using just the last piece of the ID leaves the potential for
+        // name collisions if two linked files have the same name in different
+        // directories
         final String suffix = getSuffix(systemId);
 
         // if the model URL has a suffix of '.zip' or '.jar', get
@@ -304,6 +388,7 @@
             }
             if (modelUrl == null) {
                 // If systemId is a valid URL, simply use it.
+                // TODO: This causes a network connection attempt for profiles
                 modelUrl = getValidURL(fixupURL(systemId));
             }
             if (modelUrl == null) {
@@ -328,13 +413,15 @@
             if (modelUrl != null) {
                 LOG.info("Referenced model --> '" + modelUrl + "'");
                 urlMap.put(suffixWithExt, modelUrl);
+                pendingProfiles.put(systemId, modelUrl);
                 String relativeUri = systemId;
                 try {
                     if (baseUri != null) {
-                        relativeUri = baseUri.relativize(new URI(systemId))
+                        relativeUri = baseUri.relativize(modelUrl.toURI())
                                 .toString();
                         if (LOG.isDebugEnabled()) {
-                            LOG.debug("       system ID " + systemId
+                            LOG.debug("       system ID " + systemId 
+                                    + " modelUrl " + modelUrl 
                                     + "\n  relativized as " + relativeUri);
                         }
                     } else {
@@ -376,22 +463,20 @@
                     + modulesPath.size());
         }
         for (String moduleDirectory : modulesPath) {
-            Collection<File> candidates = findAllCandidateModulePaths(
-                moduleDirectory, moduleName);
-            for (File candidate : candidates) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("candidate '" + candidate.toString()
-                            + "' exists=" + candidate.exists());
-                }
-                if (candidate.exists()) {
-                    String urlString;
-                    try {
-                        urlString = candidate.toURI().toURL().toExternalForm();
-                    } catch (MalformedURLException e) {
-                        return null;
-                    }
-                    return fixupURL(urlString);
+            File candidate = new File(moduleDirectory, moduleName);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("candidate '" + candidate.toString() + "' exists="
+                        + candidate.exists());
+            }
+            if (candidate.exists()) {
+                String urlString;
+                try {
+                    urlString = candidate.toURI().toURL().toExternalForm();
+                } catch (MalformedURLException e) {
+                    return null;
                 }
+
+                return fixupURL(urlString);
             }
         }
         if (public2SystemIds.containsKey(moduleName)) {
@@ -405,35 +490,6 @@
         return null;
     }
 
-    private static Collection<File> findAllCandidateModulePaths(
-            String basePath, String fileName) {
-        Collection<File> candidates = new ArrayList<File>();
-        if (basePath != null && basePath.length() > 0) {
-            Collection<File> dirs = new ArrayList<File>();
-            dirs = findAllInternalDirectories(new File(basePath));
-            for (File dir : dirs) {
-                candidates.add(new File(dir, fileName));
-            }
-        } else {
-            candidates.add(new File(fileName));
-        }
-        return candidates;
-    }
-
-    private static Collection<File> findAllInternalDirectories(File baseDir) {
-        List<File> dirs = new ArrayList<File>();
-        if (baseDir.exists() && baseDir.isDirectory()) {
-            dirs.add(baseDir);
-            File[] files = baseDir.listFiles();
-            for (File file : files) {
-                if (file.isDirectory()) {
-                    dirs.add(file);
-                    dirs.addAll(findAllInternalDirectories(file));
-                }
-            }
-        }
-        return dirs;
-    }
 
     /**
      * Gets the suffix of the <code>systemId</code>.
@@ -578,15 +634,31 @@
 
     @Override
     public void readExternalDocument(String arg0) {
-        try {
-            super.readExternalDocument(arg0);
-        } catch (DebugException e) {
-            // Unfortunately the MDR super implementation throws
-            // DebugException with just the message from the causing
-            // exception rather than nesting the exception itself, so
-            // we don't have all the information we'd like
-            LOG.error("Error reading external document " + arg0);
-            throw new XmiReferenceRuntimeException(arg0, e);
+        // We've got a profile read pending - handle it ourselves now
+        URL url = pendingProfiles.remove(arg0);
+        if (url != null) {
+            InputSource is = new InputSource(url.toExternalForm());
+            is.setPublicId(arg0);
+            XmiReaderImpl reader = new XmiReaderImpl(modelImpl);
+            try {
+                reader.parse(is, true);
+            } catch (UmlException e) {
+                LOG.error("Error reading referenced profile " + arg0);
+                throw new XmiReferenceRuntimeException(arg0, e);
+            }
+        } else if (!(public2SystemIds.containsKey(arg0))) {
+            // Otherwise if it's not something we've already read, just
+            // punt to the super class.
+            try {
+                super.readExternalDocument(arg0);
+            } catch (DebugException e) {
+                // Unfortunately the MDR super implementation throws
+                // DebugException with just the message from the causing
+                // exception rather than nesting the exception itself, so
+                // we don't have all the information we'd like
+                LOG.error("Error reading external document " + arg0);
+                throw new XmiReferenceRuntimeException(arg0, e);
+            }
         }
     }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/AbstractMDRModelImplementationTestCase.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/AbstractMDRModelImplementationTestCase.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/AbstractMDRModelImplementationTestCase.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/AbstractMDRModelImplementationTestCase.java	2010-04-18 11:31:50-0700
@@ -82,8 +82,9 @@
     
     protected void setUp() throws Exception {
         super.setUp();
-        if (!initialized)
+        if (!initialized) {
             init();
+        }
     }
 
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestReadCompressedFilesAndHref.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestReadCompressedFilesAndHref.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestReadCompressedFilesAndHref.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model-mdr/tests/org/argouml/model/mdr/TestReadCompressedFilesAndHref.java	2010-04-18 11:31:50-0700
@@ -40,6 +40,8 @@
 package org.argouml.model.mdr;
 
 import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
 
 import org.apache.log4j.Logger;
 import org.xml.sax.InputSource;
@@ -97,8 +99,9 @@
         LOG.info("Begin " + testName + "()");
         XmiReaderImpl reader = new XmiReaderImpl(modelImplementation);
         if (profilesPath != null) {
-            String file = getClass().getResource(profilesPath).getFile();
-            reader.addSearchPath(file);
+            String path = getClass().getResource(profilesPath).getPath();
+            File file = new File(path);
+            setProfilePathSubdirs(reader, file);
         }
         try {
             InputSource inputSource = new InputSource(
@@ -111,4 +114,25 @@
         }
         assertTrue(modelPath + " model is loaded", true);
     }
+    
+    private void setProfilePathSubdirs(XmiReaderImpl reader, File directory) {
+        Collection<File> dirs = new ArrayList<File>();
+        collectSubdirs(directory, dirs);
+
+        for (File dir : dirs) {
+            reader.addSearchPath(dir.getAbsolutePath());
+        }
+    }
+    
+    private void collectSubdirs(File file, Collection<File> subdirs) {
+        subdirs.add(file);
+        File[] files = file.listFiles();
+        if (files != null) {
+            for (File f : files) {
+                if (f.isDirectory() & !f.isHidden()) {
+                    collectSubdirs(f, subdirs);
+                }
+            }
+        }
+    }
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/ModelImplementation.java	2010-04-18 11:31:50-0700
@@ -39,7 +39,6 @@
 package org.argouml.model;
 
 import java.io.OutputStream;
-import java.io.Writer;
 
 
 

Modified: branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/UmlFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/UmlFactory.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/UmlFactory.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-model/src/org/argouml/model/UmlFactory.java	2010-04-18 11:31:50-0700
@@ -38,6 +38,7 @@
 
 package org.argouml.model;
 
+import java.util.Collection;
 
 /**
  * The interface for the UmlFactory.
@@ -174,4 +175,14 @@
      */
     boolean isRemoved(Object o);
 
+    /**
+     * Get the top level packages (typically just a single Model) for the given
+     * extent if it is loaded. Returns null if the extent doesn't exist and an
+     * empty collection if it exists, but contains no packages.
+     * 
+     * @param extentName the extent name (typically the public ID or URL of the
+     *            file which is used for references)
+     * @return a collection of packages if the extent exists, otherwise null
+     */
+    Collection getExtentPackages(String extentName);
 }

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.classpath?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.classpath	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.classpath	2010-04-18 11:31:50-0700
@@ -2,8 +2,7 @@
 <classpath>

 	<classpathentry kind="src" path="src"/>

 	<classpathentry kind="src" path="/argouml-app"/>

-	<classpathentry kind="src" path="/argouml-core-infra"/>

-	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model"/>

 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>

+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>

 	<classpathentry kind="output" path="build-eclipse"/>

 </classpath>


Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.project
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.project?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.project	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.project	2010-04-18 11:31:50-0700
@@ -1,29 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<projectDescription>

-	<name>argouml-core-umlpropertypanels</name>

-	<comment></comment>

-	<projects>

-	</projects>

-	<buildSpec>

-		<buildCommand>

-			<name>org.eclipse.jdt.core.javabuilder</name>

-			<arguments>

-			</arguments>

-		</buildCommand>

-		<buildCommand>

-			<name>de.mvmsoft.checkclipse.CheckclipseBuilder</name>

-			<arguments>

-			</arguments>

-		</buildCommand>

-		<buildCommand>

-			<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>

-			<arguments>

-			</arguments>

-		</buildCommand>

-	</buildSpec>

-	<natures>

-		<nature>de.mvmsoft.checkclipse.CheckclipseNature</nature>

-		<nature>org.eclipse.jdt.core.javanature</nature>

-		<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>

-	</natures>

-</projectDescription>

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>argouml-core-umlpropertypanels</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>de.mvmsoft.checkclipse.CheckclipseBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>de.mvmsoft.checkclipse.CheckclipseNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.core.prefs
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.core.prefs?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.core.prefs	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.core.prefs	2010-04-18 11:31:50-0700
@@ -1,4 +1,4 @@
-#Tue Dec 22 10:03:32 CET 2009

+#Tue Apr 13 06:08:23 CEST 2010

 eclipse.preferences.version=1

 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled

 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5

@@ -6,3 +6,261 @@
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error

 org.eclipse.jdt.core.compiler.source=1.5

+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false

+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16

+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16

+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16

+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16

+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16

+org.eclipse.jdt.core.formatter.alignment_for_assignment=0

+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16

+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16

+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80

+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0

+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16

+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16

+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16

+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16

+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16

+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1

+org.eclipse.jdt.core.formatter.blank_lines_after_package=1

+org.eclipse.jdt.core.formatter.blank_lines_before_field=0

+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0

+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1

+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1

+org.eclipse.jdt.core.formatter.blank_lines_before_method=1

+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1

+org.eclipse.jdt.core.formatter.blank_lines_before_package=0

+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1

+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1

+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line

+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line

+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false

+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false

+org.eclipse.jdt.core.formatter.comment.format_block_comments=true

+org.eclipse.jdt.core.formatter.comment.format_header=false

+org.eclipse.jdt.core.formatter.comment.format_html=true

+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true

+org.eclipse.jdt.core.formatter.comment.format_line_comments=true

+org.eclipse.jdt.core.formatter.comment.format_source_code=true

+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true

+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true

+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert

+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert

+org.eclipse.jdt.core.formatter.comment.line_length=80

+org.eclipse.jdt.core.formatter.compact_else_if=true

+org.eclipse.jdt.core.formatter.continuation_indentation=2

+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2

+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false

+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true

+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true

+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true

+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true

+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true

+org.eclipse.jdt.core.formatter.indent_empty_lines=false

+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true

+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true

+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true

+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false

+org.eclipse.jdt.core.formatter.indentation.size=4

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert

+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert

+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert

+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert

+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert

+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert

+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert

+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert

+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert

+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert

+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert

+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert

+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert

+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert

+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert

+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert

+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert

+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert

+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert

+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert

+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert

+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert

+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert

+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert

+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert

+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert

+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert

+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert

+org.eclipse.jdt.core.formatter.join_lines_in_comments=true

+org.eclipse.jdt.core.formatter.join_wrapped_lines=true

+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false

+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false

+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false

+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false

+org.eclipse.jdt.core.formatter.lineSplit=80

+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false

+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false

+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0

+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1

+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true

+org.eclipse.jdt.core.formatter.tabulation.char=mixed

+org.eclipse.jdt.core.formatter.tabulation.size=8

+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false

+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true


Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.ui.prefs
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.ui.prefs?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.ui.prefs	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/.settings/org.eclipse.jdt.ui.prefs	2010-04-18 11:31:50-0700
@@ -1,4 +1,6 @@
-#Thu Feb 11 22:39:06 CET 2010

+#Tue Apr 13 06:08:23 CEST 2010

 eclipse.preferences.version=1

+formatter_profile=org.eclipse.jdt.ui.default.sun_profile

+formatter_settings_version=11

 org.eclipse.jdt.ui.javadoc=false

 org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return Returns the ${bare_field_name}.\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} The ${bare_field_name} to set.\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" 
 context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n *\r\n * ${tags}\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><templa
 te autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/**\r\n * ${tags}\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/* $$Id$$\r\n *******************************************************************************\r\n * Copyright (c) ${year} Contributors - see below\r\n * All rights reserved. This program and the accompanying materials\r\n * are ma
 de available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n *    ${user}\r\n *******************************************************************************\r\n */\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="tru
 e" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// TODO\: Auto-generated catch block\r\nLOG.error("Exception", ${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// TODO\: Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="false" context\="constructorbody_context" deleted\="false
 " description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// TODO\: Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>


Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/RowSelector.java	2010-04-18 11:31:50-0700
@@ -1,6 +1,6 @@
 /* $Id$
  *******************************************************************************
- * Copyright (c) 2009 Contributors - see below
+ * Copyright (c) 2009,2010 Contributors - see below
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -11,8 +11,6 @@
  *******************************************************************************
  */
 
-
-// $Id$
 // Copyright (c) 1996-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
@@ -88,8 +86,6 @@
 import org.tigris.swidgets.FlexiGridLayout;
 import org.tigris.toolbar.ToolBar;
 import org.tigris.toolbar.ToolBarFactory;
-import org.tigris.toolbar.toolbutton.PopupToolBoxButton;
-import org.tigris.toolbar.toolbutton.ToolButton;
 
 /**
  * A control for displaying the contents of a list model elements in a panel

Modified: branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java	(original)
+++ branches/BRANCH_0_30_x/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UmlControl.java	2010-04-18 11:31:50-0700
@@ -50,24 +50,25 @@
 	 * @return the panel containing the actions required.

 	 */

 	protected JPanel createSingleButtonPanel(List<Action> actions) {

-        JPanel buttonPanel =

+        final JPanel buttonPanel =

             new JPanel(new FlexiGridLayout(2, 1, FlexiGridLayout.ROWCOLPREFERRED));

-		final ToolButton tb;

+		final JToolBar toolbar;

     	if (actions.size() == 1) {

-    		tb = new ToolButton(actions.get(0));

-    		// TODO: Following is only in Java 6 and later

-//    		tb.setHideActionText(true);

+    		final ToolButton tb = new ToolButton(actions.get(0));

+            final ToolBarFactory tbf = new ToolBarFactory(actions);

+            toolbar = tbf.createToolBar();

+            toolbar.setRollover(true);

     	} else {

-            PopupToolBoxButton ptb = new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);

+    		final PopupToolBoxButton ptb =

+    			new PopupToolBoxButton(actions.get(0), actions.size(), 1, true);

             for (Action action : actions) {

                 ptb.add(action);

             }

-            tb = ptb;

+            final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});

+            toolbar = tbf.createToolBar();

+            toolbar.setRollover(true);

+    		toolbar.add(ptb);

     	}

-        final ToolBarFactory tbf = new ToolBarFactory(new Object[] {});

-        JToolBar toolbar = tbf.createToolBar();

-        toolbar.setRollover(true);

-		toolbar.add(tb);

 		buttonPanel.add(toolbar);

         return buttonPanel;

 	}


Modified: branches/BRANCH_0_30_x/www/index.html
Url: http://argouml.tigris.org/source/browse/argouml/branches/BRANCH_0_30_x/www/index.html?view=diff&pathrev=18284&r1=18283&r2=18284
==============================================================================
--- branches/BRANCH_0_30_x/www/index.html	(original)
+++ branches/BRANCH_0_30_x/www/index.html	2010-04-18 11:31:50-0700
@@ -141,13 +141,13 @@
 <script type="text/javascript">
 document.write("<div style='display:none;'>");
 </script>
-<a href="http://argouml-downloads.tigris.org/argouml-0.30.BETA_3/" >Download and test ArgoUML 0.30 BETA 3</a>
+<a href="http://argouml-downloads.tigris.org/argouml-0.30.1.BETA_1/" >Download and test ArgoUML 0.30.1 BETA 1</a>
 <script type="text/javascript">
 document.write("</div>");
 </script>
 
 <script type="text/javascript">
-    var LAST_BETA_VERSION = "0.30.BETA_3";
+    var LAST_BETA_VERSION = "0.30.1.BETA_1";
     if (navigator.appVersion.indexOf("Win")!=-1) {
         document.write("<a href='http://argouml-downloads.tigris.org/nonav/argouml-"+LAST_BETA_VERSION+"/ArgoUML-" + LAST_BETA_VERSION +"-setup.exe' onClick=\"javascript:urchinTracker('DOWNLOAD/ArgoUML-"+LAST_BETA_VERSION+"-setup.exe')\">Download and test ArgoUML "+LAST_BETA_VERSION + " (Windows)</a>");
     }


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

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.