svn commit: r13313 - branches/gsoc2007/maurelio1234/branch2/src_new: . .settings ext org/argouml org/argouml/i18n org/argouml/kernel org/argouml/persistence org/argouml/ui org/argouml/ui/explorer org/argouml/ui/explorer/rules org/argouml/uml org/argouml/uml/cognitive/critics org/argouml/uml/diagram/activity/ui org/argouml/uml/diagram/collaboration/ui org/argouml/uml/diagram/deployment/ui org/argouml/uml/diagram/sequence/ui org/argouml/uml/diagram/state/ui org/argouml/uml/diagram/static_structure/ui org/argouml/uml/diagram/ui org/argouml/uml/profile org/argouml/uml/ui org/argouml/uml/ui/foundation/core org/argouml/uml/ui/foundation/extension_mechanisms

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-08-13 14:10:35-0700
New Revision: 13313

Added:
   branches/gsoc2007/maurelio1234/branch2/src_new/ext/
   branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar   (contents, props changed)
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-cpp.xmi
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-java.xmi
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ActionExportProfileXMI.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileConfigurationToProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileToModel.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToProfileConfiguration.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/CrProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeView.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigProfileIcon.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FormatingStrategy.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/JavaFormatingStrategy.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileException.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManager.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java
Removed:
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/Profile.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileException.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileJava.java
Modified:
   branches/gsoc2007/maurelio1234/branch2/src_new/.classpath
   branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs
   branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs
   branches/gsoc2007/maurelio1234/branch2/src_new/build.bat
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java
   branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java

Log:
uploading the merged code

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/.classpath?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/.classpath&p2=branches/gsoc2007/maurelio1234/branch2/src_new/.classpath&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/.classpath	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/.classpath	2007-08-13 14:10:35-0700
@@ -3,5 +3,10 @@
 	<classpathentry excluding=".settings/|bin/|build-eclipse/|build/|templates/|tests/" kind="src" path=""/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-lib"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model-euml"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-model-mdr"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/argouml-core-tools"/>
 	<classpathentry kind="output" path="build-eclipse"/>
 </classpath>

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs&p2=branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.core.prefs	2007-08-13 14:10:35-0700
@@ -1,4 +1,4 @@
-#Sat Jun 30 21:55:28 EDT 2007
+#Mon Aug 13 14:46:35 BRT 2007
 eclipse.preferences.version=1
 org.eclipse.jdt.core.codeComplete.argumentPrefixes=
 org.eclipse.jdt.core.codeComplete.argumentSuffixes=

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs&p2=branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/.settings/org.eclipse.jdt.ui.prefs	2007-08-13 14:10:35-0700
@@ -1,8 +1,7 @@
-#Fri Jun 15 13:13:14 EDT 2007
+#Mon Aug 13 14:40:12 BRT 2007
 eclipse.preferences.version=1
 formatter_profile=_ArgoUML
 formatter_settings_version=10
-internal.default.compliance=default
 org.eclipse.jdt.ui.exception.name=e
 org.eclipse.jdt.ui.gettersetter.use.is=true
 org.eclipse.jdt.ui.ignorelowercasenames=true

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/build.bat
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/build.bat?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/build.bat&p2=branches/gsoc2007/maurelio1234/branch2/src_new/build.bat&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/build.bat	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/build.bat	2007-08-13 14:10:35-0700
@@ -8,10 +8,10 @@
 set ANT_HOME=..\tools\apache-ant-1.7.0
 
 :: Convert relative path to absolute
-pushd %ANT_HOME%
+pushd "%ANT_HOME%"
 set ANT_HOME=%CD%
 popd
 
-call %ANT_HOME%\bin\ant %1 %2 %3 %4 %5 %6 %7 %8 %9
+call "%ANT_HOME%\bin\ant" %1 %2 %3 %4 %5 %6 %7 %8 %9
 
 endlocal
\ No newline at end of file

Added: branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/ext/javabeans.jar?view=auto&rev=13313
==============================================================================
Binary file. No diff available.

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-cpp.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-cpp.xmi?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-cpp.xmi	2007-08-13 14:10:35-0700
@@ -0,0 +1,921 @@
+<?xml version = '1.0' encoding = 'UTF-8' ?>

+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Sat Jun 30 05:42:04 BRT 2007'>

+  <XMI.header>    <XMI.documentation>
+      <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
+      <XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-07-10 17:00:25 -0300 (ter, 10 jul 2007) $ </XMI.exporterVersion>
+    </XMI.documentation>
+    <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>

+  <XMI.content>

+    <UML:Model xmi.id = '.:00000000000008A4' name = 'UML Profile for C++' isSpecification = 'false'

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

+      <UML:ModelElement.stereotype>

+        <UML:Stereotype xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000895'/>

+      </UML:ModelElement.stereotype>

+      <UML:ModelElement.taggedValue>

+        <UML:TaggedValue xmi.id = '.:00000000000008A6' isSpecification = 'false'>

+          <UML:TaggedValue.dataValue>This UML profile which provides the needed stereotypes and tag definitions for use with the ArgoUML C++ module.</UML:TaggedValue.dataValue>

+          <UML:TaggedValue.type>

+            <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+          </UML:TaggedValue.type>

+        </UML:TaggedValue>

+        <UML:TaggedValue xmi.id = '.:00000000000008A7' isSpecification = 'false'>

+          <UML:TaggedValue.dataValue>Luís Sérgio Oliveira</UML:TaggedValue.dataValue>

+          <UML:TaggedValue.type>

+            <UML:TagDefinition xmi.idref = '.:0000000000000854'/>

+          </UML:TaggedValue.type>

+        </UML:TaggedValue>

+        <UML:TaggedValue xmi.id = '.:00000000000008A8' isSpecification = 'false'>

+          <UML:TaggedValue.dataValue>0.03</UML:TaggedValue.dataValue>

+          <UML:TaggedValue.type>

+            <UML:TagDefinition xmi.idref = '.:00000000000008A9'/>

+          </UML:TaggedValue.type>

+        </UML:TaggedValue>

+        <UML:TaggedValue xmi.id = '.:00000000000008AC' isSpecification = 'false'>

+          <UML:TaggedValue.dataValue>0.20</UML:TaggedValue.dataValue>

+          <UML:TaggedValue.type>

+            <UML:TagDefinition xmi.idref = '.:00000000000008AD'/>

+          </UML:TaggedValue.type>

+        </UML:TaggedValue>

+      </UML:ModelElement.taggedValue>

+      <UML:Namespace.ownedElement>

+        <UML:Stereotype xmi.id = '.:000000000000085A' name = 'cppClass' isSpecification = 'false'

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

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

+          <UML:ModelElement.taggedValue>

+            <UML:TaggedValue xmi.id = '.:0000000000000821' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>Stereotype to apply to C++ classes for code generation.
+Note: use of this stereotype isn&apos;t required, it is more a convenience for having the available tag definitions from the C++ UML Profile.</UML:TaggedValue.dataValue>

+            </UML:TaggedValue>

+          </UML:ModelElement.taggedValue>

+          <UML:Stereotype.definedTag>

+            <UML:TagDefinition xmi.id = '.:0000000000000826' name = 'constructor' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000823'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000822' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000824' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If true – generates a default constructor for the class.
+Else, if false (default) – no default constructor is generated, unless it is explicitly modeled with the «create» stereotype.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000825' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If true – generates a default constructor for the class.
+Else, if false (default) – no default constructor is generated, unless it is explicitly modeled with the «create» stereotype.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000082C' name = 'source_incl' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000828'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000827' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000829' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the file to include in the source (e.g., .cpp file). If we desire to have multiple headers included this way, just use multiple tagged values with source_incl as the tag.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000082A' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the file to include in the source (e.g., .cpp file).
+Note: if we desire to have multiple headers included this way, just use multiple tagged values with source_incl as the tag.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000082B' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the file to include in the source (e.g., .cpp file).
+Note: if we desire to have multiple headers included this way, just use multiple tagged values with source_incl as the tag.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000831' name = 'header_incl' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000082E'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000082D' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000082F' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the file to include in the header. If we desire to have multiple headers included this way, just use multiple tagged values with header_incl as the tag.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000830' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the file to include in the header. If we desire to have multiple headers included this way, just use multiple tagged values with header_incl as the tag.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000836' name = 'typedef_public'

+              isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000833'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000832' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000834' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the public area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000835' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the public area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000083B' name = 'typedef_protected'

+              isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000838'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000837' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000839' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the protected area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000083A' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the protected area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000840' name = 'typedef_private'

+              isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000083D'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000083C' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000083E' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the private area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000083F' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the private area of the class with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000845' name = 'typedef_global_header'

+              isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000842'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000841' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000843' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the global area of the header file with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000844' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the global area of the header file with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000084A' name = 'typedef_global_source'

+              isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000847'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000846' lower = '0' upper = '-1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000848' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the global area of the source file with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000849' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>&lt;source type&gt; &lt;type_name&gt; – creates typedef line in the global area of the source file with typedef &lt;source type&gt; &lt;type name&gt;.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000084F' name = 'email' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000084C'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000084B' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000084D' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>[email protected] – replaces the tag |EMAIL| of the template file.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000084E' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>[email protected] – replaces the tag |EMAIL| of the template file.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000854' name = 'author' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000851'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000850' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000852' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>name – replaces the tag |AUTHOR| of the template file.
+Note: you may simply use the Author property in the documentation property panel.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000853' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>name – replaces the tag |AUTHOR| of the template file.
+Note: you may simply use the Author property in the documentation property panel.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000859' name = 'TemplatePath' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000856'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000855' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000857' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Directory – will search in the specified directory for the template files &quot;header_template&quot; and &quot;cpp_template&quot; which are placed in top of the corresponding file. The following tags in the template file are replaced by model values: |FILENAME|, |DATE|, |YEAR|, |AUTHOR|, |EMAIL|. If no such tag is specified, the templates are searched in the subdirectory of the root directory for the code generation.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000858' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Directory – will search in the specified directory for the template files &quot;header_template&quot; and &quot;cpp_template&quot; which are placed in top of the corresponding file. The following tags in the template file are replaced by model values: |FILENAME|, |DATE|, |YEAR|, |AUTHOR|, |EMAIL|. If no such tag is specified, the templates are searched in the subdirectory of the root directory for the code generation.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000088F'

+              name = 'cpp_class_specifier' isSpecification = 'false' tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000893'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000892'

+                      lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000894'

+                  isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Name of the C++ class specifier tagged value. Possible values are: class, union, and struct. When this is ommited, class is used.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+          </UML:Stereotype.definedTag>

+        </UML:Stereotype>

+        <UML:Class xmi.id = '.:0000000000000872' name = 'Xpto' visibility = 'public'

+          isSpecification = 'false' isRoot = 'false' isLeaf = 'false' isAbstract = 'false'

+          isActive = 'false'>

+          <UML:ModelElement.stereotype>

+            <UML:Stereotype xmi.idref = '.:000000000000085A'/>

+          </UML:ModelElement.stereotype>

+          <UML:ModelElement.taggedValue>

+            <UML:TaggedValue xmi.id = '.:000000000000085B' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>true</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:0000000000000826'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+            <UML:TaggedValue xmi.id = '.:000000000000085C' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>foo.h</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:000000000000082C'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+            <UML:TaggedValue xmi.id = '.:000000000000085D' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>Dummy class just for demonstration purposes.</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+            <UML:TaggedValue xmi.id = '.:000000000000085E' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>C:\luis\programacao\ArgoUML\issues\3771 - Add tag definitions for tags used by the cpp generator</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:0000000000000895'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+            <UML:TaggedValue xmi.id = '.:000000000000085F' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>cpp</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:0000000000000898'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+          </UML:ModelElement.taggedValue>

+          <UML:Classifier.feature>

+            <UML:Attribute xmi.id = '.:0000000000000865' name = 'statusPort' visibility = 'public'

+              isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'

+              targetScope = 'instance'>

+              <UML:StructuralFeature.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000861'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000860' lower = '1' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:StructuralFeature.multiplicity>

+              <UML:Attribute.initialValue>

+                <UML:Expression xmi.id = '.:0000000000000862' language = 'Java' body = ''/>

+              </UML:Attribute.initialValue>

+              <UML:ModelElement.stereotype>

+                <UML:Stereotype xmi.idref = '.:000000000000088F'/>

+              </UML:ModelElement.stereotype>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000863' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>true</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000886'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000864' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>public</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:000000000000087D'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+              <UML:StructuralFeature.type>

+                <UML:DataType xmi.idref = '.:0000000000000874'/>

+              </UML:StructuralFeature.type>

+            </UML:Attribute>

+            <UML:Attribute xmi.id = '.:000000000000086B' name = 'brotherXpto' visibility = 'public'

+              isSpecification = 'false' ownerScope = 'instance' changeability = 'changeable'

+              targetScope = 'instance'>

+              <UML:StructuralFeature.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000867'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000866' lower = '1' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:StructuralFeature.multiplicity>

+              <UML:ModelElement.stereotype>

+                <UML:Stereotype xmi.idref = '.:000000000000088F'/>

+              </UML:ModelElement.stereotype>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000868' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>public</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000881'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000869' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>public</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:000000000000087D'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000086A' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>true</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:000000000000088A'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+              <UML:StructuralFeature.type>

+                <UML:Class xmi.idref = '.:0000000000000872'/>

+              </UML:StructuralFeature.type>

+            </UML:Attribute>

+            <UML:Operation xmi.id = '.:0000000000000871' name = 'reset' visibility = 'public'

+              isSpecification = 'false' ownerScope = 'instance' isQuery = 'false' concurrency = 'sequential'

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

+              <UML:BehavioralFeature.parameter>

+                <UML:Parameter xmi.id = '.:000000000000086C' name = 'return' isSpecification = 'false'

+                  kind = 'return'>

+                  <UML:Parameter.type>

+                    <UML:DataType xmi.idref = '.:00000000000008A3'/>

+                  </UML:Parameter.type>

+                </UML:Parameter>

+                <UML:Parameter xmi.id = '.:0000000000000870' name = 'brother' isSpecification = 'false'>

+                  <UML:Parameter.defaultValue>

+                    <UML:Expression xmi.id = '.:000000000000086D' language = 'Java' body = '0'/>

+                  </UML:Parameter.defaultValue>

+                  <UML:ModelElement.stereotype>

+                    <UML:Stereotype xmi.idref = '.:00000000000008A2'/>

+                  </UML:ModelElement.stereotype>

+                  <UML:ModelElement.taggedValue>

+                    <UML:TaggedValue xmi.id = '.:000000000000086E' isSpecification = 'false'>

+                      <UML:TaggedValue.type>

+                        <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                      </UML:TaggedValue.type>

+                    </UML:TaggedValue>

+                    <UML:TaggedValue xmi.id = '.:000000000000086F' isSpecification = 'false'/>

+                  </UML:ModelElement.taggedValue>

+                  <UML:Parameter.type>

+                    <UML:Class xmi.idref = '.:0000000000000872'/>

+                  </UML:Parameter.type>

+                </UML:Parameter>

+              </UML:BehavioralFeature.parameter>

+            </UML:Operation>

+          </UML:Classifier.feature>

+        </UML:Class>

+        <UML:DataType xmi.id = '.:0000000000000873' name = 'int' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:0000000000000874' name = 'bool' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:Stereotype xmi.id = '.:000000000000088F' name = 'cppAttribute' isSpecification = 'false'

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

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

+          <UML:Stereotype.definedTag>

+            <UML:TagDefinition xmi.id = '.:0000000000000879' name = 'usage' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000876'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000875' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000877' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If &quot;header&quot;, will lead for class types to a pre-declaration in the header, and the include of the remote class header in the header of the generated class.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000878' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If &quot;header&quot;, will lead for class types to a pre-declaration in the header, and the include of the remote class header in the header of the generated class.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000087D' name = 'get' isSpecification = 'false'

+              tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000087B'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000087A' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000087C' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>private || protected || public – creates a simple function to get the attribute by a function (return by reference is used for class-types, else call by value); place the function in the given visibility area.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000881' name = 'set' isSpecification = 'false'

+              tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000087F'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000087E' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000880' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>private || protected || public – creates a simple function to set the attribute by a function (call by reference is used for class-types, else call by value); place the function in the given visibility area.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:0000000000000886' name = 'pointer' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000883'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000882' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000884' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If true, the type of the member variable will be a pointer to the attribute type. For example, if you have the UML Attribute: name: std::string, with the pointer tagged value set to true, the generated member variable would be: std::string* name;
+If false (default), no pointer modifier is applied.</UML:TaggedValue.dataValue>

+                </UML:TaggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000885' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If true, the type of the member variable will be a pointer to the attribute type. For example, if you have the UML Attribute: name: std::string, with the pointer tagged value set to true, the generated member variable would be: std::string* name;
+If false (default), no pointer modifier is applied.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000088A' name = 'reference' isSpecification = 'false'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:0000000000000888'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:0000000000000887' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:0000000000000889' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>true – the type of the member variable will be a reference to the attribute type.
+false (default) – no reference modifier is applied.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:000000000000088E' name = 'MultiplicityType'

+              isSpecification = 'false' tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000088C'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000088B' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000088D' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>It may assume one of the values: list || slist || vector || map || stack || stringmap – will define a multiplicity as the corresponding STL container, if the Multiplicity range of the attribute is variable (for fixed size ranges this setting is ignored).</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+          </UML:Stereotype.definedTag>

+        </UML:Stereotype>

+        <UML:TagDefinition xmi.id = '.:0000000000000892' name = 'documentation'

+          isSpecification = 'false' tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '127-0-0-1--3e74cd45:11241a13c12:-8000:000000000000088C'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '127-0-0-1--3e74cd45:11241a13c12:-8000:000000000000088B'

+                  lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+        <UML:TagDefinition xmi.id = '.:0000000000000895' name = 'src_path' isSpecification = 'false'

+          tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '.:0000000000000894'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '.:0000000000000893' lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+        <UML:TagDefinition xmi.id = '.:0000000000000898' name = 'src_lang' isSpecification = 'false'

+          tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '.:0000000000000897'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '.:0000000000000896' lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+        <UML:Stereotype xmi.id = '.:00000000000008A2' name = 'cppParameter' isSpecification = 'false'

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

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

+          <UML:ModelElement.taggedValue>

+            <UML:TaggedValue xmi.id = '.:0000000000000899' isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>_Variable passing semantics_
+
+If a Parameter for an Operation is marked as out or inout the variable will be passed by reference (default) or pointer (needs tagged value pointer), otherwise by value.
+
+Return values in UML are simply Parameters marked as return, therefore everything here applies to them, except where explicitly noted.
+Warning
+Note that UML allows multiple return values. This is possible to support in C++ as out parameters, but, currently the generator doesn&apos;t supports it.
+
+This problem is being handled in issue #3553 – handle multiple return parameters.</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+          </UML:ModelElement.taggedValue>

+          <UML:Stereotype.definedTag>

+            <UML:TagDefinition xmi.id = '.:000000000000089D' name = 'reference' isSpecification = 'false'

+              tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000089B'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000089A' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:000000000000089C' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>true – the type of the parameter will be a reference to the parameter type.
+false (default) – no reference modifier is applied.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '.:00000000000008A1' name = 'pointer' isSpecification = 'false'

+              tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '.:000000000000089F'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '.:000000000000089E' lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '.:00000000000008A0' isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>If true, the type of the parameter will be a pointer to the parameter type. For example, if you have the UML Parameter: name: std::string, with the pointer tagged value set to true, the generated member variable would be: std::string* name;
+If false (default), no pointer modifier is applied.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+          </UML:Stereotype.definedTag>

+        </UML:Stereotype>

+        <UML:DataType xmi.id = '.:00000000000008A3' name = 'void' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:TagDefinition xmi.id = '.:00000000000008A9' name = 'version' isSpecification = 'false'

+          tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '.:00000000000008AA'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '.:00000000000008AB' lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+        <UML:TagDefinition xmi.id = '.:00000000000008AD' name = 'since' isSpecification = 'false'

+          tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '.:00000000000008AE'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '.:00000000000008AF' lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+        <UML:Package xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:0000000000000869'

+          name = 'std' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

+          <UML:ModelElement.taggedValue>

+            <UML:TaggedValue xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086A'

+              isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>The C++ standard library</UML:TaggedValue.dataValue>

+            </UML:TaggedValue>

+          </UML:ModelElement.taggedValue>

+        </UML:Package>

+        <UML:DataType xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086B'

+          name = 'unsigned int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086C'

+          name = 'char' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086D'

+          name = 'unsigned char' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086E'

+          name = 'long' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '10-0-1-4-8c436b:10bce9cf2cc:-8000:000000000000086F'

+          name = 'unsigned long' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:Class xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000870'

+          name = 'Derived' visibility = 'public' isSpecification = 'false' isRoot = 'false'

+          isLeaf = 'false' isAbstract = 'false' isActive = 'false'>

+          <UML:ModelElement.stereotype>

+            <UML:Stereotype xmi.idref = '.:000000000000085A'/>

+          </UML:ModelElement.stereotype>

+          <UML:GeneralizableElement.generalization>

+            <UML:Generalization xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000872'/>

+          </UML:GeneralizableElement.generalization>

+        </UML:Class>

+        <UML:Generalization xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000872'

+          name = 'exampleCppGeneralization' isSpecification = 'false'>

+          <UML:ModelElement.stereotype>

+            <UML:Stereotype xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000873'/>

+          </UML:ModelElement.stereotype>

+          <UML:ModelElement.taggedValue>

+            <UML:TaggedValue xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000088D'

+              isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>true</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000879'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+            <UML:TaggedValue xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000088E'

+              isSpecification = 'false'>

+              <UML:TaggedValue.dataValue>private</UML:TaggedValue.dataValue>

+              <UML:TaggedValue.type>

+                <UML:TagDefinition xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000885'/>

+              </UML:TaggedValue.type>

+            </UML:TaggedValue>

+          </UML:ModelElement.taggedValue>

+          <UML:Generalization.child>

+            <UML:Class xmi.idref = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000870'/>

+          </UML:Generalization.child>

+          <UML:Generalization.parent>

+            <UML:Class xmi.idref = '.:0000000000000872'/>

+          </UML:Generalization.parent>

+        </UML:Generalization>

+        <UML:Stereotype xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000873'

+          name = 'cppGeneralization' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

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

+          <UML:Stereotype.definedTag>

+            <UML:TagDefinition xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000879'

+              name = 'cpp_virtual_inheritance' isSpecification = 'false' tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000883'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000882'

+                      lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000884'

+                  isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Default value (if the tagged value doesn&apos;t exist) is false. Type is  Boolean.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+            <UML:TagDefinition xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000885'

+              name = 'cpp_inheritance_visibility' isSpecification = 'false' tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000898'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000897'

+                      lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000088A'

+                  isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Default value is public and possible values are: private, protected and public.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+          </UML:Stereotype.definedTag>

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000895'

+          name = 'profile' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

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

+        </UML:Stereotype>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000896'

+          name = 'wchar_t' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000897'

+          name = 'short' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000898'

+          name = '__int64' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:0000000000000899'

+          name = '__w64' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000089A'

+          name = 'signed' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000089B'

+          name = 'unsigned' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000089C'

+          name = 'float' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '-64--88-1-2-914f6a:111b9c5054e:-8000:000000000000089D'

+          name = 'double' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:Interface xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088B'

+          name = 'AnInterface' visibility = 'public' isSpecification = 'false' isRoot = 'false'

+          isLeaf = 'false' isAbstract = 'false'/>

+        <UML:Class xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088D'

+          name = 'AnImplementation' visibility = 'public' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'>

+          <UML:ModelElement.clientDependency>

+            <UML:Abstraction xmi.idref = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088F'/>

+          </UML:ModelElement.clientDependency>

+        </UML:Class>

+        <UML:Abstraction xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088F'

+          name = 'exampleCppRealization' isSpecification = 'false'>

+          <UML:ModelElement.stereotype>

+            <UML:Stereotype xmi.idref = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000890'/>

+            <UML:Stereotype xmi.idref = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000891'/>

+          </UML:ModelElement.stereotype>

+          <UML:Dependency.client>

+            <UML:Class xmi.idref = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088D'/>

+          </UML:Dependency.client>

+          <UML:Dependency.supplier>

+            <UML:Interface xmi.idref = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000088B'/>

+          </UML:Dependency.supplier>

+        </UML:Abstraction>

+        <UML:Stereotype xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000890'

+          name = 'realize' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:0000000000000891'

+          name = 'cppRealization' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

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

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

+          <UML:Stereotype.definedTag>

+            <UML:TagDefinition xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000089A'

+              name = 'cpp_inheritance_visibility' isSpecification = 'false' tagType = 'String'>

+              <UML:TagDefinition.multiplicity>

+                <UML:Multiplicity xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000089E'>

+                  <UML:Multiplicity.range>

+                    <UML:MultiplicityRange xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000089D'

+                      lower = '0' upper = '1'/>

+                  </UML:Multiplicity.range>

+                </UML:Multiplicity>

+              </UML:TagDefinition.multiplicity>

+              <UML:ModelElement.taggedValue>

+                <UML:TaggedValue xmi.id = '10-0-1-5--c7850e9:112476951ff:-8000:000000000000089F'

+                  isSpecification = 'false'>

+                  <UML:TaggedValue.dataValue>Default value is public and possible values are: private, protected and public.</UML:TaggedValue.dataValue>

+                  <UML:TaggedValue.type>

+                    <UML:TagDefinition xmi.idref = '.:0000000000000892'/>

+                  </UML:TaggedValue.type>

+                </UML:TaggedValue>

+              </UML:ModelElement.taggedValue>

+            </UML:TagDefinition>

+          </UML:Stereotype.definedTag>

+        </UML:Stereotype>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:0000000000000896'

+          name = 'signed char' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:0000000000000897'

+          name = 'signed int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:0000000000000898'

+          name = 'unsigned short int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:0000000000000899'

+          name = 'unsigned short' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089A'

+          name = 'unsigned long int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089B'

+          name = 'signed long int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089C'

+          name = 'signed long' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089D'

+          name = 'long int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089E'

+          name = 'signed short int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:000000000000089F'

+          name = 'signed short' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:00000000000008A0'

+          name = 'short int' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+        <UML:DataType xmi.id = '127-0-0-1-736e6ab1:112c4a4e27a:-8000:00000000000008A1'

+          name = 'long double' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'/>

+      </UML:Namespace.ownedElement>

+    </UML:Model>

+  </XMI.content>

+</XMI>


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-java.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-java.xmi?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-java.xmi	2007-08-13 14:10:35-0700
@@ -0,0 +1,100 @@
+<?xml version = '1.0' encoding = 'UTF-8' ?>

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

+  <XMI.header>    <XMI.documentation>
+      <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
+      <XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-05-12 03:08:08 -0300 $ </XMI.exporterVersion>
+    </XMI.documentation>
+    <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>

+  <XMI.content>

+    <UML:Model xmi.id = '.:000000000000087A' name = 'UML Profile for Java' isSpecification = 'false'

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

+      <UML:Namespace.ownedElement>

+        <UML:Package xmi.id = '.:0000000000000869' name = 'java' isSpecification = 'false'

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

+          <UML:Namespace.ownedElement>

+            <UML:Package xmi.id = '.:000000000000085A' name = 'lang' isSpecification = 'false'

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

+              <UML:Namespace.ownedElement>

+                <UML:Class xmi.id = '.:0000000000000850' name = 'Object' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000851' name = 'Char' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000852' name = 'Byte' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000853' name = 'Boolean' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000854' name = 'Short' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000855' name = 'Integer' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000856' name = 'Long' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000857' name = 'Float' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000858' name = 'Double' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000859' name = 'String' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+              </UML:Namespace.ownedElement>

+            </UML:Package>

+            <UML:Package xmi.id = '.:0000000000000863' name = 'util' isSpecification = 'false'

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

+              <UML:Namespace.ownedElement>

+                <UML:Class xmi.id = '.:000000000000085B' name = 'Vector' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Interface xmi.id = '.:000000000000085C' name = 'Collection' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+                <UML:Interface xmi.id = '.:000000000000085D' name = 'Iterator' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+                <UML:Interface xmi.id = '.:000000000000085E' name = 'List' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+                <UML:Class xmi.id = '.:000000000000085F' name = 'Date' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000860' name = 'Time' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Interface xmi.id = '.:0000000000000861' name = 'Set' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+                <UML:Interface xmi.id = '.:0000000000000862' name = 'SortedSet' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+              </UML:Namespace.ownedElement>

+            </UML:Package>

+            <UML:Package xmi.id = '.:0000000000000866' name = 'math' isSpecification = 'false'

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

+              <UML:Namespace.ownedElement>

+                <UML:Class xmi.id = '.:0000000000000864' name = 'BigDecimal' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+                <UML:Class xmi.id = '.:0000000000000865' name = 'BigInteger' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+              </UML:Namespace.ownedElement>

+            </UML:Package>

+            <UML:Package xmi.id = '.:0000000000000868' name = 'net' isSpecification = 'false'

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

+              <UML:Namespace.ownedElement>

+                <UML:Class xmi.id = '.:0000000000000867' name = 'URL' isSpecification = 'false'

+                  isRoot = 'false' isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>

+              </UML:Namespace.ownedElement>

+            </UML:Package>

+          </UML:Namespace.ownedElement>

+        </UML:Package>

+        <UML:DataType xmi.id = '.:000000000000086B' name = 'void' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:000000000000086C' name = 'int' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:000000000000086D' name = 'short' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:000000000000086E' name = 'long' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:000000000000086F' name = 'double' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:0000000000000870' name = 'float' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:0000000000000871' name = 'char' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:0000000000000872' name = 'byte' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+        <UML:DataType xmi.id = '.:0000000000000873' name = 'boolean' isSpecification = 'false'

+          isRoot = 'false' isLeaf = 'false' isAbstract = 'false'/>

+      </UML:Namespace.ownedElement>

+    </UML:Model>

+  </XMI.content>

+</XMI>


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/default-uml14.xmi	2007-08-13 14:10:35-0700
@@ -0,0 +1,249 @@
+<?xml version = '1.0' encoding = 'UTF-8' ?>

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

+  <XMI.header>    <XMI.documentation>
+      <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
+      <XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-05-12 03:08:08 -0300 $ </XMI.exporterVersion>
+    </XMI.documentation>
+    <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>

+  <XMI.content>

+    <UML:Model xmi.id = '.:000000000000087A' name = 'UML 1.4' isSpecification = 'false'

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

+      <UML:ModelElement.taggedValue>

+        <UML:TaggedValue xmi.id = '.:000000000000087B' isSpecification = 'false'>

+          <UML:TaggedValue.dataValue>This model contains the UML Standard Elements from Appendix A of the UML 1.4 specification.</UML:TaggedValue.dataValue>

+          <UML:TaggedValue.type>

+            <UML:TagDefinition xmi.idref = '.:000000000000087C'/>

+          </UML:TaggedValue.type>

+        </UML:TaggedValue>

+      </UML:ModelElement.taggedValue>

+      <UML:Namespace.ownedElement>

+        <UML:Stereotype xmi.id = '.:0000000000000821' name = 'access' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000822' name = 'friend' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000823' name = 'import' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000824' name = 'association' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000825' name = 'global' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000826' name = 'local' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000827' name = 'parameter' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000828' name = 'self' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000829' name = 'become' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082A' name = 'copy' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082B' name = 'create' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082C' name = 'call' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082D' name = 'instantiate' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082E' name = 'send' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000082F' name = 'create' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000830' name = 'destroy' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000831' name = 'create' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000832' name = 'destroy' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000833' name = 'derive' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000834' name = 'realize' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000835' name = 'refine' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000836' name = 'trace' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000837' name = 'document' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000838' name = 'executable' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000839' name = 'file' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083A' name = 'library' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083B' name = 'table' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083C' name = 'facade' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083D' name = 'framework' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083E' name = 'metamodel' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000083F' name = 'stub' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000840' name = 'implementation' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000841' name = 'implementation' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000842' name = 'type' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000843' name = 'implicit' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000844' name = 'invariant' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000845' name = 'postcondition' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000846' name = 'precondition' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000847' name = 'metaclass' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000848' name = 'powertype' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000849' name = 'process' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084A' name = 'thread' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084B' name = 'utility' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084C' name = 'requirement' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084D' name = 'responsibility' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084E' name = 'topLevel' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000084F' name = 'systemModel' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:000000000000086A' name = 'signalflow' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000874' name = 'appliedProfile' isSpecification = 'false'

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

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

+        </UML:Stereotype>

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

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000876' name = 'modelLibrary' isSpecification = 'false'

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

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

+        </UML:Stereotype>

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

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000878' name = 'source' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:Stereotype xmi.id = '.:0000000000000879' name = 'stateInvariant' isSpecification = 'false'

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

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

+        </UML:Stereotype>

+        <UML:TagDefinition xmi.id = '.:000000000000087C' name = 'documentation'

+          isSpecification = 'false' tagType = 'String'>

+          <UML:TagDefinition.multiplicity>

+            <UML:Multiplicity xmi.id = '.:000000000000087D'>

+              <UML:Multiplicity.range>

+                <UML:MultiplicityRange xmi.id = '.:000000000000087E' lower = '0' upper = '1'/>

+              </UML:Multiplicity.range>

+            </UML:Multiplicity>

+          </UML:TagDefinition.multiplicity>

+        </UML:TagDefinition>

+      </UML:Namespace.ownedElement>

+    </UML:Model>

+  </XMI.content>

+</XMI>


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/action.properties	2007-08-13 14:10:35-0700
@@ -77,6 +77,7 @@
 action.empty-trash = Empty Trash
 action.exit = Exit
 action.export-project-as-xmi = Export XMI...
+action.export-profile-as-xmi = Export profile model as XMI...
 action.find = Find...
 action.generate-all-classes = Generate All Classes...
 action.generate-code-for-project = Generate Code for Project...

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/menu.properties	2007-08-13 14:10:35-0700
@@ -274,4 +274,12 @@
 menu.popup.uses = {0} Uses {1}
 menu.popup.visibility = Visibility
 menu.popup.visibility.mnemonic = V
+menu.popup.stereotype-view = Stereotype Visualization
+menu.popup.stereotype-view.mnemonic = S
+menu.popup.stereotype-view.textual = Textual
+menu.popup.stereotype-view.textual.mnemonic = T
+menu.popup.stereotype-view.big-icon = Big Icon
+menu.popup.stereotype-view.big-icon.mnemonic = B
+menu.popup.stereotype-view.small-icon = Small Icons
+menu.popup.stereotype-view.small-icon.mnemonic = S
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/misc.properties	2007-08-13 14:10:35-0700
@@ -147,9 +147,12 @@
 misc.primitive.rounded-rectangle = Rounded Rectangle
 misc.primitive.spline = Spline
 misc.primitive.text = Text
+misc.profile.model = Profile->Model
+misc.profileconfiguration.profile = Profile Configuration->Profile
 misc.project.collaboration = Project->Collaboration
 misc.project.diagram = Project->Diagram
 misc.project.model = Project->Model
+misc.project.profileconfiguration = Project->Profile Configuration
 misc.project.roots = Project->Root Elements
 misc.project.state-machine = Project->State Machine
 misc.properties = Properties

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/i18n/tab.properties	2007-08-13 14:10:35-0700
@@ -46,3 +46,19 @@
 tab.user = User
 tab.modules = Modules
 
+tab.profiles = Profiles
+tab.profiles.userdefined.load = Load profile from file...
+tab.profiles.userdefined.unload = Unload
+tab.profiles.userdefined.available = Available Profiles:
+tab.profiles.userdefined.active = Active Profiles:
+tab.profiles.userdefined.default = Default Profiles:
+tab.profiles.userdefined.errorloading = Error opening profile!
+
+tab.profiles.directories.desc = Default XMI directories:
+tab.profiles.directories.add = Add
+tab.profiles.directories.remove = Remove
+tab.profiles.directories.refresh = Refresh
+
+tab.profiles.cannotdelete = Only user defined profiles can be unregistered!
+tab.profiles.confirmdeleteunregistered = The selected profile is only available in this project, after removed there is no way to add it again. Are you sure you want to remove it?
+tab.profiles.confirmdeleteunregistered.title = Confirm
\ No newline at end of file

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/MemberList.java	2007-08-13 14:10:35-0700
@@ -34,6 +34,7 @@
 import org.argouml.uml.ProjectMemberModel;
 import org.argouml.uml.cognitive.ProjectMemberTodoList;
 import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.tigris.gef.base.Diagram;
 
 /**
@@ -62,6 +63,7 @@
     private List<ProjectMemberDiagram> diagramMembers = 
         new ArrayList<ProjectMemberDiagram>(10);
     private AbstractProjectMember todoList;
+    private AbstractProjectMember profileConfiguration;
 
     /**
      * The constructor.
@@ -74,12 +76,15 @@
 
         if (member instanceof ProjectMemberModel) {
             // Always put the model at the top
-            model = (AbstractProjectMember) member;
+            model = (AbstractProjectMember) member;            
             return true;
         } else if (member instanceof ProjectMemberTodoList) {
             // otherwise add the diagram at the start
             setTodoList((AbstractProjectMember) member);
             return true;
+        } else if (member instanceof ProfileConfiguration) {
+            setProfileConfiguration((AbstractProjectMember) member);
+            return true;
         } else if (member instanceof ProjectMemberDiagram) {
             // otherwise add the diagram at the start
             return diagramMembers.add((ProjectMemberDiagram) member);
@@ -100,6 +105,10 @@
             LOG.info("Removing todo list");
             setTodoList(null);
             return true;
+        } else if (profileConfiguration == member) {
+            LOG.info("Removing profile configuration");
+            setProfileConfiguration(null);
+            return true;
         } else {
             return diagramMembers.remove(member);
         }
@@ -114,6 +123,9 @@
         if (todoList != null) {
             temp.add(todoList);
         }
+        if (profileConfiguration != null) {
+            temp.add(profileConfiguration);
+        }
         return temp.iterator();
     }
 
@@ -126,6 +138,9 @@
         if (todoList != null) {
             temp.add(todoList);
         }
+        if (profileConfiguration != null) {
+            temp.add(profileConfiguration);
+        }
         return temp.listIterator();
     }
 
@@ -138,6 +153,9 @@
         if (todoList != null) {
             temp.add(todoList);
         }
+        if (profileConfiguration != null) {
+            temp.add(profileConfiguration);
+        }
         return temp.listIterator(arg0);
     }
 
@@ -163,6 +181,9 @@
         if (todoList != null) {
             ++size;
         }
+        if (profileConfiguration != null) {
+            ++size;
+        }
         return size;
     }
 
@@ -173,6 +194,9 @@
         if (model == member) {
             return true;
         }
+        if (profileConfiguration == member) {
+            return true;
+        }
         return diagramMembers.contains(member);
     }
 
@@ -184,6 +208,10 @@
         if (todoList != null) {
             todoList.remove();
         }
+        if (profileConfiguration != null) {
+            profileConfiguration.remove();
+        }
+
         Iterator membersIt = diagramMembers.iterator();
         while (membersIt.hasNext()) {
             ((AbstractProjectMember) membersIt.next()).remove();
@@ -202,6 +230,9 @@
         if (type == ProjectMemberTodoList.class) {
             return todoList;
         }
+        if (type == ProfileConfiguration.class) {
+            return profileConfiguration;
+        }
         throw new IllegalArgumentException(
             "There is no single instance of a " + type.getName() + " member");
     }
@@ -224,6 +255,11 @@
         if (type == ProjectMemberDiagram.class) {
             return diagramMembers;
         }
+        if (type == ProfileConfiguration.class) {
+            List temp = new ArrayList(1);
+            temp.add(profileConfiguration);
+            return temp;
+        }
         throw new IllegalArgumentException(
             "There is no single instance of a " + type.getName() + " member");
     }
@@ -239,6 +275,9 @@
         if (i == diagramMembers.size()) {
             return todoList;
         }
+        if (i == diagramMembers.size()+1) {
+            return profileConfiguration;
+        }
 
         return diagramMembers.get(i);
     }
@@ -259,6 +298,9 @@
         if (todoList != null) {
             temp[pos++] = todoList;
         }
+        if (profileConfiguration != null) {
+            temp[pos++] = profileConfiguration;
+        }
         return temp;
     }
 
@@ -314,4 +356,12 @@
     public List subList(int arg0, int arg1) {
         throw new UnsupportedOperationException();
     }
+
+    public AbstractProjectMember getProfileConfiguration() {
+        return profileConfiguration;
+    }
+
+    public void setProfileConfiguration(AbstractProjectMember profileConfiguration) {
+        this.profileConfiguration = profileConfiguration;
+    }
 }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/Project.java	2007-08-13 14:10:35-0700
@@ -33,8 +33,9 @@
 import java.util.Map;
 import java.util.Vector;
 
-import org.argouml.uml.Profile;
 import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.profile.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.tigris.gef.presentation.Fig;
 
 /**
@@ -453,7 +454,9 @@
 
     /**
      * @param packages a Collection of packages containing profiles.
+     * @deprecated by maurelio1234. Use {@link #getProfileConfiguration()} instead.
      */
+    @Deprecated
     public void setProfiles(Collection packages);
 
     /**
@@ -469,7 +472,9 @@
      * Get the collection of profile packages.
      *
      * @return collection of Packages containing profiles.
+     * @deprecated by maurelio1234. Use {@link #getProfileConfiguration()} instead.
      */
+    @Deprecated
     public Object getProfiles();
 
     /**
@@ -597,7 +602,9 @@
 
     /**
      * @return Returns the profile.
+     * @deprecated by maurelio1234. Use {@link #getProfiles()} instead.
      */
+    @Deprecated
     public Profile getProfile();
 
     /**
@@ -613,4 +620,14 @@
      */
     public ProjectSettings getProjectSettings();
 
+    /**
+     * @return Returns the profile configuration.
+     */
+    public ProfileConfiguration getProfileConfiguration();
+
+	/**
+     * Sets the profile configuration
+     */
+    public void setProfileConfiguration(ProfileConfiguration pc);
+
 }
\ No newline at end of file

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectImpl.java	2007-08-13 14:10:35-0700
@@ -52,14 +52,13 @@
 import org.argouml.persistence.PersistenceManager;
 import org.argouml.ui.explorer.ExplorerEventAdaptor;
 import org.argouml.uml.CommentEdge;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
-import org.argouml.uml.ProfileJava;
 import org.argouml.uml.ProjectMemberModel;
 import org.argouml.uml.cognitive.ProjectMemberTodoList;
 import org.argouml.uml.diagram.ArgoDiagram;
 import org.argouml.uml.diagram.DiagramFactory;
 import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.undo.Memento;
 import org.tigris.gef.undo.UndoManager;
@@ -131,13 +130,12 @@
      */
     private final List<ArgoDiagram> diagrams = new ArrayList<ArgoDiagram>();
     
-    private Collection<Object> profilePackages = new HashSet<Object>();
     private Object currentNamespace;
     private Map<String, Object> uuidRefs;
     private transient VetoableChangeSupport vetoSupport;
 
-    private Profile profile;
-
+    private ProfileConfiguration profileConfiguration;
+    
     /**
      * The active diagram, pointer to a diagram in the list with diagrams.
      */
@@ -165,7 +163,8 @@
      * Constructor.
      */
     public ProjectImpl() {
-        profile = new ProfileJava();
+        setProfileConfiguration(new ProfileConfiguration(this));
+
         projectSettings = new ProjectSettings();
 
         Model.getModelManagementFactory().setRootModel(null);
@@ -181,21 +180,9 @@
         defaultModelTypeCache = new HashMap<String, Object>();
 
         LOG.info("making empty project with empty model");
-        try {
-            // Jaap Branderhorst 2002-12-09
-            // load the default model
-            // this is NOT the way how it should be since this makes argo
-            // depend on Java even more.
-            setProfiles(profile.getProfilePackages());
-        } catch (ProfileException e) {
-            // TODO: how are we going to handle exceptions here?
-            // I think we need a ProjectException.
-            LOG.error("Exception setting the default profile", e);
-        }
         addSearchPath("PROJECT_DIR");
     }
 
-
     public String getBaseName() {
         String n = getName();
         n = PersistenceManager.getInstance().getBaseName(n);
@@ -359,6 +346,7 @@
     }
 
 
+    @SuppressWarnings("unchecked")
     public void addModel(Object model) {
 
         if (!Model.getFacade().isANamespace(model)) {
@@ -509,7 +497,7 @@
     }
 
 
-    @SuppressWarnings("deprecation")
+    @SuppressWarnings({ "deprecation", "unchecked" })
     public Vector getUserDefinedModels() {
         return new Vector(models);
     }
@@ -520,10 +508,12 @@
     }
 
 
+    @SuppressWarnings("unchecked")
     public Collection getModels() {
         Set ret = new HashSet();
         ret.addAll(models);
-        ret.addAll(profilePackages);
+        // TODO are the profiles part of the getModels()???
+//        ret.addAll(profilePackages);
         return ret;
     }
 
@@ -535,30 +525,23 @@
         return models.get(0);
     }
 
-
     public Object findType(String s) {
         return findType(s, true);
     }
 
-
     public Object getDefaultAttributeType() {
-        // TODO: Move this to a profile - tfm - 20070307
-        return findType("int");
+        return profileConfiguration.getDefaultAttributeType();
     }
 
-
     public Object getDefaultParameterType() {
-        // TODO: Move this to a profile - tfm - 20070307
-        return findType("int");
+        return profileConfiguration.getDefaultParameterType();
     }
     
-
     public Object getDefaultReturnType() {
-        // TODO: Move this to a profile - tfm - 20070307
-        return findType("void");
+        return profileConfiguration.getDefaultReturnType();
     }
 
-
+    @SuppressWarnings("deprecation")
     public Object findType(String s, boolean defineNew) {
         if (s != null) {
             s = s.trim();
@@ -574,6 +557,7 @@
             }
         }
         cls = findTypeInDefaultModel(s);
+        
         // hey, now we should move it to the model the user is working in
         // TODO: Remove this when we support linked profiles - tfm - 20070726
         if (cls != null) {
@@ -603,6 +587,7 @@
     }
 
 
+    @SuppressWarnings("unchecked")
     public Collection findAllPresentationsFor(Object obj) {
         Collection figs = new ArrayList();
         for (ArgoDiagram diagram : diagrams) {
@@ -614,16 +599,6 @@
         return figs;
     }
 
-    private Object findTypeInPackages(String name, Collection namespaces) {
-        for (Object namespace : namespaces) {
-            Object type = findTypeInModel(name, namespace);
-            if (type != null) {
-                return type;
-            }
-        }
-        return null;
-    }
-
     public Object findTypeInModel(String typeName, Object namespace) {
         if (typeName == null) {
             throw new IllegalArgumentException("typeName must be non-null");
@@ -857,6 +832,7 @@
      *
      * @param obj the object to be thrown away
      */
+    @SuppressWarnings("unchecked")
     protected void trashInternal(Object obj) {
         if (Model.getFacade().isAModel(obj)) {
             return; //Can not delete the model
@@ -914,54 +890,18 @@
 
     @SuppressWarnings("deprecation")
     public void setDefaultModel(Object theDefaultModel) {
-
-        if (!Model.getFacade().isAModel(theDefaultModel)) {
-            throw new IllegalArgumentException(
-                    "The default model must be a Model type. Received a "
-                    + theDefaultModel.getClass().getName());
-        }
-
-        profilePackages.clear();
-        profilePackages.add(theDefaultModel);
-        defaultModelTypeCache = new HashMap<String, Object>();
-    }
-
-
-    public void setProfiles(Collection packages) {
-
-        for (Object pkg : packages) {
-            if (!Model.getFacade().isAPackage(pkg)) {
-                throw new IllegalArgumentException(
-                        "Profiles must be of type Package. Received a "
-                                + pkg.getClass().getName());
-            }
-        }
-
-        profilePackages.clear();
-        profilePackages.addAll(packages);
         defaultModelTypeCache = new HashMap<String, Object>();
     }
 
     @SuppressWarnings("deprecation")
     public Object getDefaultModel() {
-        // First priority is Model for best backward compatibility
-        for (Object pkg : profilePackages) {
-            if (Model.getFacade().isAModel(pkg)) {
-                return pkg;
-            }
-        }
-        // then a Package
-        for (Object pkg : profilePackages) {
-            if (Model.getFacade().isAPackage(pkg)) {
-                return pkg;
-            }
-        }
-        // if all else fails, just the first element
-        return profilePackages.iterator().next();
+		throw new UnsupportedOperationException();
     }
     
+    @SuppressWarnings("deprecation")
+    @Deprecated
     public Collection getProfiles() {
-        return profilePackages;
+		throw new UnsupportedOperationException();
     }
 
     public Object findTypeInDefaultModel(String name) {
@@ -969,7 +909,8 @@
             return defaultModelTypeCache.get(name);
         }
 
-        Object result = findTypeInPackages(name, profilePackages);
+        Object result = profileConfiguration.findType(name);
+        
         defaultModelTypeCache.put(name, result);
         return result;
     }
@@ -1036,7 +977,7 @@
     }
 
 
-    @SuppressWarnings("deprecation")
+    @SuppressWarnings({ "deprecation", "unchecked" })
     public Vector<String> getSearchpath() {
         return new Vector(searchpath);
     }
@@ -1092,15 +1033,6 @@
         roots.clear();
         models.clear();
 
-        if (profilePackages != null) {
-            for (Object pkg : profilePackages) {
-                LOG.debug("Deleting profile element "
-                        + Model.getFacade().getName(pkg));
-                Model.getUmlFactory().delete(pkg);
-            }
-            profilePackages.clear();
-        }
-
         diagrams.clear();
 
         if (uuidRefs != null) {
@@ -1139,8 +1071,10 @@
     }
 
 
+    @SuppressWarnings("deprecation")
+    @Deprecated
     public Profile getProfile() {
-        return profile;
+		throw new UnsupportedOperationException();
     }
 
 
@@ -1159,4 +1093,25 @@
         return projectSettings;
     }
 
+    public ProfileConfiguration getProfileConfiguration() {
+        return profileConfiguration;
+    }
+
+    public void setProfileConfiguration(ProfileConfiguration pc) {
+        if (this.profileConfiguration != null) {
+            this.members.remove(this.profileConfiguration);         
+        }
+        
+        this.profileConfiguration = pc;
+
+        // there's just one ProfileConfiguration in a project
+        // and there's no other way to add another one
+        members.add(pc);        
+    }
+
+    @SuppressWarnings("deprecation")
+    @Deprecated
+    public void setProfiles(Collection packages) {
+        throw new UnsupportedOperationException();
+    }
 }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/kernel/ProjectSettings.java	2007-08-13 14:10:35-0700
@@ -35,6 +35,8 @@
 import org.argouml.notation.Notation;
 import org.argouml.notation.NotationName;
 import org.argouml.notation.NotationProviderFactory2;
+import org.argouml.ui.SettingsTabProfile;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
 import org.tigris.gef.undo.Memento;
 import org.tigris.gef.undo.UndoManager;
 
@@ -65,6 +67,7 @@
     private boolean showStereotypes;
     private boolean showSingularMultiplicities;
     private int defaultShadowWidth;
+    private int defaultStereotypeView;
     
     /* Generation preferences: */
     private String headerComment =
@@ -114,6 +117,9 @@
                 Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES, true); 
         defaultShadowWidth = Configuration.getInteger(
                 Notation.KEY_DEFAULT_SHADOW_WIDTH, 1);
+        defaultStereotypeView = Configuration.getInteger(
+                SettingsTabProfile.KEY_DEFAULT_STEREOTYPE_VIEW,
+                FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);
 
         /* Generation preferences: */
         if (System.getProperty("file.separator").equals("/")) {
@@ -692,6 +698,23 @@
     public void setDefaultShadowWidth(String width) {
         setDefaultShadowWidth(Integer.parseInt(width));
     }
+
+    /**
+     * Used by "argo.tee".
+     * 
+     * @return Returns the default stereotype view
+     */
+    public String getDefaultStereotypeView() {
+        return new Integer(defaultStereotypeView).toString();
+    }
+    
+    /**
+     * @return Returns the default stereotype view
+     */
+    public int getDefaultStereotypeViewValue() {
+        return defaultStereotypeView;
+    }
+    
     
     /**
      * Used by "argo.tee".
@@ -716,6 +739,37 @@
     public String getHeaderComment() { return headerComment; }
 
     /**
+     * @param defaultStereotypeView the default stereotype view
+     */
+    public void setDefaultStereotypeView(final int newView) {
+        this.defaultStereotypeView = defaultStereotypeView;
+
+        if (defaultStereotypeView == newView) return;
+
+        final int oldValue = defaultStereotypeView;
+
+        Memento memento = new Memento() {
+            private final ConfigurationKey key = 
+                SettingsTabProfile.KEY_DEFAULT_STEREOTYPE_VIEW;
+
+            public void redo() {
+                defaultStereotypeView = newView;
+                fireEvent(key, oldValue, newView);
+            }
+
+            public void undo() {
+                defaultStereotypeView = oldValue;
+                fireEvent(key, newView, oldValue);
+            }
+        };
+        if (UndoManager.getInstance().isGenerateMementos()) {
+            UndoManager.getInstance().addMemento(memento);
+        }
+        memento.redo();
+        ProjectManager.getManager().setSaveEnabled(true);
+    }
+
+    /**
      * @param c the header comment string
      */
     public void setHeaderComment(String c) { headerComment = c; }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ModelMemberFilePersister.java	2007-08-13 14:10:35-0700
@@ -33,7 +33,6 @@
 import java.io.Writer;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -59,6 +58,7 @@
 import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
 import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
 import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.xml.sax.InputSource;
 
 /**
@@ -241,6 +241,8 @@
             persister =
                 PersistenceManager.getInstance()
                     .getDiagramMemberFilePersister();
+        } else if (pm instanceof ProfileConfiguration) {
+            persister = new ProfileConfigurationFilePersister();
         } else if (pm instanceof ProjectMemberTodoList) {
             persister = new TodoListMemberFilePersister();
         }

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ProfileConfigurationFilePersister.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,249 @@
+// $Id: ProfileConfigurationFilePersister.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.persistence;

+

+import java.io.BufferedReader;

+import java.io.ByteArrayInputStream;

+import java.io.File;

+import java.io.IOException;

+import java.io.InputStream;

+import java.io.InputStreamReader;

+import java.io.OutputStream;

+import java.io.PrintWriter;

+import java.io.StringReader;

+import java.io.StringWriter;

+import java.io.Writer;

+import java.net.URL;

+import java.util.Collection;

+import java.util.Iterator;

+import java.util.Vector;

+

+import org.argouml.application.helpers.ApplicationVersion;

+import org.argouml.kernel.Project;

+import org.argouml.kernel.ProjectMember;

+import org.argouml.model.Model;

+import org.argouml.model.UmlException;

+import org.argouml.model.XmiReader;

+import org.argouml.model.XmiWriter;

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

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

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

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

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

+import org.xml.sax.InputSource;

+

+/**

+ * Persister for Project's Profile Configuration

+ *

+ * @author maurelio1234

+ */

+public class ProfileConfigurationFilePersister extends MemberFilePersister {

+

+    /**

+     * @return the tag used to store this content on the uml file

+     * 

+     * @see org.argouml.persistence.MemberFilePersister#getMainTag()

+     */

+    public String getMainTag() {

+	return "profile";

+    }

+

+    /**

+     * @param project

+     * @param inputStream

+     * @throws OpenException

+     * 

+     * @see org.argouml.persistence.MemberFilePersister#load(org.argouml.kernel.Project, java.io.InputStream)

+     */

+    public void load(Project project, InputStream inputStream)

+	    throws OpenException {

+	try {

+	    ProfileConfiguration pc = new ProfileConfiguration(project);

+

+	    BufferedReader br = new BufferedReader(new InputStreamReader(

+		    inputStream));

+

+	    String line = null;

+	    while (true) {

+		line = br.readLine();

+		if (line.trim().equals("<profile>")) {

+		    break;

+		}

+	    }

+

+	    while (true) {

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

+

+		if (line.equals("</profile>")) {

+		    break;

+		}

+

+		Profile profile = null;

+		Vector profiles = ProfileManagerImpl.getInstance()

+			.getRegisteredProfiles();

+

+		if (line.equals("<userDefined>")) {

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

+		    String fileName = line.substring(line.indexOf(">")+1, line.indexOf("</")).trim();

+

+                    // consumes the <model> tag

+                    br.readLine();

+                    

+		    File file = new File(fileName);

+

+		    StringBuffer xmi = new StringBuffer();

+                    

+                    while(true) {

+                        line = br.readLine();

+                        if (line == null || line.contains("</model>")) {

+                            break;

+                        }

+                        

+                        xmi.append(line+"\n");

+                    }

+                    

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

+                    profile = new UserDefinedProfile(fileName, model);

+                    

+                    // consumes the </userDefined>

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

+		} else if (line.equals("<plugin>")) {

+		    String className = br.readLine().trim();

+

+                    profile = ProfileManagerImpl.getInstance()

+                            .getProfileForClass(className);

+		    

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

+		}

+

+		if (profile != null) {

+		    pc.addProfile(profile);

+		}

+	    }

+	    project.setProfileConfiguration(pc);

+	} catch (Exception e) {

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

+	    throw new OpenException(e);

+	}

+    }

+

+    /**

+     * @param member

+     * @param writer

+     * @param xmlFragment

+     * @throws SaveException

+     * @deprecated

+     * 

+     * @see org.argouml.persistence.MemberFilePersister#save(org.argouml.kernel.ProjectMember, java.io.Writer, boolean)

+     */

+    public void save(ProjectMember member, Writer writer, boolean xmlFragment)

+	    throws SaveException {

+	PrintWriter w = new PrintWriter(writer);

+	saveProjectMember(member, w);

+    }

+

+    /**

+     * @param member

+     * @param stream

+     * @throws SaveException

+     * 

+     * @see org.argouml.persistence.MemberFilePersister#save(org.argouml.kernel.ProjectMember, java.io.OutputStream)

+     */

+    public void save(ProjectMember member, OutputStream stream)

+	    throws SaveException {

+	PrintWriter w = new PrintWriter(stream);

+	saveProjectMember(member, w);

+        w.flush();

+    }

+

+    private void saveProjectMember(ProjectMember member, PrintWriter w)

+	    throws SaveException {

+	try {

+	    if (member instanceof ProfileConfiguration) {

+		ProfileConfiguration pc = (ProfileConfiguration) member;

+

+		w.println("<?xml version = \"1.0\" encoding = \"UTF-8\" ?>");

+		w.println("<!DOCTYPE profile SYSTEM \"profile.dtd\" >");

+		w.println("<profile>");

+

+		Iterator it = pc.getProfiles().iterator();

+		while (it.hasNext()) {

+                    Profile profile = (Profile) it.next();

+

+                    if (profile instanceof UserDefinedProfile) {

+                        UserDefinedProfile uprofile = (UserDefinedProfile) profile;

+                        w.println("\t\t<userDefined>");

+                        w.println("\t\t\t<filename>"

+                                + uprofile.getModelFile().getName()

+                                + "</filename>");

+                        w.println("\t\t\t<model>");

+

+                        printModelXMI(w, uprofile.getModel());

+

+                        w.println("\t\t\t</model>");

+                        w.println("\t\t</userDefined>");

+                    } else {

+                        w.println("\t\t<plugin>");

+                        w.println("\t\t\t" + profile.getClass().getName());

+                        w.println("\t\t</plugin>");

+                    }

+                }

+

+		w.println("</profile>");

+	    }

+	} catch (Exception e) {

+	    e.printStackTrace();

+	    throw new SaveException(e);

+	}

+    }

+

+    private void printModelXMI(PrintWriter w, Object model) throws UmlException {

+        StringWriter myWriter = new StringWriter();

+        XmiWriter xmiWriter = Model.getXmiWriter(model, myWriter, ApplicationVersion

+                .getVersion()

+                + "(" + UmlFilePersister.PERSISTENCE_VERSION + ")");

+        xmiWriter.write();

+        

+        myWriter.flush();

+        w.println("" + myWriter.toString());

+    }

+

+    private Collection readModelXMI(String xmi) throws UmlException {

+        XmiReader xmiReader = Model.getXmiReader();

+        InputSource inputSource = new InputSource(new ByteArrayInputStream(xmi.getBytes()));

+        Collection elements = xmiReader.parse(inputSource, true);

+        return elements;

+    }

+

+    @Override

+    public void load(Project project, URL url) throws OpenException {

+        try {

+            load(project, url.openStream());

+        } catch (IOException e) {

+            throw new OpenException(e);

+        }

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/UmlFilePersister.java	2007-08-13 14:10:35-0700
@@ -82,7 +82,7 @@
  *
  * @author Bob Tarling
  */
-class UmlFilePersister extends AbstractFilePersister {
+public class UmlFilePersister extends AbstractFilePersister {
 
     /**
      * The PERSISTENCE_VERSION is increased every time the persistence format
@@ -90,7 +90,7 @@
      * This controls conversion of old persistence version files to be
      * converted to the current one, keeping ArgoUML backwards compatible.
      */
-    protected static final int PERSISTENCE_VERSION = 5;
+    public static final int PERSISTENCE_VERSION = 5;
     
     /**
      * The TOTAL_PHASES_LOAD constant is the number of phases used by the load
@@ -691,6 +691,8 @@
                         .getDiagramMemberFilePersister();
         } else if (tag.equals("todo")) {
             persister = new TodoListMemberFilePersister();
+        } else if (tag.equals("profile")) {
+            persister = new ProfileConfigurationFilePersister();
         } else if (tag.equals("xmi")) {
             persister = new ModelMemberFilePersister();
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZargoFilePersister.java	2007-08-13 14:10:35-0700
@@ -52,6 +52,7 @@
 import org.argouml.kernel.Project;
 import org.argouml.kernel.ProjectFactory;
 import org.argouml.kernel.ProjectMember;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.argouml.util.FileConstants;
 import org.argouml.util.ThreadUtils;
 import org.xml.sax.InputSource;
@@ -311,6 +312,7 @@
             
             int pgmlCount = getPgmlCount(file);
             boolean containsToDo = containsTodo(file);
+            boolean containsProfile = containsProfile(file);
 
             // first read the .argo file from Zip
             ZipInputStream zis =
@@ -355,6 +357,10 @@
                     if (containsToDo) {
                         writer.println("<member type='todo' name='.todo' />");
                     }
+                    if (containsProfile) {
+                	String type = ProfileConfiguration.EXTENSION;
+                        writer.println("<member type='"+type+"' name='."+type+"' />");
+                    }
                 }
                 writer.println(line);
             }
@@ -547,6 +553,10 @@
         return !getEntryNames(file, ".todo").isEmpty();
     }
     
+    private boolean containsProfile(File file) throws IOException {
+        return !getEntryNames(file, "." + ProfileConfiguration.EXTENSION).isEmpty();
+    }
+    
     /**
      * Get a list of zip file entries which end with the given extension.
      * If the extension is null, all entries are returned.

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/ZipFilePersister.java	2007-08-13 14:10:35-0700
@@ -46,6 +46,7 @@
 import org.argouml.uml.ProjectMemberModel;
 import org.argouml.uml.cognitive.ProjectMemberTodoList;
 import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.xml.sax.InputSource;
 
 /**
@@ -195,6 +196,8 @@
             persister =
                 PersistenceManager.getInstance()
                     .getDiagramMemberFilePersister();
+        } else if (pm instanceof ProfileConfiguration) {
+            persister = new ProfileConfigurationFilePersister();
         } else if (pm instanceof ProjectMemberTodoList) {
             persister = new TodoListMemberFilePersister();
         } else if (pm instanceof ProjectMemberModel) {

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/persistence/argo.tee	2007-08-13 14:10:35-0700
@@ -41,6 +41,7 @@
     <showstereotypes><ocl>self.projectSettings.showStereotypes</ocl></showstereotypes>
     <showsingularmultiplicities><ocl>self.projectSettings.showSingularMultiplicities</ocl></showsingularmultiplicities>
     <defaultshadowwidth><ocl>self.projectSettings.defaultShadowWidth</ocl></defaultshadowwidth>
+    <defaultstereotypeview><ocl>self.projectSettings.defaultStereotypeView</ocl></defaultstereotypeview>
     <generationoutputdir><ocl>self.projectSettings.generationOutputDir</ocl></generationoutputdir>
   </settings>
   

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/GUI.java	2007-08-13 14:10:35-0700
@@ -59,8 +59,10 @@
         addSettingsTab(new SettingsTabEnvironment());
         addSettingsTab(new SettingsTabUser());
         addSettingsTab(new SettingsTabAppearance());
+        addSettingsTab(new SettingsTabProfile());
 
         addProjectSettingsTab(new ProjectSettingsTabProperties());
+        addProjectSettingsTab(new ProjectSettingsTabProfile());
     }
 
     /**

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProfileSelectionTab.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,424 @@
+// $Id: ProfileSelectionTab.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui;

+

+import java.awt.BorderLayout;

+import java.awt.Dimension;

+import java.awt.FlowLayout;

+import java.awt.event.ActionEvent;

+import java.awt.event.ActionListener;

+import java.io.File;

+import java.util.Vector;

+

+import javax.swing.BoxLayout;

+import javax.swing.JButton;

+import javax.swing.JFileChooser;

+import javax.swing.JLabel;

+import javax.swing.JList;

+import javax.swing.JOptionPane;

+import javax.swing.JPanel;

+import javax.swing.ListModel;

+import javax.swing.event.ListDataEvent;

+import javax.swing.event.ListDataListener;

+import javax.swing.filechooser.FileFilter;

+

+import org.argouml.application.api.GUISettingsTabInterface;

+import org.argouml.i18n.Translator;

+import org.argouml.kernel.ProjectManager;

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

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

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

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

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

+

+/**

+ * The Tab where new profiles can be added and the registered

+ * ones can be activated or deactivated on current project

+ *

+ * @author Marcos Aurélio

+ */

+public class ProfileSelectionTab extends JPanel implements

+	GUISettingsTabInterface, ActionListener {

+

+    private JButton loadFromFile = new JButton(Translator

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

+

+    private JButton unregisterProfile = new JButton(Translator

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

+

+    private JButton addButton = new JButton(">>");

+

+    private JButton removeButton = new JButton("<<");

+

+    private JList availableList = new JList(new AvailableProfilesListModel());

+

+    private JList usedList = new JList(new UsedProfilesListModel());

+

+    /**

+     * This List contains the registered profiles that have not been applied

+     * to the current project  

+     * 

+     * @author maurelio1234

+     */

+    private class AvailableProfilesListModel implements ListModel {

+	private ProfileManager profileManager = ProfileManagerImpl

+		.getInstance();

+

+	private Vector listeners = new Vector();

+

+	/**

+         * @param arg0

+         * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+         */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fire listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n the profile to be returned

+	 * @return the n-th profile at the registered profiles list

+	 */

+	public Profile getProfileAt(int n) {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!config.getProfiles().contains(

+			registeredProfiles.elementAt(i))) {

+

+		    if (count == n) {

+			return ((Profile) registeredProfiles.elementAt(i));

+		    }

+		    ++count;

+		}

+	    }

+	    return null;

+	}

+

+	/**

+	 * @param arg0

+	 * @return the arg0-th element of this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int arg0) {

+	    Profile p = getProfileAt(arg0);

+	    if (p != null) {

+		return p.getDisplayName();

+	    } else {

+		return null;

+	    }

+	}

+

+	/**

+	 * @return the amount of registered profiles not applied to current 

+	 * 		project

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!config.getProfiles().contains(

+			registeredProfiles.elementAt(i))) {

+		    ++count;

+		}

+	    }

+	    return count;

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * This list contains the profiles that are applied to the current project

+     * 

+     * @author maurelio1234

+     */

+    private class UsedProfilesListModel implements ListModel {

+	private Vector listeners = new Vector();

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fires listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 */

+	public Profile getProfileAt(int n) {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    return ((Profile) config.getProfiles().elementAt(n));

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int n) {

+            ProfileConfiguration config = ProjectManager.getManager()

+                    .getCurrentProject().getProfileConfiguration();

+            if (n >= 0 && n < config.getProfiles().size()) {

+                return ((Profile) config.getProfiles().elementAt(n))

+                        .getDisplayName();

+            } else {

+                return null;

+            }

+	}

+

+	/**

+	 * @return the amount of elements in the list

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    return config.getProfiles().size();

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * The default constructor for this class

+     */

+    public ProfileSelectionTab() {

+	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

+

+	JPanel configPanel = new JPanel();

+	configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));

+

+	availableList.setPrototypeCellValue("12345678901234567890");

+	usedList.setPrototypeCellValue("12345678901234567890");

+

+	availableList.setMinimumSize(new Dimension(50, 50));

+	usedList.setMinimumSize(new Dimension(50, 50));

+

+	JPanel leftList = new JPanel();

+	leftList.setLayout(new BorderLayout());

+	leftList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.unload")),

+		BorderLayout.NORTH);

+	leftList.add(availableList, BorderLayout.CENTER);

+	configPanel.add(leftList);

+

+	JPanel centerButtons = new JPanel();

+	centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));

+	centerButtons.add(addButton);

+	centerButtons.add(removeButton);

+	configPanel.add(centerButtons);

+

+	JPanel rightList = new JPanel();

+	rightList.setLayout(new BorderLayout());

+	rightList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.active")),

+		BorderLayout.NORTH);

+	rightList.add(usedList, BorderLayout.CENTER);

+	configPanel.add(rightList);

+

+	addButton.addActionListener(this);

+	removeButton.addActionListener(this);

+

+	add(configPanel);

+

+	JPanel lffPanel = new JPanel();

+	lffPanel.setLayout(new FlowLayout());

+	lffPanel.add(loadFromFile);

+	lffPanel.add(unregisterProfile);

+

+	loadFromFile.addActionListener(this);

+	unregisterProfile.addActionListener(this);

+

+	add(lffPanel);

+    }

+

+    /**

+     * @param arg0

+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+     */

+    public void actionPerformed(ActionEvent arg0) {

+        AvailableProfilesListModel modelAvl = ((AvailableProfilesListModel) availableList

+                .getModel());

+        UsedProfilesListModel modelUsd = ((UsedProfilesListModel) usedList

+                .getModel());

+

+        if (arg0.getSource() == addButton) {

+            if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                ProjectManager.getManager().getCurrentProject()

+                        .getProfileConfiguration().addProfile(selected);

+                

+                modelAvl.fireListeners();

+                modelUsd.fireListeners();

+            }

+	} else if (arg0.getSource() == removeButton) {

+            if (usedList.getSelectedIndex() != -1) {

+                Profile selected = modelUsd.getProfileAt(usedList

+                        .getSelectedIndex());

+                ProjectManager.getManager().getCurrentProject()

+                        .getProfileConfiguration().removeProfile(selected);

+                

+                modelAvl.fireListeners();

+                modelUsd.fireListeners();

+            }

+	} else if (arg0.getSource() == unregisterProfile) {

+	    if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                if (selected instanceof UserDefinedProfile) {

+                    ProfileManagerImpl.getInstance().removeProfile(selected);

+

+                    modelAvl.fireListeners();

+                    modelUsd.fireListeners();

+                } else {

+                    JOptionPane.showMessageDialog(this,

+                            "Only user defined profiles can be removed");

+                }

+            }

+        } else if (arg0.getSource() == loadFromFile) {

+            JFileChooser fileChooser = new JFileChooser();

+            fileChooser.setFileFilter(new FileFilter() {

+

+                public boolean accept(File file) {

+                    return file.isDirectory()

+                            || (file.isFile() 

+                                    && (file.getName().toLowerCase().endsWith(".xml") 

+                                          || file.getName().toLowerCase().endsWith(".xmi")));

+                }

+

+                public String getDescription() {

+                    return "*.XMI";

+                }

+

+            });

+

+	    int ret = fileChooser.showOpenDialog(this);

+	    if (ret == JFileChooser.APPROVE_OPTION) {

+		File file = fileChooser.getSelectedFile();

+

+		UserDefinedProfile profile = new UserDefinedProfile(file);

+

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

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

+

+		    ProjectManager.getManager().getCurrentProject()

+			    .getProfileConfiguration().addProfile(profile);

+

+		    UsedProfilesListModel model = 

+			((UsedProfilesListModel) usedList.getModel());

+		    model.fireListeners();

+		} else {

+		    JOptionPane.showMessageDialog(this,

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

+		}

+	    }

+	}

+

+	availableList.validate();

+	usedList.validate();

+    }

+

+    /**

+     * @return the internationalization key that containing the name of this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()

+     */

+    public String getTabKey() {

+	return "tab.profiles";

+    }

+

+    /**

+     * @return the panel containing this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()

+     */

+    public JPanel getTabPanel() {

+	return this;

+    }

+

+    public void handleResetToDefault() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabCancel() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabRefresh() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabSave() {

+	// TODO: Auto-generated method stub

+

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/ProjectSettingsTabProfile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,524 @@
+// $Id: ProfileSelectionTab.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui;

+

+import java.awt.BorderLayout;

+import java.awt.Dimension;

+import java.awt.FlowLayout;

+import java.awt.event.ActionEvent;

+import java.awt.event.ActionListener;

+import java.awt.event.ItemEvent;

+import java.awt.event.ItemListener;

+import java.io.File;

+import java.util.Vector;

+

+import javax.swing.BoxLayout;

+import javax.swing.DefaultComboBoxModel;

+import javax.swing.JButton;

+import javax.swing.JComboBox;

+import javax.swing.JFileChooser;

+import javax.swing.JLabel;

+import javax.swing.JList;

+import javax.swing.JOptionPane;

+import javax.swing.JPanel;

+import javax.swing.ListModel;

+import javax.swing.event.ListDataEvent;

+import javax.swing.event.ListDataListener;

+import javax.swing.filechooser.FileFilter;

+

+import org.argouml.application.api.GUISettingsTabInterface;

+import org.argouml.configuration.Configuration;

+import org.argouml.i18n.Translator;

+import org.argouml.kernel.ProjectManager;

+import org.argouml.kernel.ProjectSettings;

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

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

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

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

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

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

+

+/**

+ * The Tab where new profiles can be added and the registered

+ * ones can be activated or deactivated on current project

+ *

+ * @author Marcos Aurélio

+ */

+public class ProjectSettingsTabProfile extends JPanel implements

+	GUISettingsTabInterface, ActionListener {

+

+    private JButton loadFromFile = new JButton(Translator

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

+

+    private JButton unregisterProfile = new JButton(Translator

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

+

+    private JButton addButton = new JButton(">>");

+

+    private JButton removeButton = new JButton("<<");

+

+    private JList availableList = new JList(new AvailableProfilesListModel());

+

+    private JList usedList = new JList(new UsedProfilesListModel());

+    

+    ////////

+    

+    private JLabel stereoLabel =

+        new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");

+

+    private JComboBox stereoField = new JComboBox();

+

+

+    /**

+     * This List contains the registered profiles that have not been applied

+     * to the current project  

+     * 

+     * @author maurelio1234

+     */

+    private class AvailableProfilesListModel implements ListModel {

+	private ProfileManager profileManager = ProfileManagerImpl

+		.getInstance();

+

+	private Vector listeners = new Vector();

+

+	/**

+         * @param arg0

+         * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+         */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fire listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n the profile to be returned

+	 * @return the n-th profile at the registered profiles list

+	 */

+	public Profile getProfileAt(int n) {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!config.getProfiles().contains(

+			registeredProfiles.elementAt(i))) {

+

+		    if (count == n) {

+			return ((Profile) registeredProfiles.elementAt(i));

+		    }

+		    ++count;

+		}

+	    }

+	    return null;

+	}

+

+	/**

+	 * @param arg0

+	 * @return the arg0-th element of this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int arg0) {

+	    Profile p = getProfileAt(arg0);

+	    if (p != null) {

+		return p.getDisplayName();

+	    } else {

+		return null;

+	    }

+	}

+

+	/**

+	 * @return the amount of registered profiles not applied to current 

+	 * 		project

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!config.getProfiles().contains(

+			registeredProfiles.elementAt(i))) {

+		    ++count;

+		}

+	    }

+	    return count;

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * This list contains the profiles that are applied to the current project

+     * 

+     * @author maurelio1234

+     */

+    private class UsedProfilesListModel implements ListModel {

+	private Vector listeners = new Vector();

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fires listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 */

+	public Profile getProfileAt(int n) {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    return ((Profile) config.getProfiles().elementAt(n));

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int n) {

+            ProfileConfiguration config = ProjectManager.getManager()

+                    .getCurrentProject().getProfileConfiguration();

+            if (n >= 0 && n < config.getProfiles().size()) {

+                return ((Profile) config.getProfiles().elementAt(n))

+                        .getDisplayName();

+            } else {

+                return null;

+            }

+	}

+

+	/**

+	 * @return the amount of elements in the list

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+	    ProfileConfiguration config = ProjectManager.getManager()

+		    .getCurrentProject().getProfileConfiguration();

+	    return config.getProfiles().size();

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * The default constructor for this class

+     */

+    public ProjectSettingsTabProfile() {

+	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

+

+        //////////////

+        

+        JPanel setDefStereoV = new JPanel();

+        setDefStereoV.setLayout(new FlowLayout());        

+        

+        stereoLabel.setLabelFor(stereoField);

+        setDefStereoV.add(stereoLabel);

+        setDefStereoV.add(stereoField);

+

+        DefaultComboBoxModel cmodel = new DefaultComboBoxModel();

+        stereoField.setModel(cmodel);

+        

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.textual"));

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.big-icon"));

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.small-icon"));

+

+        stereoField.addItemListener(new ItemListener() {

+

+            public void itemStateChanged(ItemEvent e) {

+                ProjectSettings ps = ProjectManager.getManager().getCurrentProject().getProjectSettings();                

+                Object src = e.getSource();

+                

+                if (src == stereoField) {

+                    Object item = e.getItem();

+                    DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField

+                            .getModel();

+                    int idx = model.getIndexOf(item);

+

+                    switch (idx) {

+                    case 0:

+                        ps.setDefaultStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

+                        break;

+                    case 1:

+                        ps.setDefaultStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

+                        break;

+                    case 2:

+                        ps.setDefaultStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

+                        break;

+                    }

+                }

+            }

+            

+        });

+

+        add(setDefStereoV);

+                

+        ////////////

+        

+        

+	JPanel configPanel = new JPanel();

+	configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));

+

+	availableList.setPrototypeCellValue("12345678901234567890");

+	usedList.setPrototypeCellValue("12345678901234567890");

+

+	availableList.setMinimumSize(new Dimension(50, 50));

+	usedList.setMinimumSize(new Dimension(50, 50));

+

+	JPanel leftList = new JPanel();

+	leftList.setLayout(new BorderLayout());

+	leftList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.available")),

+		BorderLayout.NORTH);

+	leftList.add(availableList, BorderLayout.CENTER);

+	configPanel.add(leftList);

+

+	JPanel centerButtons = new JPanel();

+	centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));

+	centerButtons.add(addButton);

+	centerButtons.add(removeButton);

+	configPanel.add(centerButtons);

+

+	JPanel rightList = new JPanel();

+	rightList.setLayout(new BorderLayout());

+	rightList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.active")),

+		BorderLayout.NORTH);

+	rightList.add(usedList, BorderLayout.CENTER);

+	configPanel.add(rightList);

+

+	addButton.addActionListener(this);

+	removeButton.addActionListener(this);

+

+	add(configPanel);

+

+	JPanel lffPanel = new JPanel();

+	lffPanel.setLayout(new FlowLayout());

+	lffPanel.add(loadFromFile);

+	lffPanel.add(unregisterProfile);

+

+	loadFromFile.addActionListener(this);

+	unregisterProfile.addActionListener(this);

+

+	add(lffPanel);

+    }

+

+    /**

+     * @param arg0

+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+     */

+    public void actionPerformed(ActionEvent arg0) {

+        AvailableProfilesListModel modelAvl = ((AvailableProfilesListModel) availableList

+                .getModel());

+        UsedProfilesListModel modelUsd = ((UsedProfilesListModel) usedList

+                .getModel());

+

+        if (arg0.getSource() == addButton) {

+            if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                ProjectManager.getManager().getCurrentProject()

+                        .getProfileConfiguration().addProfile(selected);

+                

+                modelAvl.fireListeners();

+                modelUsd.fireListeners();

+            }

+	} else if (arg0.getSource() == removeButton) {

+            if (usedList.getSelectedIndex() != -1) {

+                Profile selected = modelUsd.getProfileAt(usedList

+                        .getSelectedIndex());

+                

+                boolean remove = true;

+                if (!ProfileManagerImpl.getInstance().getRegisteredProfiles()

+                        .contains(selected)

+                        && !ProfileManagerImpl.getInstance()

+                                .getDefaultProfiles().contains(selected)) {

+                    remove = (JOptionPane

+                            .showConfirmDialog(

+                                    this,

+                                    Translator

+                                            .localize("tab.profiles.confirmdeleteunregistered"),

+                                    Translator

+                                            .localize("tab.profiles.confirmdeleteunregistered.title"),

+                                    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION);

+                }

+

+                if (remove) {

+                    ProjectManager.getManager().getCurrentProject()

+                            .getProfileConfiguration().removeProfile(selected);

+

+                    modelAvl.fireListeners();

+                    modelUsd.fireListeners();

+                }

+            }

+	} else if (arg0.getSource() == unregisterProfile) {

+	    if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                if (selected instanceof UserDefinedProfile) {

+                    ProfileManagerImpl.getInstance().removeProfile(selected);

+

+                    modelAvl.fireListeners();

+                    modelUsd.fireListeners();

+                } else {

+                    JOptionPane.showMessageDialog(this,Translator.localize("tab.profiles.cannotdelete"));

+                }

+            }

+	} else if (arg0.getSource() == loadFromFile) {

+	    JFileChooser fileChooser = new JFileChooser();

+	    fileChooser.setFileFilter(new FileFilter() {

+

+		public boolean accept(File file) {

+		    return file.isDirectory()

+			    || (file.isFile() 

+				    && (file.getName().endsWith(".xml") 

+					  || file.getName().endsWith(".xmi")));

+		}

+

+		public String getDescription() {

+		    return "XMI Files";

+		}

+

+	    });

+

+	    int ret = fileChooser.showOpenDialog(this);

+	    if (ret == JFileChooser.APPROVE_OPTION) {

+		File file = fileChooser.getSelectedFile();

+

+		UserDefinedProfile profile = new UserDefinedProfile(file);

+

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

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

+

+		    ProjectManager.getManager().getCurrentProject()

+			    .getProfileConfiguration().addProfile(profile);

+

+		    UsedProfilesListModel model = 

+			((UsedProfilesListModel) usedList.getModel());

+		    model.fireListeners();

+		} else {

+		    JOptionPane.showMessageDialog(this,

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

+		}

+	    }

+	}

+

+	availableList.validate();

+	usedList.validate();

+    }

+

+    /**

+     * @return the internationalization key that containing the name of this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()

+     */

+    public String getTabKey() {

+	return "tab.profiles";

+    }

+

+    /**

+     * @return the panel containing this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()

+     */

+    public JPanel getTabPanel() {

+	return this;

+    }

+

+    public void handleResetToDefault() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabCancel() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabRefresh() {

+        ProjectSettings ps = ProjectManager.getManager().getCurrentProject().getProjectSettings();

+        

+        switch (ps.getDefaultStereotypeViewValue()) {

+        case FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL:

+            stereoField.setSelectedIndex(0);                

+            break;

+        case FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON:

+            stereoField.setSelectedIndex(1);                

+            break;

+        case FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON:

+            stereoField.setSelectedIndex(2);                

+            break;

+        }

+

+        AvailableProfilesListModel modelAvl = ((AvailableProfilesListModel) availableList

+                .getModel());

+        UsedProfilesListModel modelUsd = ((UsedProfilesListModel) usedList

+                .getModel());

+        

+        modelAvl.fireListeners();

+        modelUsd.fireListeners();

+    }

+

+    public void handleSettingsTabSave() {

+	// TODO: Auto-generated method stub

+

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabPreferences.java	2007-08-13 14:10:35-0700
@@ -31,16 +31,12 @@
 
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
 import javax.swing.JPanel;
-import javax.swing.JTextField;
 
 import org.argouml.application.api.Argo;
 import org.argouml.application.api.GUISettingsTabInterface;
 import org.argouml.configuration.Configuration;
 import org.argouml.i18n.Translator;
-import org.argouml.kernel.ProjectManager;
-import org.argouml.uml.ProfileException;
 
 /**
  * Settings tab panel for handling ArgoUML application related settings.
@@ -55,7 +51,6 @@
     private JCheckBox chkPreload;
     private JCheckBox chkReloadRecent;
     private JCheckBox chkStripDiagrams;
-    private JTextField defaultProfile;
 
     /**
      * The constructor.
@@ -100,11 +95,7 @@
         checkConstraints.gridy++;
         top.add(new JLabel(Translator.localize("label.default-profile")),
                 checkConstraints);
-        defaultProfile = new JTextField();
-        checkConstraints.gridy++;
         checkConstraints.fill = GridBagConstraints.HORIZONTAL;
-        top.add(defaultProfile, checkConstraints);
-        //defaultProfile.setEnabled(false);
 
 	add(top, BorderLayout.NORTH);
     }
@@ -122,8 +113,6 @@
         chkStripDiagrams.setSelected(
                 Configuration.getBoolean(Argo.KEY_XMI_STRIP_DIAGRAMS,
                                          false));
-        defaultProfile.setText(ProjectManager.getManager().getCurrentProject()
-                .getProfile().getProfileModelFilename());
     }
 
     /*
@@ -136,14 +125,6 @@
 				 chkReloadRecent.isSelected());
         Configuration.setBoolean(Argo.KEY_XMI_STRIP_DIAGRAMS,
                  chkStripDiagrams.isSelected());
-        try {
-            ProjectManager.getManager().getCurrentProject().getProfile()
-                    .setProfileModelFilename(defaultProfile.getText());
-        } catch (ProfileException e) {
-            // shouldn't happen if profile was validated when selected
-            JOptionPane.showMessageDialog(this, "Setting UML profile failed",
-                    "Profile save error", JOptionPane.ERROR_MESSAGE);
-        }
     }
 
     /*

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/SettingsTabProfile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,591 @@
+// $Id: ProfileSelectionTab.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui;

+

+import java.awt.BorderLayout;

+import java.awt.Dimension;

+import java.awt.FlowLayout;

+import java.awt.event.ActionEvent;

+import java.awt.event.ActionListener;

+import java.awt.event.ItemEvent;

+import java.awt.event.ItemListener;

+import java.io.File;

+import java.util.Iterator;

+import java.util.Vector;

+

+import javax.swing.BoxLayout;

+import javax.swing.DefaultComboBoxModel;

+import javax.swing.DefaultListModel;

+import javax.swing.JButton;

+import javax.swing.JComboBox;

+import javax.swing.JFileChooser;

+import javax.swing.JLabel;

+import javax.swing.JList;

+import javax.swing.JOptionPane;

+import javax.swing.JPanel;

+import javax.swing.ListModel;

+import javax.swing.event.ListDataEvent;

+import javax.swing.event.ListDataListener;

+import javax.swing.filechooser.FileFilter;

+

+import org.argouml.application.api.GUISettingsTabInterface;

+import org.argouml.configuration.Configuration;

+import org.argouml.configuration.ConfigurationKey;

+import org.argouml.i18n.Translator;

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

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

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

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

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

+

+/**

+ * The Tab containing the global settings for proifiles

+ *

+ * @author Marcos Aurélio

+ */

+public class SettingsTabProfile extends JPanel implements

+	GUISettingsTabInterface, ActionListener {

+

+    private JButton loadFromFile = new JButton(Translator

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

+

+    private JButton unregisterProfile = new JButton(Translator

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

+

+    private JButton addButton = new JButton(">>");

+

+    private JButton removeButton = new JButton("<<");

+

+    private JList availableList = new JList(new AvailableProfilesListModel());

+

+    private JList defaultList = new JList(new DefaultProfilesListModel());

+

+    ////////

+    

+    private JList directoryList = new JList();

+

+    private JButton addDirectory = new JButton(Translator

+            .localize("tab.profiles.directories.add"));

+

+    private JButton removeDirectory = new JButton(Translator

+            .localize("tab.profiles.directories.remove"));

+

+    private JButton refreshProfiles = new JButton(Translator

+            .localize("tab.profiles.directories.refresh"));    

+

+    ///////

+

+    /**

+     * The configuration key for the default stereotype view.

+     */

+    public static final ConfigurationKey KEY_DEFAULT_STEREOTYPE_VIEW = Configuration

+            .makeKey("profiles", "stereotypeView");

+

+    private JLabel stereoLabel =

+        new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");

+

+    private JComboBox stereoField = new JComboBox();

+    

+    /**

+     * This List contains the registered profiles that have not been applied

+     * to the current project  

+     * 

+     * @author maurelio1234

+     */

+    private class AvailableProfilesListModel implements ListModel {

+	private ProfileManager profileManager = ProfileManagerImpl

+		.getInstance();

+

+	private Vector listeners = new Vector();

+

+	/**

+         * @param arg0

+         * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+         */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fire listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n the profile to be returned

+	 * @return the n-th profile at the registered profiles list

+	 */

+	public Profile getProfileAt(int n) {

+            Vector list = ProfileManagerImpl.getInstance().getDefaultProfiles();

+

+            Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!list.contains(

+			registeredProfiles.elementAt(i))) {

+

+		    if (count == n) {

+			return ((Profile) registeredProfiles.elementAt(i));

+		    }

+		    ++count;

+		}

+	    }

+	    return null;

+	}

+

+	/**

+	 * @param arg0

+	 * @return the arg0-th element of this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int arg0) {

+	    Profile p = getProfileAt(arg0);

+	    if (p != null) {

+		return p.getDisplayName();

+	    } else {

+		return null;

+	    }

+	}

+

+	/**

+	 * @return the amount of registered profiles not applied to current 

+	 * 		project

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+            Vector list = ProfileManagerImpl.getInstance().getDefaultProfiles();

+	    Vector registeredProfiles = profileManager.getRegisteredProfiles();

+	    int count = 0;

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

+		if (!list.contains(

+			registeredProfiles.elementAt(i))) {

+		    ++count;

+		}

+	    }

+	    return count;

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * This list contains the profiles that are applied by default

+     * 

+     * @author maurelio1234

+     */

+    private class DefaultProfilesListModel implements ListModel {

+	private Vector listeners = new Vector();

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#addListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void addListDataListener(ListDataListener arg0) {

+	    listeners.add(arg0);

+	}

+

+	/**

+	 * Fires listeners 

+	 */

+	public void fireListeners() {

+	    ListDataEvent evt = new ListDataEvent(this,

+		    ListDataEvent.CONTENTS_CHANGED, 0, getSize());

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

+		((ListDataListener) listeners.elementAt(i))

+			.contentsChanged(evt);

+	    }

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 */

+	public Profile getProfileAt(int n) {

+	    return ((Profile) ProfileManagerImpl.getInstance().getDefaultProfiles().elementAt(n));

+	}

+

+	/**

+	 * @param n

+	 * @return the n-th profile on this list

+	 * @see javax.swing.ListModel#getElementAt(int)

+	 */

+	public Object getElementAt(int n) {

+            Vector list = ProfileManagerImpl.getInstance().getDefaultProfiles();

+            if (n >= 0 && n < list.size()) {

+                return ((Profile) list.elementAt(n))

+                        .getDisplayName();

+            } else {

+                return null;

+            }

+	}

+

+	/**

+	 * @return the amount of elements in the list

+	 * @see javax.swing.ListModel#getSize()

+	 */

+	public int getSize() {

+	    return ProfileManagerImpl.getInstance().getDefaultProfiles().size();

+	}

+

+	/**

+	 * @param arg0

+	 * @see javax.swing.ListModel#removeListDataListener(javax.swing.event.ListDataListener)

+	 */

+	public void removeListDataListener(ListDataListener arg0) {

+	    listeners.remove(arg0);

+	}

+    }

+

+    /**

+     * The default constructor for this class

+     */

+    public SettingsTabProfile() {

+	setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

+

+        //////////////

+        

+        JPanel setDefStereoV = new JPanel();

+        setDefStereoV.setLayout(new FlowLayout());        

+        

+        stereoLabel.setLabelFor(stereoField);

+        setDefStereoV.add(stereoLabel);

+        setDefStereoV.add(stereoField);

+

+        DefaultComboBoxModel cmodel = new DefaultComboBoxModel();

+        stereoField.setModel(cmodel);

+        

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.textual"));

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.big-icon"));

+        cmodel.addElement(Translator.localize("menu.popup.stereotype-view.small-icon"));

+        

+        switch (Configuration.getInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

+                FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL)) {

+        case FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL:

+            stereoField.setSelectedIndex(0);                

+            break;

+        case FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON:

+            stereoField.setSelectedIndex(1);                

+            break;

+        case FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON:

+            stereoField.setSelectedIndex(2);                

+            break;

+        }

+

+        stereoField.addItemListener(new ItemListener() {

+

+            public void itemStateChanged(ItemEvent e) {

+                Object src = e.getSource();

+                

+                if (src == stereoField) {

+                    Object item = e.getItem();

+                    DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField

+                            .getModel();

+                    int idx = model.getIndexOf(item);

+

+                    switch (idx) {

+                    case 0:

+                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

+                                FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

+                        break;

+                    case 1:

+                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

+                                FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

+                        break;

+                    case 2:

+                        Configuration.setInteger(KEY_DEFAULT_STEREOTYPE_VIEW,

+                                FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

+                        break;

+                    }

+                }

+            }

+            

+        });

+

+        add(setDefStereoV);

+                

+        ////////////

+        

+        DefaultListModel model = new DefaultListModel(); 

+        directoryList.setModel(model);        

+        Iterator it = ProfileManagerImpl.getInstance().getSearchPathDirectories().iterator();

+        

+        while(it.hasNext()) {

+            String dir = (String) it.next();            

+            model.addElement(dir);

+        }

+

+        directoryList.setPrototypeCellValue("123456789012345678901234567890123456789012345678901234567890");

+        directoryList.setMinimumSize(new Dimension(50, 50));

+        

+        JPanel sdirPanel = new JPanel();

+        sdirPanel.setLayout(new BoxLayout(sdirPanel, BoxLayout.Y_AXIS));

+        

+        JPanel dlist = new JPanel();

+        dlist.setLayout(new BorderLayout());

+                

+        JPanel lcb = new JPanel();

+        lcb.setLayout(new BoxLayout(lcb, BoxLayout.Y_AXIS));

+        

+        lcb.add(addDirectory);

+        lcb.add(removeDirectory);

+

+        addDirectory.addActionListener(this);

+        removeDirectory.addActionListener(this);        

+        

+        dlist.add(directoryList, BorderLayout.CENTER);

+        dlist.add(lcb, BorderLayout.EAST);

+        

+        sdirPanel.add(new JLabel(Translator

+                .localize("tab.profiles.directories.desc")));

+        sdirPanel.add(dlist);

+

+        add(sdirPanel);

+        

+        /////

+        

+	JPanel configPanel = new JPanel();

+	configPanel.setLayout(new BoxLayout(configPanel, BoxLayout.X_AXIS));

+

+	availableList.setPrototypeCellValue("12345678901234567890");

+	defaultList.setPrototypeCellValue("12345678901234567890");

+

+	availableList.setMinimumSize(new Dimension(50, 50));

+	defaultList.setMinimumSize(new Dimension(50, 50));

+

+	JPanel leftList = new JPanel();

+	leftList.setLayout(new BorderLayout());

+	leftList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.available")),

+		BorderLayout.NORTH);

+	leftList.add(availableList, BorderLayout.CENTER);

+	configPanel.add(leftList);

+

+	JPanel centerButtons = new JPanel();

+	centerButtons.setLayout(new BoxLayout(centerButtons, BoxLayout.Y_AXIS));

+	centerButtons.add(addButton);

+	centerButtons.add(removeButton);

+	configPanel.add(centerButtons);

+

+	JPanel rightList = new JPanel();

+	rightList.setLayout(new BorderLayout());

+	rightList.add(new JLabel(Translator

+		.localize("tab.profiles.userdefined.default")),

+		BorderLayout.NORTH);       

+        

+	rightList.add(defaultList, BorderLayout.CENTER);

+	configPanel.add(rightList);

+

+	addButton.addActionListener(this);

+	removeButton.addActionListener(this);

+

+	add(configPanel);

+

+	JPanel lffPanel = new JPanel();

+	lffPanel.setLayout(new FlowLayout());

+	lffPanel.add(loadFromFile);

+	lffPanel.add(unregisterProfile);

+	lffPanel.add(refreshProfiles);        

+        

+	loadFromFile.addActionListener(this);

+	unregisterProfile.addActionListener(this);

+	refreshProfiles.addActionListener(this); //ADDED

+        

+	add(lffPanel);                       

+    }

+

+    /**

+     * @param arg0

+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+     */

+    public void actionPerformed(ActionEvent arg0) {

+        AvailableProfilesListModel modelAvl = ((AvailableProfilesListModel) availableList

+                .getModel());

+        DefaultProfilesListModel modelUsd = ((DefaultProfilesListModel) defaultList

+                .getModel());

+

+        if (arg0.getSource() == addButton) {

+            if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                ProfileManagerImpl.getInstance().addToDefaultProfiles(selected);

+                

+                modelAvl.fireListeners();

+                modelUsd.fireListeners();

+            }

+	} else if (arg0.getSource() == removeButton) {

+            if (defaultList.getSelectedIndex() != -1) {

+                Profile selected = modelUsd.getProfileAt(defaultList

+                        .getSelectedIndex());

+                ProfileManagerImpl.getInstance().removeFromDefaultProfiles(

+                        selected);

+                

+                modelAvl.fireListeners();

+                modelUsd.fireListeners();

+            }

+	} else if (arg0.getSource() == unregisterProfile) {

+	    if (availableList.getSelectedIndex() != -1) {

+                Profile selected = modelAvl.getProfileAt(availableList

+                        .getSelectedIndex());

+                if (selected instanceof UserDefinedProfile) {

+                    ProfileManagerImpl.getInstance().removeProfile(selected);

+

+                    modelAvl.fireListeners();

+                    modelUsd.fireListeners();

+                } else {

+                    JOptionPane.showMessageDialog(this, Translator

+                            .localize("tab.profiles.cannotdelete"));

+                }

+            }

+	} else if (arg0.getSource() == loadFromFile) {

+	    JFileChooser fileChooser = new JFileChooser();

+	    fileChooser.setFileFilter(new FileFilter() {

+

+		public boolean accept(File file) {

+		    return file.isDirectory()

+			    || (file.isFile() 

+				    && (file.getName().toLowerCase().endsWith(".xml") 

+					  || file.getName().toLowerCase().endsWith(".xmi")));

+		}

+

+		public String getDescription() {

+		    return "*.XMI";

+		}

+

+	    });

+

+	    int ret = fileChooser.showOpenDialog(this);

+	    if (ret == JFileChooser.APPROVE_OPTION) {

+		File file = fileChooser.getSelectedFile();

+

+		UserDefinedProfile profile = new UserDefinedProfile(file);

+

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

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

+

+		    DefaultProfilesListModel model = 

+			((DefaultProfilesListModel) defaultList.getModel());

+		    model.fireListeners();

+		} else {

+		    JOptionPane.showMessageDialog(this,

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

+		}

+	    }

+

+        ///

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

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

+                int idx = directoryList.getSelectedIndex();

+                String item = (String) directoryList.getSelectedValue();

+                ProfileManagerImpl.getInstance().removeSearchPathDirectory(item);

+                

+                ((DefaultListModel)directoryList.getModel()).remove(idx);

+            }

+        } else if (arg0.getSource() == refreshProfiles) { 

+            ProfileManagerImpl.getInstance().refreshRegisteredProfiles();            

+            modelAvl.fireListeners();

+        } else if (arg0.getSource() == addDirectory) {

+            JFileChooser fileChooser = new JFileChooser();

+            fileChooser.setFileFilter(new FileFilter() {

+

+                public boolean accept(File file) {

+                    return file.isDirectory();

+                }

+

+                public String getDescription() {

+                    return "Directories";

+                }

+

+            });

+

+            fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

+            

+            int ret = fileChooser.showOpenDialog(this);

+            if (ret == JFileChooser.APPROVE_OPTION) {

+                File file = fileChooser.getSelectedFile();

+

+                String path = file.getAbsolutePath();

+                

+                ProfileManagerImpl.getInstance().addSearchPathDirectory(path);

+                ((DefaultListModel)directoryList.getModel()).addElement(path);

+                

+                ProfileManagerImpl.getInstance().refreshRegisteredProfiles();

+            }

+            

+        }

+        

+	availableList.validate();

+	defaultList.validate();

+    }

+

+    /**

+     * @return the internationalization key that containing the name of this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabKey()

+     */

+    public String getTabKey() {

+	return "tab.profiles";

+    }

+

+    /**

+     * @return the panel containing this tab

+     * @see org.argouml.application.api.GUISettingsTabInterface#getTabPanel()

+     */

+    public JPanel getTabPanel() {

+	return this;

+    }

+

+    public void handleResetToDefault() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabCancel() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabRefresh() {

+	// TODO: Auto-generated method stub

+

+    }

+

+    public void handleSettingsTabSave() {

+	// TODO: Auto-generated method stub

+

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/StylePanelFig.java	2007-08-13 14:10:35-0700
@@ -33,6 +33,8 @@
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.DefaultListModel;
 import javax.swing.JColorChooser;
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
@@ -42,12 +44,13 @@
 import org.argouml.i18n.Translator;
 import org.argouml.swingext.SpacerPanel;
 import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.ui.ColorRenderer;
 
 /**
  * The basic stylepanel which provides the boundaries box,
- * line and fill color information.
+ * line and fill color information and the stereotype view combo box.
  *
  */
 public class StylePanelFig
@@ -72,6 +75,11 @@
 
     private JComboBox lineField = new JComboBox();
 
+    private JLabel stereoLabel =
+        new JLabel(Translator.localize("menu.popup.stereotype-view") + ": ");
+
+    private JComboBox stereoField = new JComboBox();
+    
     private SpacerPanel spacer = new SpacerPanel();
 
     private SpacerPanel spacer2 = new SpacerPanel();
@@ -102,6 +110,7 @@
         bboxField.addFocusListener(this);
         fillField.addItemListener(this);
         lineField.addItemListener(this);
+        stereoField.addItemListener(this);
 
         fillField.setRenderer(new ColorRenderer());
         lineField.setRenderer(new ColorRenderer());
@@ -117,6 +126,10 @@
         lineLabel.setLabelFor(lineField);
         add(lineLabel);
         add(lineField);
+
+        stereoLabel.setLabelFor(stereoField);
+        add(stereoLabel);
+        add(stereoField);
     }
 
     /**
@@ -164,6 +177,13 @@
         lineField.addItem(Color.orange);
         lineField.addItem(Color.pink);
         lineField.addItem(CUSTOM_ITEM);
+        
+        DefaultComboBoxModel model = new DefaultComboBoxModel();
+        stereoField.setModel(model);
+        
+        model.addElement(Translator.localize("menu.popup.stereotype-view.textual"));
+        model.addElement(Translator.localize("menu.popup.stereotype-view.big-icon"));
+        model.addElement(Translator.localize("menu.popup.stereotype-view.small-icon"));
     }
 
     /**
@@ -248,6 +268,24 @@
             lineField.setSelectedIndex(0);
         }
 
+        stereoField.setEnabled(target instanceof FigNodeModelElement);
+        stereoLabel.setEnabled(target instanceof FigNodeModelElement);
+        
+        if (target instanceof FigNodeModelElement) {
+            FigNodeModelElement fig = (FigNodeModelElement) target;
+            
+            switch (fig.getStereotypeView()) {
+            case FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL:
+                stereoField.setSelectedIndex(0);                
+                break;
+            case FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON:
+                stereoField.setSelectedIndex(1);                
+                break;
+            case FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON:
+                stereoField.setSelectedIndex(2);                
+                break;
+            }
+        }
     }
 
     /**
@@ -441,6 +479,26 @@
                             target.getLineColor());
                 }
                 setTargetLine();
+            } else if (src == stereoField) {
+                if (target instanceof FigNodeModelElement) {
+                    Object item = e.getItem();
+                    DefaultComboBoxModel model = (DefaultComboBoxModel) stereoField
+                            .getModel();
+                    int idx = model.getIndexOf(item);
+                    FigNodeModelElement fig = (FigNodeModelElement) target;
+
+                    switch (idx) {
+                    case 0:
+                        fig.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);
+                        break;
+                    case 1:
+                        fig.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);
+                        break;
+                    case 2:
+                        fig.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);
+                        break;
+                    }
+                }
             }
         }
     }

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ActionExportProfileXMI.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ActionExportProfileXMI.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ActionExportProfileXMI.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,151 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui.explorer;

+

+import java.awt.event.ActionEvent;

+import java.io.File;

+import java.io.FileWriter;

+import java.io.IOException;

+

+import javax.swing.AbstractAction;

+import javax.swing.JFileChooser;

+import javax.swing.filechooser.FileFilter;

+

+import org.apache.log4j.Logger;

+import org.argouml.application.helpers.ApplicationVersion;

+import org.argouml.configuration.Configuration;

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

+import org.argouml.model.UmlException;

+import org.argouml.model.XmiWriter;

+import org.argouml.persistence.PersistenceManager;

+import org.argouml.persistence.UmlFilePersister;

+import org.argouml.ui.ArgoFrame;

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

+import org.argouml.uml.ui.ProjectFileView;

+

+/**

+ * Exports the model of a selected profile as XMI

+ *

+ * @author Marcos Aurélio

+ */

+public class ActionExportProfileXMI extends AbstractAction {

+

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+            .getLogger(ActionExportProfileXMI.class);

+

+    private Profile selectedProfile;

+    

+    /**

+     * Default Constructor

+     * 

+     * @param profile the selected profile

+     */

+    public ActionExportProfileXMI(Profile profile) {

+        super(Translator.localize("action.export-profile-as-xmi"));

+        this.selectedProfile = profile;

+    }

+

+    /**

+     * @param arg0

+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+     */

+    public void actionPerformed(ActionEvent arg0) {        

+        Object model = selectedProfile.getModel();

+        if (model != null) {

+            File destiny = getTargetFile();

+            if (destiny != null) {

+                try {

+                    saveModel(destiny, model);

+                } catch (IOException e) {

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

+                } catch (UmlException e) {

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

+                }

+            }

+        }

+    }

+

+    @SuppressWarnings("deprecation")

+    private void saveModel(File destiny, Object model) throws IOException,

+            UmlException {

+        FileWriter w = new FileWriter(destiny);

+

+        XmiWriter xmiWriter = Model.getXmiWriter(model, w, ApplicationVersion

+                .getVersion()

+                + "(" + UmlFilePersister.PERSISTENCE_VERSION + ")");

+        xmiWriter.write();

+    }

+

+    private File getTargetFile() {

+        // show a chooser dialog for the file name, only xmi is allowed

+        JFileChooser chooser = new JFileChooser();

+        chooser.setDialogTitle(Translator.localize(

+                                       "action.export-profile-as-xmi"));

+        chooser.setFileView(ProjectFileView.getInstance());

+        chooser.setApproveButtonText(Translator.localize(

+                                             "filechooser.export"));

+        chooser.setAcceptAllFileFilterUsed(true);

+        chooser.setFileFilter(new FileFilter() {

+

+            public boolean accept(File file) {

+                return file.isDirectory()

+                        || (file.isFile() 

+                                && (file.getName().toLowerCase().endsWith(".xml") 

+                                      || file.getName().toLowerCase().endsWith(".xmi")));

+            }

+

+            public String getDescription() {

+                return "*.XMI";

+            }

+

+        });

+

+        String fn =

+            Configuration.getString(

+                PersistenceManager.KEY_PROJECT_NAME_PATH);

+        if (fn.length() > 0) {

+            fn = PersistenceManager.getInstance().getBaseName(fn);

+            chooser.setSelectedFile(new File(fn));

+        }

+

+        int result = chooser.showSaveDialog(ArgoFrame.getInstance());

+        if (result == JFileChooser.APPROVE_OPTION) {

+            File theFile = chooser.getSelectedFile();

+            if (theFile != null) {

+                if (!theFile.getName().toUpperCase().endsWith(".XMI")) {

+                    theFile = new File(theFile.getAbsolutePath() + ".XMI");

+                }

+                return theFile;

+            }

+        }

+        

+        return null;

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/ExplorerPopup.java	2007-08-13 14:10:35-0700
@@ -56,6 +56,8 @@
 import org.argouml.uml.diagram.ui.ActionAddExistingNode;
 import org.argouml.uml.diagram.ui.ActionAddExistingNodes;
 import org.argouml.uml.diagram.ui.ActionSaveDiagramToClipboard;
+import org.argouml.uml.profile.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.argouml.uml.ui.ActionActivityDiagram;
 import org.argouml.uml.ui.ActionAddPackage;
 import org.argouml.uml.ui.ActionClassDiagram;
@@ -92,6 +94,9 @@
     public ExplorerPopup(Object selectedItem, MouseEvent me) {
         super("Explorer popup menu");
 
+        final Project currentProject =
+            ProjectManager.getManager().getCurrentProject();
+
         /* Check if multiple items are selected. */
         boolean multiSelect =
                 TargetManager.getInstance().getTargets().size() > 1;
@@ -99,13 +104,15 @@
         boolean modelElementsOnly = true;
         for (Iterator it = TargetManager.getInstance().getTargets().iterator();
                 it.hasNext() && modelElementsOnly; ) {
-            if (!Model.getFacade().isAUMLElement(it.next())) {
+            Object element = it.next();
+            if (!Model.getFacade().isAUMLElement(element) ||
+                    
+                    // profile elements are NOT model elements
+                    isRelatedToProfiles(currentProject, element)) {
         	modelElementsOnly = false;
             }
         }
 
-        final Project currentProject =
-            ProjectManager.getManager().getCurrentProject();
         final ArgoDiagram activeDiagram = currentProject.getActiveDiagram();
 
         // TODO: I've made some attempt to rationalize the conditions here
@@ -126,18 +133,29 @@
         // this.add(action);
         // }
 
-        if (!multiSelect) {
+        if (!multiSelect && 
+                
+                // a profile element is not considered a selection
+                !isRelatedToProfiles(currentProject, selectedItem)) {
             initMenuCreateDiagrams();
             this.add(createDiagrams);
         }
         
+        if (!multiSelect && selectedItem instanceof Profile) {
+            this.add(new ActionExportProfileXMI((Profile)selectedItem));
+        }
+        
         if (modelElementsOnly) {
             initMenuCreateModelElements();
         }
 
         final Object projectModel = currentProject.getModel();
         final boolean modelElementSelected =
-            Model.getFacade().isAUMLElement(selectedItem);
+            Model.getFacade().isAUMLElement(selectedItem) &&
+            
+            // avoids modifications on profile models
+            !isRelatedToProfiles(currentProject, selectedItem);
+
 
         if (modelElementSelected) {
             final boolean nAryAssociationSelected =
@@ -253,7 +271,10 @@
             while (iter != null && iter.hasNext()) {
                 Object o = iter.next();
                 if (Model.getFacade().isAClassifier(o)
-                     && !Model.getFacade().isARelationship(o)) {
+                     && !Model.getFacade().isARelationship(o)
+
+                     // avoids modifications on profile models
+                     && !isRelatedToProfiles(currentProject, o)) {
                     classifiers.add(o);
                 }
             }
@@ -667,4 +688,21 @@
 	    }
 	}
     }
+    
+    private boolean isRelatedToProfiles(Project currentProject, Object selectedItem) {                
+        boolean found = selectedItem instanceof ProfileConfiguration ||
+                            selectedItem instanceof Profile;
+        
+        Iterator it = currentProject.getProfileConfiguration().getProfileModels().iterator();
+        while(!found && it.hasNext()) {
+            Object model = it.next();
+            
+            if ((Model.getFacade().getModel(selectedItem).equals(model))) {
+                found = true;
+                break;
+            }
+        }
+        
+        return found;
+    }    
 }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/NameOrder.java	2007-08-13 14:10:35-0700
@@ -28,9 +28,11 @@
 
 import javax.swing.tree.DefaultMutableTreeNode;
 
+import org.argouml.i18n.Translator;
 import org.argouml.model.InvalidElementException;
 import org.argouml.model.Model;
-import org.argouml.i18n.Translator;
+import org.argouml.uml.profile.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.tigris.gef.base.Diagram;
 
 /**
@@ -97,6 +99,10 @@
         String name;
         if (obj instanceof Diagram) {
             name = ((Diagram) obj).getName();
+        } else if (obj instanceof ProfileConfiguration) {
+            name = "Profile Configuration";
+        } else if (obj instanceof Profile) {
+            name = ((Profile)obj).getDisplayName();
         } else {
             if (Model.getFacade().isAModelElement(obj)) { 
                 try {

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/PerspectiveManager.java	2007-08-13 14:10:35-0700
@@ -77,9 +77,12 @@
 import org.argouml.ui.explorer.rules.GoOperationToSequenceDiagram;
 import org.argouml.ui.explorer.rules.GoPackageToClass;
 import org.argouml.ui.explorer.rules.GoPackageToElementImport;
+import org.argouml.ui.explorer.rules.GoProfileConfigurationToProfile;
+import org.argouml.ui.explorer.rules.GoProfileToModel;
 import org.argouml.ui.explorer.rules.GoProjectToCollaboration;
 import org.argouml.ui.explorer.rules.GoProjectToDiagram;
 import org.argouml.ui.explorer.rules.GoProjectToModel;
+import org.argouml.ui.explorer.rules.GoProjectToProfileConfiguration;
 import org.argouml.ui.explorer.rules.GoProjectToRoots;
 import org.argouml.ui.explorer.rules.GoProjectToStateMachine;
 import org.argouml.ui.explorer.rules.GoSignalToReception;
@@ -339,6 +342,10 @@
         ExplorerPerspective classPerspective =
             new ExplorerPerspective(
                 "combobox.item.class-centric");
+        classPerspective.addRule(new GoProjectToModel());
+        classPerspective.addRule(new GoProjectToProfileConfiguration());
+        classPerspective.addRule(new GoProfileConfigurationToProfile());
+        classPerspective.addRule(new GoProfileToModel());
         classPerspective.addRule(new GoProjectToRoots());
         classPerspective.addRule(new GoNamespaceToClassifierAndPackage());
         classPerspective.addRule(new GoNamespaceToDiagram());
@@ -353,6 +360,10 @@
         ExplorerPerspective packagePerspective =
             new ExplorerPerspective(
                 "combobox.item.package-centric");
+        packagePerspective.addRule(new GoProjectToModel());
+        packagePerspective.addRule(new GoProjectToProfileConfiguration());
+        packagePerspective.addRule(new GoProfileConfigurationToProfile());
+        packagePerspective.addRule(new GoProfileToModel());
         packagePerspective.addRule(new GoProjectToRoots());
         packagePerspective.addRule(new GoNamespaceToOwnedElements());
         packagePerspective.addRule(new GoPackageToElementImport());
@@ -398,6 +409,9 @@
             new ExplorerPerspective(
                 "combobox.item.diagram-centric");
         diagramPerspective.addRule(new GoProjectToModel());
+        diagramPerspective.addRule(new GoProjectToProfileConfiguration());
+        diagramPerspective.addRule(new GoProfileConfigurationToProfile());
+        diagramPerspective.addRule(new GoProfileToModel());
         diagramPerspective.addRule(new GoModelToDiagrams());
         diagramPerspective.addRule(new GoDiagramToNode());
         diagramPerspective.addRule(new GoDiagramToEdge());
@@ -409,6 +423,9 @@
             new ExplorerPerspective(
                 "combobox.item.inheritance-centric");
         inheritancePerspective.addRule(new GoProjectToModel());
+        inheritancePerspective.addRule(new GoProjectToProfileConfiguration());
+        classPerspective.addRule(new GoProfileConfigurationToProfile());
+        classPerspective.addRule(new GoProfileToModel());
         inheritancePerspective.addRule(new GoModelToBaseElements());
         inheritancePerspective
                 .addRule(new GoGeneralizableElementToSpecialized());
@@ -417,6 +434,9 @@
             new ExplorerPerspective(
                 "combobox.item.class-associations");
         associationsPerspective.addRule(new GoProjectToModel());
+        associationsPerspective.addRule(new GoProjectToProfileConfiguration());
+        associationsPerspective.addRule(new GoProfileConfigurationToProfile());
+        associationsPerspective.addRule(new GoProfileToModel());
         associationsPerspective.addRule(new GoNamespaceToDiagram());
         associationsPerspective.addRule(new GoPackageToClass());
         associationsPerspective.addRule(new GoClassToAssociatedClass());
@@ -425,6 +445,9 @@
             new ExplorerPerspective(
                 "combobox.item.residence-centric");
         residencePerspective.addRule(new GoProjectToModel());
+        residencePerspective.addRule(new GoProjectToProfileConfiguration());
+        residencePerspective.addRule(new GoProfileConfigurationToProfile());
+        residencePerspective.addRule(new GoProfileToModel());
         residencePerspective.addRule(new GoModelToNode());
         residencePerspective.addRule(new GoNodeToResidentComponent());
         residencePerspective.addRule(new GoComponentToResidentModelElement());
@@ -455,6 +478,10 @@
         ExplorerPerspective compositionPerspective =
             new ExplorerPerspective(
                 "combobox.item.composite-centric");
+        compositionPerspective.addRule(new GoProjectToModel());
+        compositionPerspective.addRule(new GoProjectToProfileConfiguration());
+        compositionPerspective.addRule(new GoProfileConfigurationToProfile());
+        compositionPerspective.addRule(new GoProfileToModel());
         compositionPerspective.addRule(new GoProjectToRoots());
         compositionPerspective.addRule(new GoModelElementToContents());
         compositionPerspective.addRule(new GoModelElementToContainedDiagrams());
@@ -515,7 +542,9 @@
             new GoOperationToSequenceDiagram(), new GoPackageToClass(),
             new GoPackageToElementImport(),
             new GoProjectToCollaboration(), new GoProjectToDiagram(),
-            new GoProjectToModel(), new GoProjectToStateMachine(),
+            new GoProjectToModel(), new GoProjectToStateMachine(), 
+            new GoProjectToProfileConfiguration(), new GoProfileConfigurationToProfile(),
+            new GoProfileToModel(),
             new GoProjectToRoots(),
             new GoSignalToReception(), new GoStateMachineToTop(),
             new GoStatemachineToDiagram(), new GoStateMachineToState(),

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileConfigurationToProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileConfigurationToProfile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileConfigurationToProfile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,65 @@
+// $Id: GoProjectToModel.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui.explorer.rules;

+

+import java.util.Collection;

+import java.util.Set;

+import java.util.Vector;

+

+import org.argouml.i18n.Translator;

+import org.argouml.kernel.Project;

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

+

+/**

+ * Rule for Project->Profile.

+ *

+ */

+public class GoProfileConfigurationToProfile extends AbstractPerspectiveRule {

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName()

+     */

+    public String getRuleName() {

+	return Translator.localize ("misc.profileconfiguration.profile");

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getChildren(java.lang.Object)

+     */

+    public Collection getChildren(Object parent) {

+	if (parent instanceof ProfileConfiguration) {

+	    return ((ProfileConfiguration)parent).getProfiles();

+	}

+	return null;

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getDependencies(java.lang.Object)

+     */

+    public Set getDependencies(Object parent) {

+        // TODO: What?

+	return null;

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileToModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileToModel.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProfileToModel.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,70 @@
+// $Id: GoProjectToModel.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui.explorer.rules;

+

+import java.util.Collection;

+import java.util.Set;

+import java.util.Vector;

+

+import org.argouml.i18n.Translator;

+import org.argouml.model.Model;

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

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

+

+/**

+ * Rule for Project->Profile.

+ *

+ */

+public class GoProfileToModel extends AbstractPerspectiveRule {

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName()

+     */

+    public String getRuleName() {

+	return Translator.localize ("misc.profile.model");

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getChildren(java.lang.Object)

+     */

+    public Collection getChildren(Object parent) {

+	if (parent instanceof Profile) {

+            try {

+                return ((Profile) parent).getProfilePackages();

+            } catch (ProfileException e) {

+                return null;

+            }

+        }

+        return null;

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getDependencies(java.lang.Object)

+     */

+    public Set getDependencies(Object parent) {

+        // TODO: What?

+	return null;

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToProfileConfiguration.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToProfileConfiguration.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,66 @@
+// $Id: GoProjectToModel.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.ui.explorer.rules;

+

+import java.util.Collection;

+import java.util.Set;

+import java.util.Vector;

+

+import org.argouml.i18n.Translator;

+import org.argouml.kernel.Project;

+

+/**

+ * Rule for Project->Profile.

+ *

+ */

+public class GoProjectToProfileConfiguration extends AbstractPerspectiveRule {

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getRuleName()

+     */

+    public String getRuleName() {

+	return Translator.localize ("misc.project.profileconfiguration");

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getChildren(java.lang.Object)

+     */

+    public Collection getChildren(Object parent) {

+	if (parent instanceof Project) {

+            Vector l = new Vector();

+            l.add(((Project) parent).getProfileConfiguration());

+	    return l;

+	}

+	return null;

+    }

+

+    /*

+     * @see org.argouml.ui.explorer.rules.PerspectiveRule#getDependencies(java.lang.Object)

+     */

+    public Set getDependencies(Object parent) {

+        // TODO: What?

+	return null;

+    }

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/ui/explorer/rules/GoProjectToRoots.java	2007-08-13 14:10:35-0700
@@ -29,7 +29,6 @@
 
 import org.argouml.i18n.Translator;
 import org.argouml.kernel.Project;
-import org.argouml.model.Model;
 
 /**
  * Rule for Project->Root (Top level) Elements.
@@ -40,6 +39,10 @@
  * but this will need to be enhanced with additional bookkeeping in 
  * Project when we support multiple open projects - tfm.
  *
+ * TODO: I changed it to get the roots from the project. It was showing
+ * the profiles that were loaded but were not applied to the current project
+ * - maurelio1234.
+ * 
  * @author Tom Morris <[email protected]>
  */
 public class GoProjectToRoots extends AbstractPerspectiveRule {
@@ -52,7 +55,7 @@
 
     public Collection getChildren(Object parent) {
 	if (parent instanceof Project) {
-	    return Model.getFacade().getRootElements();
+	    return ((Project)parent).getRoots();
 	}
 	return null;
     }

Removed: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/Profile.java?view=auto&rev=13312

Removed: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileException.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileException.java?view=auto&rev=13312

Removed: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ProfileJava.java?view=auto&rev=13312

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/StereotypeUtility.java	2007-08-13 14:10:35-0700
@@ -98,6 +98,10 @@
         addAllUniqueModelElementsFrom(availableStereotypes, paths, Model
                 .getExtensionMechanismsHelper().getAllPossibleStereotypes(
                         models, modelElement));
+        addAllUniqueModelElementsFrom(availableStereotypes, paths,
+                ProjectManager.getManager().getCurrentProject()
+                        .getProfileConfiguration()
+                        .findAllStereotypesForModelElement(modelElement));
         return availableStereotypes;
     }
     
@@ -203,15 +207,9 @@
             return stereo;
         }
 
-        try {
-            Project project = ProjectManager.getManager().getCurrentProject();
-            Profile profile = project.getProfile();
-            stereo = recFindStereotype(obj, profile.getProfileModel(), name);
-        } catch (ProfileException e) {
-            // TODO: How are we going to handle exceptions here?
-            // I suspect the profile should be part of the project
-            // and not a singleton.
-        }
+        Project project = ProjectManager.getManager().getCurrentProject();
+        stereo = project.getProfileConfiguration().findStereotypeForObject(
+                name, obj); 
 
         if (stereo != null) {
             return Model.getModelManagementHelper().getCorrespondingElement(

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/CrProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/CrProfile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/CrProfile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,83 @@
+// $Id: CrProfile.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.cognitive.critics;

+

+import org.argouml.cognitive.Translator;

+

+/**

+ * "Abstract" Critic subclass that captures commonalities among all

+ * critics defined by profiles. This class also defines and registers

+ * the categories of design decisions that the critics can

+ * address. IT also deals with particular UMLToDoItems.

+ *

+ * @see org.argouml.cognitive.Designer

+ * @see org.argouml.cognitive.DecisionModel

+ *

+ * @author maurelio1234

+ */

+public class CrProfile extends CrUML {

+    private String localizationPrefix;

+    

+    /**

+     * The constructor for this class.<br>

+     * <br>

+     * By default, CrUML looks for localized strings under the <code>"critics"

+     * </code> prefix. Since profiles cannot include their strings at the 

+     * <code>critics.profile</code> file located at the ArgoUML source code this

+     * class allows critics defined on profile plug-ins to define look for 

+     * localized strings at other files.  

+     * 

+     * @param prefix the prefix of the localized strings

+     */

+    public CrProfile(final String prefix) {

+	super();

+	

+	if (prefix == null || "".equals(prefix)) {

+	    this.localizationPrefix = "critics";

+	} else {

+	    this.localizationPrefix = prefix;

+	}

+	

+	setupHeadAndDesc();

+    }

+    

+    /**

+     * Returns a localized string for the given key and suffix.

+     * 

+     * @param key the main key

+     * @param suffix the suffix of the key

+     * @return the localized string

+     * 

+     * @see CrUML#getLocalizedString(String, String)

+     */

+    protected String getLocalizedString(String key, String suffix) {

+        return Translator.localize(localizationPrefix + "." + key + suffix);

+    }

+

+    /**

+     * The UID.

+     */

+    private static final long serialVersionUID = 1785043010468681602L;

+} /* end class CrUML */


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/cognitive/critics/WizAddConstructor.java	2007-08-13 14:10:35-0700
@@ -36,8 +36,8 @@
 import org.argouml.kernel.ProjectManager;
 import org.argouml.model.Model;
 import org.argouml.ui.targetmanager.TargetManager;
-import org.argouml.uml.Profile;
-import org.argouml.uml.ProfileException;
+import org.argouml.uml.profile.Profile;
+import org.argouml.uml.profile.ProfileException;
 
 /**
  * A wizard to add a constructor to a classifier.
@@ -92,44 +92,14 @@
     }
 
     /**
-     * Finds the create stereotype for an object. It is assumed to be
-     * available from the java profile.
-     * <p>
-     * TODO: This needs to be recoded to handle multiple profile packages.
-     * It also seems Java specific (at least the above comment does) - tfm
-     * 
+     * Finds the create stereotype for an object.
+     *
      * @param obj is the object the stereotype should be applicable to.
      * @return a suitable stereotype, or null.
      */
     private Object getCreateStereotype(Object obj) {
-        Iterator iter = null;
-        try {
-            Project project = ProjectManager.getManager().getCurrentProject();
-            Profile profile = project.getProfile();
-            Object profileModel = profile.getProfileModel();
-            iter = Model.getFacade().getOwnedElements(profileModel).iterator();
-        } catch (ProfileException e) {
-            // TODO: How are we going to handle exceptions here?
-            // I suspect the profile should be part of the project
-            // and not a singleton.
-            LOG.error("Failed to get profile", e);
-        }
-        while (iter.hasNext()) {
-            Object stereo = iter.next();
-            if (!Model.getFacade().isAStereotype(stereo)
-        	|| !"create".equals(Model.getFacade().getName(stereo))) {
-                continue;
-            }
-
-            if (Model.getExtensionMechanismsHelper()
-        	    .isValidStereotype(obj, stereo)) {
-        	return Model.getModelManagementHelper()
-        	    .getCorrespondingElement(stereo,
-        				     Model.getFacade().getModel(obj));
-            }
-        }
-
-        return null;
+        return ProjectManager.getManager().getCurrentProject()
+                .getProfileConfiguration().findStereotypeForObject("create", obj);
     }
 
     /**

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigActionState.java	2007-08-13 14:10:35-0700
@@ -170,7 +170,7 @@
      *
      * Override setBounds to keep shapes looking right.
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigObjectFlowState.java	2007-08-13 14:10:35-0700
@@ -246,7 +246,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         //if (getNameFig() == null) return;
         Rectangle oldBounds = getBounds();
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java	2007-08-13 14:10:35-0700
@@ -209,7 +209,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 	
         if (getNameFig() == null) {
             return;

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigPool.java	2007-08-13 14:10:35-0700
@@ -161,7 +161,7 @@
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
     @Override
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 	
         Rectangle oldBounds = getBounds();
         getBigPort().setBounds(x, y, w, h);

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/activity/ui/FigSubactivityState.java	2007-08-13 14:10:35-0700
@@ -175,7 +175,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/collaboration/ui/FigClassifierRole.java	2007-08-13 14:10:35-0700
@@ -318,7 +318,7 @@
      * @author 10 Apr 2002. Jeremy Bennett ([email protected]). Patch to
      *         allow for stereotype as well.
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 
         // In the rather unlikely case that we have no name, we give up.
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponent.java	2007-08-13 14:10:35-0700
@@ -218,7 +218,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 
         Rectangle oldBounds = getBounds();
         getBigPort().setBounds(x + BX, y, w - BX, h);

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java	2007-08-13 14:10:35-0700
@@ -219,7 +219,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigMNode.java	2007-08-13 14:10:35-0700
@@ -224,7 +224,7 @@
     /*
      * @see org.tigris.gef.presentation.FigNode#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 	if (getNameFig() == null) {
 	    return;
 	}

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigNodeInstance.java	2007-08-13 14:10:35-0700
@@ -196,7 +196,7 @@
     /*
      * @see org.tigris.gef.presentation.FigNode#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/deployment/ui/FigObject.java	2007-08-13 14:10:35-0700
@@ -170,7 +170,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/sequence/ui/FigClassifierRole.java	2007-08-13 14:10:35-0700
@@ -265,7 +265,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    public void setBoundsImpl(int x, int y, int w, int h) {
+    public void setStandardBounds(int x, int y, int w, int h) {
         y = 50;
         Rectangle oldBounds = getBounds();
         w = headFig.getMinimumSize().width;

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigCompositeState.java	2007-08-13 14:10:35-0700
@@ -146,7 +146,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigConcurrentRegion.java	2007-08-13 14:10:35-0700
@@ -181,7 +181,7 @@
      *
      * {@inheritDoc}
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigForkState.java	2007-08-13 14:10:35-0700
@@ -97,7 +97,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         Rectangle oldBounds = getBounds();
         if (w > h) {
             h = HEIGHT;

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigJoinState.java	2007-08-13 14:10:35-0700
@@ -97,7 +97,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         Rectangle oldBounds = getBounds();
         if (w > h) {
             h = HEIGHT;

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSimpleState.java	2007-08-13 14:10:35-0700
@@ -119,7 +119,7 @@
      * {@inheritDoc}
      */
     @Override
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 	if (getNameFig() == null) {
 	    return;
 	}

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigStubState.java	2007-08-13 14:10:35-0700
@@ -216,7 +216,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int theX, int theY, int theW, int theH) {
+    protected void setStandardBounds(int theX, int theY, int theW, int theH) {
         Rectangle oldBounds = getBounds();
         theW = 60;
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/state/ui/FigSubmachineState.java	2007-08-13 14:10:35-0700
@@ -197,7 +197,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigClass.java	2007-08-13 14:10:35-0700
@@ -581,7 +581,7 @@
      * 
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(final int x, final int y,
+    protected void setStandardBounds(final int x, final int y,
             final int w, final int h) {
         Rectangle oldBounds = getBounds();
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigComment.java	2007-08-13 14:10:35-0700
@@ -537,7 +537,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int px, int py, int w, int h) {
+    protected void setStandardBounds(int px, int py, int w, int h) {
         if (bodyTextFig == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigDataType.java	2007-08-13 14:10:35-0700
@@ -318,7 +318,7 @@
      * @param h  Desired height of the figure
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(final int x, final int y, final int w,
+    protected void setStandardBounds(final int x, final int y, final int w,
             final int h) {
 
         Rectangle oldBounds = getBounds();

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigEnumeration.java	2007-08-13 14:10:35-0700
@@ -237,7 +237,7 @@
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
     @Override
-    protected void setBoundsImpl(final int x, final int y, final int w,
+    protected void setStandardBounds(final int x, final int y, final int w,
             final int h) {
 
         // Save our old boundaries so it can be used in property message later

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInstance.java	2007-08-13 14:10:35-0700
@@ -128,7 +128,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 	if (getNameFig() == null) return;
 	Rectangle oldBounds = getBounds();
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigInterface.java	2007-08-13 14:10:35-0700
@@ -476,7 +476,7 @@
      *
      * @param h  Desired height of the FigInterface
      */
-    protected void setBoundsImpl(final int x, final int y, final int w,
+    protected void setStandardBounds(final int x, final int y, final int w,
             final int h) {
 
         Rectangle oldBounds = getBounds();

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigModel.java	2007-08-13 14:10:35-0700
@@ -73,7 +73,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 
         if (figPoly != null) {
             Rectangle oldBounds = getBounds();

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java	2007-08-13 14:10:35-0700
@@ -416,7 +416,7 @@
      *
      * @param h  Desired height of the FigClass
      */
-    protected void setBoundsImpl(int xa, int ya, int w, int h) {
+    protected void setStandardBounds(int xa, int ya, int w, int h) {
         // Save our old boundaries (needed later), and get minimum size
         // info. "aSize" will be used to maintain a running calculation of our
         // size at various points.

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSignal.java	2007-08-13 14:10:35-0700
@@ -196,7 +196,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(final int x, final int y, final int w,
+    protected void setStandardBounds(final int x, final int y, final int w,
             final int h) {
 
         // Save our old boundaries so it can be used in property message later

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java	2007-08-13 14:10:35-0700
@@ -195,7 +195,7 @@
      *
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(final int x, final int y,
+    protected void setStandardBounds(final int x, final int y,
             final int w, final int h) {
         Rectangle oldBounds = getBounds();
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/static_structure/ui/FigSubsystem.java	2007-08-13 14:10:35-0700
@@ -67,7 +67,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
 
         if (figPoly != null) {
             Rectangle oldBounds = getBounds();

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionAddStereotype.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,102 @@
+// $Id: ActionAddStereotype.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+import java.awt.event.ActionEvent;

+

+import javax.swing.Action;

+

+import org.argouml.i18n.Translator;

+import org.argouml.kernel.Project;

+import org.argouml.kernel.ProjectManager;

+import org.argouml.kernel.ProjectSettings;

+import org.argouml.model.Model;

+import org.tigris.gef.undo.UndoableAction;

+

+

+/**

+ * Action to add a sterotype to a model element.

+ * @author Bob Tarling

+ */

+class ActionAddStereotype extends UndoableAction {

+    private Object modelElement;

+    private Object stereotype;

+

+    /**

+     * Constructor.

+     *

+     * @param me The model element.

+     * @param st The stereotype.

+     */

+    public ActionAddStereotype(Object me, Object st) {

+        super(Translator.localize(buildString(st)),

+                null);

+        // Set the tooltip string:

+        putValue(Action.SHORT_DESCRIPTION, 

+                Translator.localize(buildString(st)));

+        modelElement = me;

+        stereotype = st;

+    }

+    

+    private static String buildString(Object st) {

+        Project p = ProjectManager.getManager().getCurrentProject();

+        ProjectSettings ps = p.getProjectSettings();

+        return ps.getLeftGuillemot() 

+            + Model.getFacade().getName(st)

+            + ps.getRightGuillemot();

+    }

+

+    /*

+     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

+     */

+    public void actionPerformed(ActionEvent ae) {

+    	super.actionPerformed(ae);

+        if (Model.getFacade().getStereotypes(modelElement)

+                .contains(stereotype)) {

+            Model.getCoreHelper().removeStereotype(modelElement, stereotype);

+        } else {

+            Object stereo =

+                Model.getModelManagementHelper()

+                    .getCorrespondingElement(stereotype,

+                        Model.getFacade().getModel(modelElement), true);

+            Model.getCoreHelper().addStereotype(modelElement, stereo);

+        }

+    }

+

+    /*

+     * @see javax.swing.Action#getValue(java.lang.String)

+     */

+    public Object getValue(String key) {

+        if ("SELECTED".equals(key)) {

+            if (Model.getFacade().getStereotypes(modelElement).contains(

+                    stereotype)) {

+                return Boolean.TRUE;

+            } else {

+                return Boolean.FALSE;

+            }

+        }

+        return super.getValue(key);

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeView.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeView.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeView.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,92 @@
+// $Id: ActionStereotypeView.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+/**

+ * The UML 2.0 Profile specification allows three visualizations for the 

+ * stereotypes applied on a model element:

+ * 

+ * <ul>

+ * <li>The stereotype name in guilmets (<< >>'s)</li>

+ * <li>An icon replacing the default visualization</li>

+ * <li>A small icon flying over the default visualization</li>

+ * </ul>

+ * 

+ * An popup submenu is provided in order to allow the user switching between

+ * these modes. This class keeps the code that should be commonly shared

+ * among all the visualization options.

+ * 

+ * @see FigNodeModelElement#getPopUpActions(java.awt.event.MouseEvent)

+ *  

+ * @author maurelio1234

+ */

+public abstract class ActionStereotypeView extends AbstractActionRadioMenuItem {

+

+    private FigNodeModelElement targetNode;

+    private int selectedStereotypeView;

+    

+    /**

+     * The default constructor for this class

+     * 

+     * @param node the selected node 

+     * @param key  the internationalization key used to label this action

+     * @param stereotypeView the stereotype view that is activated when this 

+     * 		action is triggered

+     */

+    public ActionStereotypeView(FigNodeModelElement node, String key,

+	    int stereotypeView) {

+	super(key, false);

+

+	this.targetNode = node;

+	this.selectedStereotypeView = stereotypeView;

+	updateSelection();

+    }

+    

+    private void updateSelection() {

+	putValue("SELECTED", Boolean

+		.valueOf(targetNode.getStereotypeView() 

+				== selectedStereotypeView));

+    }

+

+    /**

+     * @see org.argouml.uml.diagram.ui.AbstractActionRadioMenuItem#toggleValueOfTarget(java.lang.Object)

+     */

+    void toggleValueOfTarget(Object t) {

+	targetNode.setStereotypeView(selectedStereotypeView);

+	updateSelection();

+    }

+

+    /**

+     * @see org.argouml.uml.diagram.ui.AbstractActionRadioMenuItem#valueOfTarget(java.lang.Object)

+     */

+    Object valueOfTarget(Object t) {

+	if (t instanceof FigNodeModelElement) {

+	    return new Integer(((FigNodeModelElement) t).getStereotypeView());

+	} else {

+	    return t;

+	}

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,46 @@
+// $Id: ActionStereotypeViewBigIcon.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+/**

+ * When this action is triggered the selected node visualization changes into 

+ * <code>BigIcon</code> mode. If the node has more than one applied stereotype

+ * it should be displayed exactly as its default visualization. If if has just 

+ * one stereotype and it provider an icon, this icon replaces the default 

+ * figure for the classifier.

+ *

+ * @author maurelio1234

+ */

+public class ActionStereotypeViewBigIcon extends ActionStereotypeView {    

+    /**

+     * Default constructor for this action

+     * 

+     * @param node the current node

+     */

+    public ActionStereotypeViewBigIcon(FigNodeModelElement node) {

+	super(node, "menu.popup.stereotype-view.big-icon",

+		FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,44 @@
+// $Id: ActionStereotypeViewSmallIcon.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+/**

+ * When this action is triggered the selected node visualization changes into 

+ * <code>SmallIcon</code> mode. At this mode, all the stereotypes that provide

+ * an alternate icon should be replaced by the a reduced version of the icon.

+ *

+ * @author maurelio1234

+ */

+public class ActionStereotypeViewSmallIcon extends ActionStereotypeView {

+    /**

+     * Default constructor for this action

+     * 

+     * @param node the current node

+     */

+    public ActionStereotypeViewSmallIcon(FigNodeModelElement node) {

+	super(node, "menu.popup.stereotype-view.small-icon",

+		FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,44 @@
+// $Id: ActionStereotypeViewTextual.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+/**

+ * When this action is triggered the selected node visualization changes into 

+ * <code>Textual</code> mode. This is the default mode for all nodes. The 

+ * stereotypes are displayed as the stereotype name between guillemets.

+ *

+ * @author maurelio1234

+ */

+public class ActionStereotypeViewTextual extends ActionStereotypeView {

+    /**

+     * Default constructor for this action

+     * 

+     * @param node the current node

+     */

+    public ActionStereotypeViewTextual(FigNodeModelElement node) {

+	super(node, "menu.popup.stereotype-view.textual",

+		FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

+    }

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigMessage.java	2007-08-13 14:10:35-0700
@@ -289,7 +289,7 @@
      * @see org.tigris.gef.presentation.Fig#setBounds(int, int, int, int)
      */
     @Override
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         if (getNameFig() == null) {
             return;
         }

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeAssociation.java	2007-08-13 14:10:35-0700
@@ -266,7 +266,7 @@
     /*
      * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
-    protected void setBoundsImpl(int x, int y, int w, int h) {
+    protected void setStandardBounds(int x, int y, int w, int h) {
         Rectangle oldBounds = getBounds();
         getBigPort().setBounds(x, y, w, h);
         head.setBounds(x, y, w, h);

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2007-08-13 14:10:35-0700
@@ -28,6 +28,7 @@
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.Graphics;
+import java.awt.Image;
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.InputEvent;
@@ -96,6 +97,7 @@
 import org.tigris.gef.graph.MutableGraphSupport;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigImage;
 import org.tigris.gef.presentation.FigNode;
 import org.tigris.gef.presentation.FigRect;
 import org.tigris.gef.presentation.FigText;
@@ -211,6 +213,32 @@
      */
     protected static final int ACTIVE = 8;
 
+    /**
+     * Used for #setStereotypeView(). Represents the default view for 
+     * stereotypes applied to this node.
+     * 
+     * @see ActionStereotypeViewTextual
+     */
+    public static final int STEREOTYPE_VIEW_TEXTUAL = 0;
+
+    /**
+     * Used for #setStereotypeView(). Represents the view for 
+     * stereotypes where the default representation is replaced by a provided
+     * icon. 
+     * 
+     * @see ActionStereotypeViewBigIcon
+     */
+    public static final int STEREOTYPE_VIEW_BIG_ICON = 1;
+
+    /**
+     * Used for #setStereotypeView(). Represents the view for 
+     * stereotypes where the default view is adorned with a small version of the
+     * provided icon.
+     * 
+     * @see ActionStereotypeViewSmallIcon
+     */
+    public static final int STEREOTYPE_VIEW_SMALL_ICON = 2;
+    
     ////////////////////////////////////////////////////////////////
     // instance variables
 
@@ -231,6 +259,43 @@
     private Fig stereotypeFig;
 
     /**
+     * The <code>FigProfileIcon</code> being currently displayed
+     */
+    private FigProfileIcon stereotypeFigProfileIcon;
+    
+    /**
+     * Contains the figs of the floating stereotypes when viewed in 
+     * <code>SmallIcon</code> mode.
+     */
+    private   Vector floatingStereotypes = new Vector();
+    
+    /**
+     * The current stereotype view
+     * 
+     * @see #STEREOTYPE_VIEW_TEXTUAL
+     * @see #STEREOTYPE_VIEW_SMALL_ICON
+     * @see #STEREOTYPE_VIEW_BIG_ICON
+     */
+    private   int stereotypeView = STEREOTYPE_VIEW_TEXTUAL;   
+    
+    /**
+     * The width of the profile icons when viewed at the small icon mode.
+     * The icon width is resized to <code>ICON_WIDTH</code> and the height is 
+     * set to a value that attempts to keep the original width/height 
+     * proportion. 
+     */
+    private static final int ICON_WIDTH = 16;
+    
+    /**
+     * When stereotypes are shown in <code>BigIcon</code> mode the 
+     * <code>nameFig</code> is replaced by the one provided by the 
+     * <code>FigProfileIcon</code> 
+     * 
+     * @see FigProfileIcon
+     */
+    private FigText originalNameFig;
+    
+    /**
      * EnclosedFigs are the Figs that are enclosed by this figure. Say that
      * it is a Package then these are the Classes, Interfaces, Packages etc
      * that are on this figure. This is not the same as the figures in the
@@ -308,6 +373,8 @@
         setShadowSize(ps.getDefaultShadowWidthValue());
         /* TODO: how to handle changes in shadowsize 
          * from the project properties? */
+        
+        stereotypeView = ps.getDefaultStereotypeViewValue();
     }
 
     /**
@@ -528,6 +595,16 @@
                 }
                 popUpActions.insertElementAt(stereotypes, 0);
             }
+            
+            // add stereotype view submenu
+            ArgoJMenu stereotypesView =
+                new ArgoJMenu("menu.popup.stereotype-view");
+            
+            stereotypesView.addRadioItem(new ActionStereotypeViewTextual(this));
+            stereotypesView.addRadioItem(new ActionStereotypeViewBigIcon(this));
+            stereotypesView.addRadioItem(new ActionStereotypeViewSmallIcon(this));
+            
+            popUpActions.insertElementAt(stereotypesView, 0);
         }
 
         return popUpActions;
@@ -1142,6 +1219,7 @@
                 addElementListener(mee.getNewValue(), "name");
             }
             updateStereotypeText();
+            updateStereotypeIcon();
             damage();
         }
     }
@@ -1400,7 +1478,8 @@
         return getClass().getName()
             + "[" + getX() + ", " + getY() + ", "
             + getWidth() + ", " + getHeight() + "]"
-            + "pathVisible=" + isPathVisible() + ";";
+            + "pathVisible=" + isPathVisible() + ";"
+            + "stereotypeView=" + getStereotypeView() + ";";
     }
 
     /**
@@ -1498,10 +1577,124 @@
     public void renderingChanged() {
         updateNameText();
         updateStereotypeText();
+        updateStereotypeIcon();        
         updateBounds();
         damage();
     }
 
+    protected void updateStereotypeIcon() {
+	if (getOwner() == null) {
+	    LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
+		    + "] is null.");
+	    LOG.warn("I return...");
+	    return;
+	}
+
+	if (stereotypeFigProfileIcon != null) {
+	    Iterator it = getFigs().iterator();
+	    while (it.hasNext()) {
+		Object fig = it.next();
+		((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
+	    }
+
+	    this.removeFig(stereotypeFigProfileIcon);
+	    stereotypeFigProfileIcon = null;
+	}
+	
+	if (originalNameFig != null) {
+	    this.setNameFig(originalNameFig);
+	    originalNameFig = null;
+	}
+	
+	if (!floatingStereotypes.isEmpty()) {
+	    Iterator it = floatingStereotypes.iterator();
+	    while (it.hasNext()) {
+		Object icon = it.next();
+		this.removeFig((Fig) icon);
+	    }
+	    floatingStereotypes.clear();
+	}
+	
+	int practicalView = getPracticalView();
+	Object modelElement = getOwner();
+	Collection stereos = Model.getFacade().getStereotypes(modelElement);
+	 
+	Fig stereoFig = getStereotypeFig();
+	if (stereoFig instanceof FigStereotypesCompartment) {
+	    ((FigStereotypesCompartment) stereoFig)
+		    .setHidingStereotypesWithIcon(practicalView == STEREOTYPE_VIEW_SMALL_ICON);
+	}
+
+	if (practicalView == STEREOTYPE_VIEW_BIG_ICON) {
+	    
+	    if (stereos != null) {
+		Image replaceIcon = null;
+
+		if (stereos.size() == 1) {
+		    Object stereo = stereos.iterator().next();
+		    replaceIcon = ProjectManager.getManager()
+			    .getCurrentProject().getProfileConfiguration()
+			    .getFigNodeStrategy().getIconForStereotype(stereo);
+		}
+		
+		if (replaceIcon != null) {
+		    stereotypeFigProfileIcon = new FigProfileIcon(replaceIcon,
+			    getName());
+		    stereotypeFigProfileIcon.setOwner(getOwner());
+
+		    stereotypeFigProfileIcon.setLocation(getBigPort()
+			    .getLocation());
+		    this.addFig(stereotypeFigProfileIcon);
+
+		    originalNameFig = this.getNameFig();
+		    this.setNameFig(stereotypeFigProfileIcon.getLabelFig());
+
+		    getBigPort().
+		    	setBounds(stereotypeFigProfileIcon.getBounds());
+		 
+		    Iterator it = getFigs().iterator();
+		    while (it.hasNext()) {
+			Object fig = it.next();
+			((Fig) fig).setVisible(fig == stereotypeFigProfileIcon);
+		    }
+		    
+		}
+	    }
+	} else if (practicalView == STEREOTYPE_VIEW_SMALL_ICON) {
+            int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
+
+            Iterator it = stereos.iterator();
+            while (it.hasNext()) {
+                Object stereo = it.next();
+                Image icon = ProjectManager.getManager().getCurrentProject()
+                        .getProfileConfiguration().getFigNodeStrategy()
+                        .getIconForStereotype(stereo);
+                if (icon != null) {
+                    FigImage fimg = new FigImage(i,
+                            this.getBigPort().getY() + 2, icon);
+                    fimg.setSize(ICON_WIDTH,
+                            (icon.getHeight(null) * ICON_WIDTH)
+                                    / icon.getWidth(null));
+
+                    addFig(fimg);
+                    floatingStereotypes.add(fimg);
+
+                    i -= ICON_WIDTH - 2;
+                }
+            }
+
+            updateSmallIcons(this.getWidth());
+        }
+
+	updateStereotypeText();
+	
+	damage();
+	calcBounds();
+	updateEdges();
+	this.updateBounds();
+	this.redraw();
+    }
+
     /*
      * @see org.tigris.gef.presentation.Fig#calcBounds()
      */
@@ -1883,6 +2076,103 @@
 		== getOwner();
     }
     
+        /**
+     * @return current stereotype view
+     */
+    public int getStereotypeView() {
+        return stereotypeView;
+    }
+
+    /**
+     * When using <code>BigIcon</code> mode and zero or more than one stereotype
+     * the practical view should be the default one. 
+     * 
+     * @return current practical stereotype view
+     */
+    public int getPracticalView() {               
+	int practicalView = getStereotypeView();
+        Object modelElement = getOwner();
+
+        if (modelElement != null) {
+            Collection stereos = Model.getFacade().getStereotypes(modelElement);
+
+            if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON
+                    && (stereos == null || stereos.size() != 1)) {
+                practicalView = STEREOTYPE_VIEW_TEXTUAL;
+            }
+            return practicalView;
+        } else {
+            return practicalView;
+        }
+    }
+    
+    /**
+     * Sets the stereotype view
+     * @param s the stereotype view to be set
+     */
+    public void setStereotypeView(int s) {
+        this.stereotypeView = s;
+        try {
+            renderingChanged();
+        } catch (Exception e) {
+        }
+    }
+    
+    /**
+     * Sets the bounds of this classifier. Takes the stereotype view into 
+     * consideration.<br>
+     * 
+     * Do not override this method, override 
+     * {@link #setStandardBounds(int, int, int, int)} instead.
+     * 
+     * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
+     */
+    protected void setBoundsImpl(final int x, final int y, final int w,
+	    final int h) {
+
+	if (getPracticalView() == STEREOTYPE_VIEW_BIG_ICON) {
+	    if (stereotypeFigProfileIcon != null) {
+		    stereotypeFigProfileIcon.setBounds(stereotypeFigProfileIcon
+			.getX(), stereotypeFigProfileIcon.getY(), w, h);
+		    // FigClass calls setBoundsImpl before we set 
+		    // the stereotypeFigProfileIcon
+	    }
+	} else {
+	    setStandardBounds(x, y, w, h);
+	    if (getStereotypeView() == STEREOTYPE_VIEW_SMALL_ICON) {
+	        updateSmallIcons(w);
+	    }
+	}
+    }
+
+    private void updateSmallIcons(int wid) {
+        int i = this.getX() + wid - ICON_WIDTH - 2;
+
+        Iterator it = floatingStereotypes.iterator();
+        while (it.hasNext()) {
+            FigImage ficon = (FigImage) it.next();
+            ficon.setLocation(i, this.getBigPort().getY() + 2);
+            i -= ICON_WIDTH - 2;
+        }
+
+        getNameFig().setRightMargin(
+                floatingStereotypes.size() * (ICON_WIDTH + 5));
+    }
+
+    /**
+     * Replaces {@link #setBoundsImpl(int, int, int, int)}.
+     * 
+     * @param x Desired X coordinate of upper left corner
+     * @param y Desired Y coordinate of upper left corner
+     * @param w Desired width of the FigClass
+     * @param h Desired height of the FigClass
+     * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
+     */
+    protected void setStandardBounds(final int x, final int y,
+            final int w, final int h) {
+	
+    }
+    
 }
 
 /**

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigProfileIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigProfileIcon.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigProfileIcon.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,109 @@
+// $Id: FigProfileIcon.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+import java.awt.Image;

+

+import org.tigris.gef.presentation.FigImage;

+import org.tigris.gef.presentation.FigNode;

+import org.tigris.gef.presentation.FigText;

+

+/**

+ * This FigNode displays the image and the name of a classifier with an

+ * stereotype that provides an icon.

+ *

+ * @author Marcos Aurélio

+ */

+public class FigProfileIcon extends FigNode {

+

+    private FigImage image = null;

+    

+    private FigText  label = null;

+

+    private static final int GAP = 2;

+

+    /**

+     * Default constructor.

+     * 

+     * @param icon the icon

+     * @param str the default name

+     */

+    public FigProfileIcon(Image icon, String str) {

+	image = new FigImage(0, 0, icon);

+	label = new FigSingleLineText(0, image.getHeight() + GAP, 0, 0, true);

+	label.setText(str);

+	label.calcBounds();

+

+	addFig(image);

+	addFig(label);

+

+	image.setResizable(false);

+	image.setLocked(true);

+    }

+    

+    /**

+     * @param x

+     * @param y

+     * @param w

+     * @param h

+     * @see org.tigris.gef.presentation.FigNode#setBoundsImpl(int, int, int, int)

+     */

+    protected void setBoundsImpl(int x, int y, int w, int h) {

+	int width = Math.max(image.getWidth(), label.getWidth());

+

+	image.setLocation(x + (width - image.getWidth()) / 2, y);

+	label.setLocation(x + (width - label.getWidth()) / 2, y

+		+ image.getHeight() + GAP);

+

+	calcBounds();

+	updateEdges();

+    }

+

+    /**

+     * @return the FigText that contains the icon name

+     */

+    public FigText getLabelFig() {

+        return label;

+    }

+    

+    /**

+     * @return the label of the label fig

+     */

+    public String getLabel() {

+        return label.getText();

+    }

+

+    /**

+     * Sets the label and updates the figure bounds

+     * @param txt the label to set

+     */

+    public void setLabel(String txt) {

+        this.label.setText(txt);

+	this.label.calcBounds();

+	this.calcBounds();

+    }

+    

+    

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	2007-08-13 14:10:35-0700
@@ -24,12 +24,15 @@
 
 package org.argouml.uml.diagram.ui;
 
+import java.awt.Image;
 import java.beans.PropertyChangeEvent;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Vector;
 
 import org.apache.log4j.Logger;
+import org.argouml.kernel.ProjectManager;
 import org.argouml.model.AddAssociationEvent;
 import org.argouml.model.Model;
 import org.argouml.model.RemoveAssociationEvent;
@@ -65,7 +68,7 @@
      * Logger.
      */
     private static final Logger LOG =
-        Logger.getLogger(FigStereotypesCompartment.class);
+        Logger.getLogger(ActionAddStereotype.class);
 
     /**
      * One UML keyword is allowed. These are not strictly stereotypes but are
@@ -75,6 +78,8 @@
 
     private int stereotypeCount = 0;
     
+    private boolean hidingStereotypesWithIcon = false;
+    
     /**
      * The constructor.
      *
@@ -130,6 +135,7 @@
                             Model.getFacade().getName(stereotype));
                     stereotypeTextFig.setOwner(stereotype);
                     addFig(stereotypeTextFig);
+                    reorderStereotypeFigs();
                     damage();
                 }
             } else {
@@ -151,6 +157,40 @@
         }
     }
 
+    /**
+     * Keep the probaly invisible figs at the end of the list 
+     */
+    private void reorderStereotypeFigs() {
+	List allFigs = getFigs();
+	List figsWithIcon = new Vector();
+	List figsWithOutIcon = new Vector();
+	List others = new Vector();
+
+	Iterator it = allFigs.iterator();
+	
+	while(it.hasNext()) {
+	    Fig f = (Fig) it.next();
+	    if (f instanceof FigStereotype) {
+		FigStereotype s = (FigStereotype) f;
+		if (getIconForStereotype(s) != null) {
+		    figsWithIcon.add(s);
+		} else {
+		    figsWithOutIcon.add(s);
+		}
+	    } else {
+		others.add(f);
+	    }
+	}
+
+	Vector n = new Vector();
+	
+	n.addAll(others);
+	n.addAll(figsWithOutIcon);
+	n.addAll(figsWithIcon);	
+	
+	setFigs(n);
+    }
+
     private Fig findFig(Object stereotype) {
         for (Iterator it = getFigs().iterator(); it.hasNext(); ) {
             Fig f = (Fig) it.next();
@@ -214,7 +254,7 @@
             stereotypeTextFig.setText(keyword);
             acounter++;
         }
-
+        
         Collection stereos = Model.getFacade().getStereotypes(modelElement);
         if (stereos != null) {
             Iterator iter = stereos.iterator();
@@ -250,12 +290,37 @@
                     removeFig((Fig) figs.get(i));
                 }
             }
+
+            reorderStereotypeFigs();
+            
+            // remove all stereotypes that have a graphical icon
+            updateHiddenStereotypes();
         }
     }
 
+    private void updateHiddenStereotypes() {
+	List figs = getFigs();
+
+	for (int i = 0; i < figs.size(); ++i) {
+	    Fig f = (Fig) figs.get(i);
+	    if (f instanceof FigStereotype) {		
+		FigStereotype fs = (FigStereotype) f;		
+		fs.setVisible(getIconForStereotype(fs) == null
+			|| !isHidingStereotypesWithIcon());
+	    }
+	}
+    }
+
+    private Image getIconForStereotype(FigStereotype fs) {
+	return ProjectManager.getManager().getCurrentProject()
+		.getProfileConfiguration().getFigNodeStrategy()
+		.getIconForStereotype(fs.getOwner());
+    }
+
     /*
-     * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
-     */
+         * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int,
+         *      int)
+         */
     protected void setBoundsImpl(int x, int y, int w, int h) {
         Fig fig;
         int yy = y;
@@ -285,4 +350,13 @@
 
     protected void createModelElement() {
     }
+
+    public boolean isHidingStereotypesWithIcon() {
+        return hidingStereotypesWithIcon;
+    }
+
+    public void setHidingStereotypesWithIcon(boolean hidingStereotypesWithIcon) {
+        this.hidingStereotypesWithIcon = hidingStereotypesWithIcon;
+        updateHiddenStereotypes();
+    }
 }

Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FigNodeStrategy.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,46 @@
+// $Id: FigNodeStrategy.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.awt.Image;

+

+/**

+ * Using this stragey profiles can provide icons to replace the default 

+ * visualization of stereotyped node according to UML 2.0 specification.

+ *

+ * @author maurelio1234

+ */

+public interface FigNodeStrategy {

+    

+    /**

+     * Returns the image of the icon that should replace the model elements 

+     * having this stereotype  

+     * 

+     * @param stereotype the stereotype model element

+     * @return the icon

+     */

+    Image getIconForStereotype(Object stereotype);

+    

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FileModelLoader.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,69 @@
+// $Id: FileModelLoader.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.io.File;

+import java.io.FileInputStream;

+import java.io.FileNotFoundException;

+import java.io.InputStream;

+import java.util.Collection;

+

+import org.apache.log4j.Logger;

+

+/**

+ * An implementation for the ProfileModelLoader that loads profiles from file 

+ * resources.

+ *

+ * @author maurelio1234

+ */

+public class FileModelLoader extends StreamModelLoader {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+	    .getLogger(FileModelLoader.class);

+

+    /**

+     * @param modelFilename the model to be loaded

+     * @return the profile model

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

+     */

+    public Collection loadModel(String modelFilename) {

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

+        InputStream is = null;

+        //

+        //  try to find a file with that name

+        //

+        try {

+            File modelFile = new File(modelFilename);

+            is = new FileInputStream(modelFile);

+            

+            return super.loadModel(is);

+        } catch (FileNotFoundException ex) {

+        }

+        return null;

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FormatingStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FormatingStrategy.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/FormatingStrategy.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,54 @@
+// $Id: FormatingStrategy.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Iterator;

+

+/**

+ * Represents the formating strategy to be used when formating

+ * model element names

+ *

+ * @author Marcos Aurélio

+ */

+public interface FormatingStrategy {

+    /**

+     *    This method produces a string that represents the specific

+     *    model element in the context of the specified namespace.

+     *    @param element element to represent.

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

+     *    @return a string representing the model element

+     */

+    public abstract String formatElement(Object element,

+					 Object namespace);

+    /**

+     *   This method produces a string the represents the collection

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

+     *   @param iter iterator over collection

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

+     *   @return a string representing the collection

+     */

+    public abstract String formatCollection(Iterator iter,

+					    Object namespace);

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/JavaFormatingStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/JavaFormatingStrategy.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/JavaFormatingStrategy.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,236 @@
+// $Id: JavaFormatingStrategy.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Iterator;

+

+import org.argouml.model.Model;

+

+/**

+ * The Formating Strategy based on Java naming conventions 

+ *

+ * @author Marcos Aurélio

+ */

+public class JavaFormatingStrategy implements FormatingStrategy {

+    	

+    /**

+     * @param element the element to be formated

+     * @param namespace the element's namespace

+     * @return the formated string

+     * @see org.argouml.uml.profile.FormatingStrategy#formatElement(java.lang.Object, java.lang.Object)

+     */

+    public String formatElement(Object element, Object namespace) {

+	String value = null;

+	if (element == null) {

+	    value = "";

+	} else {

+	    Object elementNs = Model.getFacade().getNamespace(element);

+	    //

+	    //   if element is an AssociationEnd use

+	    //      the namespace of containing association

+	    //

+	    if (Model.getFacade().isAAssociationEnd(element)) {

+		Object assoc = Model.getFacade().getAssociation(element);

+		if (assoc != null) {

+		    elementNs = Model.getFacade().getNamespace(assoc);

+		}

+	    }

+	    if (elementNs == namespace) {

+		value = Model.getFacade().getName(element);

+		if (value == null || value.length() == 0) {

+		    value = defaultName(element, namespace);

+		}

+	    } else {

+		StringBuffer buffer = new StringBuffer();

+		String pathSep = getPathSeparator();

+		buildPath(buffer, element, pathSep);

+		value = buffer.toString();

+	    }

+	}

+	return value;

+    }

+

+    /**

+     * @param assocEnd the given association end name

+     * @param namespace the namespace

+     * @return the default name for the given associationend

+     */

+    protected String defaultAssocEndName(Object assocEnd,

+					 Object namespace) {

+	String name = null;

+	Object type = Model.getFacade().getType(assocEnd);

+	if (type != null) {

+	    name = formatElement(type, namespace);

+	} else {

+	    name = "unknown type";

+	}

+	Object mult = Model.getFacade().getMultiplicity(assocEnd);

+	if (mult != null) {

+	    StringBuffer buf = new StringBuffer(name);

+	    buf.append("[");

+	    buf.append(Integer.toString(Model.getFacade().getLower(mult)));

+	    buf.append("..");

+	    int upper = Model.getFacade().getUpper(mult);

+	    if (upper >= 0) {

+		buf.append(Integer.toString(upper));

+	    } else {

+		buf.append("*");

+	    }

+	    buf.append("]");

+	    name = buf.toString();

+	}

+	return name;

+    }

+

+    /**

+     * This function creates a default association name from its ends.

+     *

+     * @param assoc the given association

+     * @param ns the namespace

+     * @return the default association name

+     */

+    protected String defaultAssocName(Object assoc, Object ns) {

+	StringBuffer buf = new StringBuffer();

+	Iterator iter = Model.getFacade().getConnections(assoc).iterator();

+	for (int i = 0; iter.hasNext(); i++) {

+	    if (i != 0) {

+		buf.append("-");

+	    }

+	    buf.append(defaultAssocEndName(iter.next(), ns));

+	}

+	return buf.toString();

+    }

+

+    /**

+     * @param gen the given Generalization

+     * @param namespace the namespace

+     * @return the default generalization name

+     */

+    protected String defaultGeneralizationName(Object gen, Object namespace) {

+        Object child = Model.getFacade().getSpecific(gen);

+        Object parent = Model.getFacade().getGeneral(gen);

+	StringBuffer buf = new StringBuffer();

+	buf.append(formatElement(child, namespace));

+	buf.append(" extends ");

+	buf.append(formatElement(parent, namespace));

+	return buf.toString();

+    }

+

+    /**

+     * @param element the given modelelement

+     * @param namespace the namespace

+     * @return a default name for this modelelement

+     */

+    protected String defaultName(Object element, Object namespace) {

+	String name = null;

+	if (Model.getFacade().isAAssociationEnd(element)) {

+	    name = defaultAssocEndName(element, namespace);

+	} else {

+	    if (Model.getFacade().isAAssociation(element)) {

+		name = defaultAssocName(element, namespace);

+	    }

+	    if (Model.getFacade().isAGeneralization(element)) {

+		name = defaultGeneralizationName(element, namespace);

+	    }

+	}

+	if (name == null) {

+            name = "anon";

+        }

+	return name;

+    }

+

+    /**

+     * @return the path separator (currently ".")

+     */

+    protected String getPathSeparator() {

+	return ".";

+    }

+

+    /**

+     * @param buffer (out) the buffer that will contain the path build

+     * @param element the given modelelement

+     * @param pathSep the path separator character(s)

+     */

+    private void buildPath(StringBuffer buffer, Object element, 

+            String pathSep) {

+        if (element != null) {

+            Object parent = Model.getFacade().getNamespace(element);

+	    if (parent != null && parent != element) {

+		buildPath(buffer, parent, pathSep);

+		buffer.append(pathSep);

+	    }

+	    String name = Model.getFacade().getName(element);

+	    if (name == null || name.length() == 0) {

+		name = defaultName(element, null);

+	    }

+	    buffer.append(name);

+	}

+    }

+

+    /**

+     * @return the string that separates elements

+     */

+    protected String getElementSeparator() {

+	return ", ";

+    }

+

+    /**

+     * @return the string that represents an empty collection

+     */

+    protected String getEmptyCollection() {

+	return "[empty]";

+    }

+

+    /**

+     * @param iter the iterator of the collection

+     * @param namespace the namespace to be applied on the elements

+     * @return the formated string

+     * @see org.argouml.uml.profile.FormatingStrategy#formatCollection(java.util.Iterator, java.lang.Object)

+     */

+    public String formatCollection(Iterator iter, Object namespace) {

+	String value = null;

+	if (iter.hasNext()) {

+	    StringBuffer buffer = new StringBuffer();

+	    String elementSep = getElementSeparator();

+	    Object obj = null;

+	    for (int i = 0; iter.hasNext(); i++) {

+		if (i > 0) {

+		    buffer.append(elementSep);

+		}

+		obj = iter.next();

+		if (Model.getFacade().isAModelElement(obj)) {

+		    buffer.append(formatElement(obj, namespace));

+		} else {

+		    buffer.append(obj.toString());

+		}

+	    }

+	    value = buffer.toString();

+	} else {

+	    value = getEmptyCollection();

+	}

+	return value;

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/Profile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,199 @@
+// $Id: Profile.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Collection;

+import java.util.HashSet;

+import java.util.Iterator;

+import java.util.Set;

+

+import org.argouml.model.Model;

+

+

+/**

+ * Represents a Profile

+ * 

+ * @author Marcos Aurélio

+ */

+public abstract class Profile {

+    

+    private Set<Profile> importedProfiles  = new HashSet<Profile>();

+    private Set<Profile> importingProfiles = new HashSet<Profile>();

+        

+    /**

+     * A profile should call this method to state that it depends of <code>p</code>

+     * 

+     * @param p the profile

+     * @throws IllegalArgumentException if there is some cycle on the dependency graph

+     */

+    protected final void addProfileDependency(Profile p) throws IllegalArgumentException {

+        if (importingProfiles.contains(p)) {

+            throw new IllegalArgumentException();

+        } else {

+            importedProfiles.add(p);

+            importedProfiles.addAll(p.importedProfiles);

+

+            for (Profile importedProfile : importedProfiles) {

+                importedProfile.importingProfiles.add(this);

+            }

+        }

+    }    

+

+    /**

+     * @return the dependencies

+     */

+    public final Set<Profile> getDependencies() {

+        return importedProfiles;

+    }

+    

+    /**

+     * @return the name for this profile 

+     */

+    public abstract String getDisplayName();

+    

+    /**

+     * @return the UML Model that contains the profile model

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

+     */

+    public Object getModel() {

+        Collection c = null;

+        try {

+            c = getProfilePackages();

+        } catch (ProfileException e) {

+        }

+        

+        if (c != null) {

+            return c.iterator().next();

+        } else {

+            return null;

+        }

+    }

+

+    /**

+     * @return the formating strategy offered by this profile, if any. <br>

+     * 	       <b>null</b> if this profile has no formating strategy.

+     */

+    public abstract FormatingStrategy getFormatingStrategy();

+    

+    /**

+     * @return the FigNodeStrategy offered by this profile, if any. <br>

+     * 	       <b>null</b> if this profile has no FigNodeStrategy.

+     */

+    public abstract FigNodeStrategy   getFigureStrategy();

+

+    /**

+     *    This method produces a string that represents the specific

+     *    model element in the context of the specified namespace.

+     *    @param element element to represent.

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

+     *    @return a string representing the model element

+     */

+    public String formatElement(Object element,

+                                         Object namespace) {

+        FormatingStrategy fs = getFormatingStrategy(); 

+        if (fs != null) {

+            return fs.formatElement(element, namespace);

+        } else {

+            return null;

+        }

+    }

+    /**

+     *   This method produces a string the represents the collection

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

+     *   @param iter iterator over collection

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

+     *   @return a string representing the collection

+     */

+    public String formatCollection(Iterator iter,

+                                            Object namespace) {

+        FormatingStrategy fs = getFormatingStrategy(); 

+        if (fs != null) {

+            return fs.formatCollection(iter, namespace);

+        } else {

+            return null;

+        }        

+    }

+    /**

+     * @return the UML Model that contains the profile model

+     * @throws ProfileException if failed to get profile.

+     * @deprecated for 0.25.4 by tfmorris.  Use {@link #getProfilePackages()}.

+     */

+    @Deprecated

+    public Object getProfileModel() throws ProfileException {

+        if (getModel() == null) {

+            Object profileModel = null;

+            for (Object pkg : getProfilePackages()) {

+                if (Model.getFacade().isAPackage(pkg)) {

+                    profileModel = pkg;

+                    return profileModel;

+                }

+            }

+            profileModel = getProfilePackages().iterator().next();

+

+            return profileModel;

+        } else {

+            return getModel();

+        }

+    }

+    

+    /**

+     * @return the UML Model that contains the profile model

+     * @throws ProfileException if failed to get profile.

+     */

+    public abstract Collection getProfilePackages() throws ProfileException;

+    

+    /**

+     * Set the filename to load the profile model from.  This will be

+     * remembered and used as the file for all future loads.

+     * @param filename file name of XMI file containing model to use as profile

+     * 

+     * @throws ProfileException if the given file isn't a valid profile

+     * @deprecated by maurelio1234

+     */

+    @Deprecated

+    public void setProfileModelFilename(String filename)

+        throws ProfileException {

+        

+    }

+    

+    /**

+     * Return the filename that was or will be used to load the profile/default

+     * model.

+     * @return the filename

+     * @deprecated by maurelio1234

+     */

+    @Deprecated

+    public String getProfileModelFilename() {

+        return "";

+    }

+    

+    /**

+     * @return the display name

+     * @see java.lang.Object#toString()

+     */

+    public String toString() {

+        return getDisplayName();

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileConfiguration.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,347 @@
+// $Id: ProfileConfiguration.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+

+package org.argouml.uml.profile;

+

+import java.awt.Image;

+import java.util.Collection;

+import java.util.HashSet;

+import java.util.Iterator;

+import java.util.Set;

+import java.util.Vector;

+

+import org.apache.log4j.Logger;

+import org.argouml.kernel.AbstractProjectMember;

+import org.argouml.kernel.Project;

+import org.argouml.model.Model;

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

+import org.argouml.ui.explorer.ExplorerEventAdaptor;

+/**

+ *   This class captures represents the unique access point for the 

+ *   configurability allowed by the use of profiles. 

+ *

+ *   @author maurelio1234

+ */

+public class ProfileConfiguration extends AbstractProjectMember {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+            .getLogger(ProfileConfiguration.class);

+

+    private FormatingStrategy formatingStrategy;

+    private Vector	      figNodeStrategies = new Vector();

+    

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

+    private Vector<Object> profileModels = new Vector<Object>();

+    

+    /**

+     * The extension used in serialization and returned by {@link #getType()}

+     */

+    public static final String EXTENSION = "profile";

+        

+    /**

+     * The default constructor for this class. Sets the Java profile as the 

+     * default one and its formating strategy as the default one.

+     * 

+     * @param project the project that contains this configuration

+     */

+    public ProfileConfiguration(Project project) {

+	super(EXTENSION, project);

+	

+        Iterator it = ProfileManagerImpl.getInstance().getDefaultProfiles().iterator();

+        

+        while (it.hasNext()) {

+            Profile p = (Profile) it.next();

+            addProfile(p);

+            activateFormatingStrategy(p);                

+        }

+	

+    }

+    

+    /**

+     * @return the current formating strategy

+     */

+    public FormatingStrategy getFormatingStrategy() {

+        return formatingStrategy;

+    }

+    

+    /**

+     * Updates the current strategy to the strategy provided by the 

+     * passed profile. The profile should have been previously registered.

+     * 

+     * @param profile the profile providing the current formating strategy

+     */

+    public void activateFormatingStrategy(Profile profile) {

+	if (profile != null && profile.getFormatingStrategy() != null

+		&& getProfiles().contains(profile)) {

+	    this.formatingStrategy = profile.getFormatingStrategy();

+	}

+    }

+

+    /**

+     * @return the list of applied profiles

+     */

+    public Vector getProfiles() {

+        return profiles;

+    }

+    

+    /**

+     * Applies a new profile to this configuration

+     * 

+     * @param p the profile to be applied

+     */

+    @SuppressWarnings("unchecked")

+    public void addProfile(Profile p) {

+        if (!profiles.contains(p)) {

+            profiles.add(p);

+            try {

+                profileModels.addAll(p.getProfilePackages());

+            } catch (ProfileException e) {

+            }

+            

+            FigNodeStrategy fns = p.getFigureStrategy();

+            if (fns != null) {

+                figNodeStrategies.add(fns);

+            }

+

+            for (Profile dependency : p.getDependencies()) {

+                addProfile(dependency);

+            }

+            

+            ExplorerEventAdaptor.getInstance().structureChanged();

+        }

+    }

+        

+    /**

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

+     * @deprecated by maurelio1234

+     */

+    @SuppressWarnings("dep-ann")

+    @Deprecated

+    public Vector getProfileModels() {

+        return profileModels;

+    }

+

+    /**

+     * Removes the passed profile from the configuration. 

+     * 

+     * @param p the profile to be removed

+     */

+    public void removeProfile(Profile p) {

+        profiles.remove(p);

+        try {

+            profileModels.removeAll(p.getProfilePackages());

+        } catch (ProfileException e) {

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

+        }

+

+        FigNodeStrategy fns = p.getFigureStrategy();

+        if (fns != null) {

+            figNodeStrategies.remove(fns);

+        }

+

+        if (formatingStrategy == p.getFormatingStrategy()) {

+            formatingStrategy = null;

+        }

+

+        Vector<Profile> markForRemoval = new Vector<Profile>();

+        for (Profile profile : profiles) {

+            if (profile.getDependencies().contains(p)) {

+                markForRemoval.add(profile);

+            }

+        }

+

+        for (Profile profile : markForRemoval) {

+            removeProfile(profile);

+        }

+

+        ExplorerEventAdaptor.getInstance().structureChanged();

+    }

+    

+    private FigNodeStrategy compositeFigNodeStrategy = new FigNodeStrategy() {

+

+	public Image getIconForStereotype(Object element) {

+	    Iterator it = figNodeStrategies.iterator();

+

+	    while (it.hasNext()) {

+		FigNodeStrategy strat = (FigNodeStrategy) it.next();

+		Image extra = strat.getIconForStereotype(element);

+

+		if (extra != null) {

+		    return extra;

+		}

+	    }

+	    return null;

+	}

+	

+    };

+    

+    /**

+     * @return the current FigNodeStrategy

+     */

+    public FigNodeStrategy getFigNodeStrategy() {

+	return compositeFigNodeStrategy; 

+    }

+

+    /**

+     * @return the extension for this project member

+     * @see org.argouml.kernel.AbstractProjectMember#getType()

+     */

+    public String getType() {

+	return EXTENSION;

+    }

+

+    /**

+     * Objects of this class are always consistent, there's no need 

+     * to repair them.

+     * 

+     * @return the empty string.

+     * @see org.argouml.kernel.ProjectMember#repair()

+     */

+    public String repair() {

+	return "";

+    }

+

+    /**

+     * @return the "Profile Configuration" string

+     * @see java.lang.Object#toString()

+     */

+    public String toString() {

+        return "Profile Configuration";

+    }

+

+    /**

+     * @param string

+     * @param obj 

+     * @return

+     */

+    @SuppressWarnings("deprecation")

+    public Object findStereotypeForObject(String string, Object obj) {

+        Iterator iter = null;

+        

+        for (Object model : profileModels) {

+            iter = Model.getFacade().getOwnedElements(model).iterator();

+

+            while (iter.hasNext()) {

+                Object stereo = iter.next();

+                if (!Model.getFacade().isAStereotype(stereo)

+                        || !string.equals(Model.getFacade().getName(stereo))) {

+                    continue;

+                }

+

+                if (Model.getExtensionMechanismsHelper().isValidStereoType(obj,

+                        stereo)) {

+                    return Model.getModelManagementHelper()

+                            .getCorrespondingElement(stereo,

+                                    Model.getFacade().getModel(obj));

+                }

+            }            

+        }

+

+        return null;

+    }

+

+    /**

+     * @param name

+     * @return

+     */

+    public Object findType(String name) {

+        Object result = null;

+        Iterator it = getProfileModels().iterator();

+        while (result == null && it.hasNext()) {

+            result = findTypeInModel(name, it.next());

+        }

+        

+        return result;

+    }

+

+    private Object findTypeInModel(String s, Object model) {

+

+        if (!Model.getFacade().isANamespace(model)) {

+            throw new IllegalArgumentException(

+                    "Looking for the classifier " + s

+                    + " in a non-namespace object of " + model

+                    + ". A namespace was expected.");

+        }

+

+        Collection allClassifiers =

+            Model.getModelManagementHelper()

+                .getAllModelElementsOfKind(model,

+                        Model.getMetaTypes().getClassifier());

+

+        Object[] classifiers = allClassifiers.toArray();

+        Object classifier = null;

+

+        for (int i = 0; i < classifiers.length; i++) {

+

+            classifier = classifiers[i];

+            if (Model.getFacade().getName(classifier) != null

+                        && Model.getFacade().getName(classifier).equals(s)) {

+                return classifier;

+            }

+        }

+

+        return null;

+    }

+

+    /**

+     * @param metaType

+     * @return

+     */

+    @SuppressWarnings("unchecked")

+    public Collection findByMetaType(Object metaType) {

+        Set elements = new HashSet();

+

+        Iterator it = getProfileModels().iterator();

+        while (it.hasNext()) {

+            Object model = it.next();

+            elements.addAll(Model.getModelManagementHelper()

+                    .getAllModelElementsOfKind(model, metaType));

+        }

+        return elements;

+    }

+

+    /**

+     * @param modelElement

+     * @return

+     */

+    public Collection findAllStereotypesForModelElement(Object modelElement) {

+        return Model.getExtensionMechanismsHelper().getAllPossibleStereotypes(

+                getProfileModels(), modelElement);

+    }

+

+    public Object getDefaultAttributeType() {

+        return findType("int");

+    }

+

+    public Object getDefaultParameterType() {

+        return findType("int");

+    }

+

+    public Object getDefaultReturnType() {

+        return findType("void");

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileCpp.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,103 @@
+// $Id: ProfileCpp.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// 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

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.ArrayList;

+import java.util.Collection;

+

+import org.argouml.model.Model;

+

+/**

+ * This class represents the C++ default Profile

+ *

+ * @author Marcos Aurélio

+ */

+public class ProfileCpp extends Profile {

+

+    private FormatingStrategy formatingStrategy;

+    private ProfileModelLoader profileModelLoader;

+    private Collection model;

+    private static ProfileCpp instance;

+    

+    /**

+     * @return the unique instance for this profile

+     */

+    public static ProfileCpp getInstance() {

+        if (instance == null) {

+            instance = new ProfileCpp();

+        }

+        return instance;

+    }

+

+    

+    /**

+     * The default constructor for this class 

+     */

+    @SuppressWarnings("unchecked")

+    private ProfileCpp() {

+	profileModelLoader = new ResourceModelLoader();

+	model = profileModelLoader

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

+

+	if (model == null) {

+	    model = new ArrayList();

+	    model.add(Model.getModelManagementFactory().createModel());

+	}

+	

+        addProfileDependency(ProfileUML.getInstance());	

+    }    

+

+    

+    /**

+     * @return the Java formating strategy

+     * @see org.argouml.uml.profile.Profile#getFormatingStrategy()

+     */

+    public FormatingStrategy getFormatingStrategy() {

+	return formatingStrategy;

+    }

+

+    /**

+     * @return "C++"

+     * @see org.argouml.uml.profile.Profile#getDisplayName()

+     */

+    public String getDisplayName() {

+	return "C++";

+    }

+

+    /**

+     * @return null

+     * @see org.argouml.uml.profile.Profile#getFigureStrategy()

+     */

+    public FigNodeStrategy getFigureStrategy() {

+	return null;

+    }

+

+

+    @Override

+    public Collection getProfilePackages() throws ProfileException {

+        return model;

+    }

+    

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileException.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileException.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileException.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,62 @@
+// $Id: ProfileException.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 1996-2006 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+/**

+ * An exception to be thrown during failure of a opening

+ * and reading some storage medium.

+ * @author Bob Tarling

+ */

+public class ProfileException extends Exception {

+

+    /**

+     * The constructor.

+     *

+     * @param message the message to show

+     */

+    public ProfileException(String message) {

+        super(message);

+    }

+

+    /**

+     * The constructor.

+     *

+     * @param message the message to show

+     * @param theCause the cause for the exception

+     */

+    public ProfileException(String message, Throwable theCause) {

+        super(message, theCause);

+    }

+

+    /**

+     * The constructor.

+     *

+     * @param theCause the cause for the exception

+     */

+    public ProfileException(Throwable theCause) {

+        super(theCause);

+    }

+}

+


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileJava.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,101 @@
+// $Id: ProfileJava.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// 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

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.ArrayList;

+import java.util.Collection;

+

+import org.argouml.model.Model;

+

+/**

+ * This class represents the Java default Profile

+ *

+ * @author Marcos Aurélio

+ */

+public class ProfileJava extends Profile {

+

+    private FormatingStrategy formatingStrategy;

+    private ProfileModelLoader profileModelLoader;

+    private Collection model;

+    private static ProfileJava instance;

+    

+    /**

+     * @return the unique instance for this profile

+     */

+    public static ProfileJava getInstance() {

+        if (instance == null) {

+            instance = new ProfileJava();

+        }

+        return instance;

+    }

+    

+    /**

+     * The default constructor for this class 

+     */

+    @SuppressWarnings("unchecked")

+    private ProfileJava() {

+	profileModelLoader = new ResourceModelLoader();

+	model = profileModelLoader

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

+

+        if (model == null) {

+            model = new ArrayList();

+            model.add(Model.getModelManagementFactory().createModel());

+        }

+        	

+	addProfileDependency(ProfileUML.getInstance());

+    }    

+

+    

+    /**

+     * @return the Java formating strategy

+     * @see org.argouml.uml.profile.Profile#getFormatingStrategy()

+     */

+    public FormatingStrategy getFormatingStrategy() {

+	return formatingStrategy;

+    }

+

+    /**

+     * @return "Java"

+     * @see org.argouml.uml.profile.Profile#getDisplayName()

+     */

+    public String getDisplayName() {

+	return "Java";

+    }

+

+    /**

+     * @return null

+     * @see org.argouml.uml.profile.Profile#getFigureStrategy()

+     */

+    public FigNodeStrategy getFigureStrategy() {

+	return null;

+    }

+

+    @Override

+    public Collection getProfilePackages() throws ProfileException {

+        return model;

+    }

+    

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManager.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManager.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,101 @@
+// $Id: ProfileManager.java 13090 2007-07-16 12:37:40Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Vector;

+

+/**

+ * Manages the global set of registered profiles.

+ *

+ * @author maurelio1234

+ */

+public interface ProfileManager {

+    /**

+     * Register a new profile

+     * 

+     * @param p the profile

+     */

+    void registerProfile(Profile p);

+    /**

+     * Remove a profile from the list

+     * 

+     * @param p the profile

+     */

+    void removeProfile(Profile p);

+    

+    /**

+     * @return the list of registered profiles

+     */

+    Vector getRegisteredProfiles();

+    

+    /**

+     * @return the profile instance for the class

+     */

+    Profile getProfileForClass(String className);

+    

+    /**

+     * @return the default set of profiles

+     */

+    Vector getDefaultProfiles();

+    

+    /**

+     * Adds a profile to the default list.

+     * 

+     * @param p profile to add

+     */

+    void addToDefaultProfiles(Profile p);

+    

+    /**

+     * Remove a profile from the default list

+     * 

+     * @param p the profile to be removed

+     */

+    void removeFromDefaultProfiles(Profile p);

+    

+    /**

+     * Adds a new directory to the directory list

+     * 

+     * @param path user defined directory

+     */

+    void addSearchPathDirectory(String path);

+    

+    /**

+     * Removes a directory from the directory list

+     * 

+     * @param path

+     */

+    void removeSearchPathDirectory(String path);

+    

+    /**

+     * @return the current directory list

+     */

+    Vector getSearchPathDirectories();

+    

+    /**

+     * Looks for XMI files at the current directory list and registers

+     * them as user defined profiles.

+     */

+    void refreshRegisteredProfiles();

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileManagerImpl.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,323 @@
+// $Id: ProfileManagerImpl.java 13298 2007-08-12 19:40:57Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.io.File;

+import java.util.Iterator;

+import java.util.StringTokenizer;

+import java.util.Vector;

+

+import org.argouml.configuration.Configuration;

+import org.argouml.configuration.ConfigurationKey;

+

+/**

+ * Default <code>ProfileManager</code> implementation

+ *

+ * @author Marcos Aurélio

+ */

+public class ProfileManagerImpl implements ProfileManager {

+

+    /**

+     * The configuration key for the default profiles.

+     */

+    public static final ConfigurationKey KEY_DEFAULT_PROFILES = Configuration

+            .makeKey("profiles", "default");

+

+    /**

+     * The configuration key for the search directories.

+     */

+    public static final ConfigurationKey KEY_DEFAULT_DIRECTORIES = Configuration

+            .makeKey("profiles", "directories");

+

+    private static ProfileManager instance = null;

+

+    /**

+     * Avoids recursive configuration update when loading configuration

+     */

+    private boolean disableConfigurationUpdate = false;

+    

+    private Vector profiles = new Vector();

+

+    private Vector defaultProfiles = new Vector();

+

+    private Vector searchDirectories = new Vector();

+

+    private ProfileManagerImpl() {

+        defaultProfiles.add(ProfileUML.getInstance());

+        

+        registerProfile(ProfileUML.getInstance());

+        registerProfile(ProfileJava.getInstance());

+        registerProfile(ProfileCpp.getInstance());

+

+        loadDirectoriesFromConfiguration();

+

+        refreshRegisteredProfiles();

+

+        loadDefaultProfilesfromConfiguration();

+    }

+

+    private void loadDefaultProfilesfromConfiguration() {    

+        disableConfigurationUpdate = true;

+        

+        StringTokenizer tokenizer = new StringTokenizer(Configuration

+                .getString(KEY_DEFAULT_PROFILES), "*", false);

+

+        while (tokenizer.hasMoreTokens()) {

+            String desc = tokenizer.nextToken();

+

+            if (desc.charAt(0) == 'U') {

+                String fileName = desc.substring(1);

+                Profile p = findUserDefinedProfile(new File(fileName));

+                

+                if (p != null) {

+                    addToDefaultProfiles(p);

+                }

+            } else if (desc.charAt(0) == 'C') {

+                String className = desc.substring(1);

+                Profile p = getProfileForClass(className);

+                

+                if (p != null) {

+                    addToDefaultProfiles(p);

+                }

+            }

+        }

+

+        disableConfigurationUpdate = false;

+    }

+

+    private void updateDefaultProfilesConfiguration() {

+        if (!disableConfigurationUpdate) {

+            StringBuffer buf = new StringBuffer();

+

+            Iterator it = defaultProfiles.iterator();

+

+            while (it.hasNext()) {

+                Profile p = (Profile) it.next();

+

+                if (p instanceof UserDefinedProfile) {

+                    buf.append("U"

+                            + ((UserDefinedProfile) p).getModelFile()

+                                    .getAbsolutePath());

+                } else {

+                    buf.append("C" + p.getClass().getName());

+                }

+

+                buf.append("*");

+            }

+

+            Configuration.setString(KEY_DEFAULT_PROFILES, buf.toString());

+        }

+    }

+

+    private void loadDirectoriesFromConfiguration() {

+        disableConfigurationUpdate = true;

+        

+        StringTokenizer tokenizer = new StringTokenizer(Configuration

+                .getString(KEY_DEFAULT_DIRECTORIES), "*", false);

+

+        while (tokenizer.hasMoreTokens()) {

+            searchDirectories.add(tokenizer.nextToken());

+        }

+        

+        disableConfigurationUpdate = false;

+    }

+

+    private void updateSearchDirectoriesConfiguration() {

+        if (!disableConfigurationUpdate) {

+            StringBuffer buf = new StringBuffer();

+

+            Iterator it = searchDirectories.iterator();

+

+            while (it.hasNext()) {

+                String s = (String) it.next();

+                buf.append(s + "*");

+            }

+

+            Configuration.setString(KEY_DEFAULT_DIRECTORIES, buf.toString());

+        }

+    }

+

+    /**

+     * @return the unique instance for this class

+     */

+    public static ProfileManager getInstance() {

+        if (instance == null) {

+            instance = new ProfileManagerImpl();

+        }

+        return instance;

+    }

+

+    /**

+     * @return the list of profiles

+     * @see org.argouml.uml.profile.ProfileManager#getRegisteredProfiles()

+     */

+    public Vector getRegisteredProfiles() {

+        return profiles;

+    }

+

+    /**

+     * @param p the profile

+     * @see org.argouml.uml.profile.ProfileManager#registerProfile(org.argouml.uml.profile.Profile)

+     */

+    public void registerProfile(Profile p) {

+        if (!profiles.contains(p)) {

+            if (p instanceof UserDefinedProfile

+                    || getProfileForClass(p.getClass().getName()) == null) {

+                profiles.add(p);

+            }

+        }

+    }

+

+    /**

+     * @param p the profile

+     * @see org.argouml.uml.profile.ProfileManager#removeProfile(org.argouml.uml.profile.Profile)

+     */

+    public void removeProfile(Profile p) {

+        profiles.remove(p);

+        defaultProfiles.remove(p);

+    }

+

+    /**

+     * @param profileClass the profile class

+     * @return the profile object or null if there is no one

+     * @see org.argouml.uml.profile.ProfileManager#getProfileForClass(java.lang.Class)

+     */

+    public Profile getProfileForClass(String profileClass) {

+        Iterator it = profiles.iterator();

+        Profile found = null;

+

+        while (it.hasNext()) {

+            Profile p = (Profile) it.next();

+            if (p.getClass().getName().equals(profileClass)) {

+                found = p;

+                break;

+            }

+        }

+

+        return found;

+    }

+

+    /**

+     * @param p th profile

+     * @see org.argouml.uml.profile.ProfileManager#addToDefaultProfiles(org.argouml.uml.profile.Profile)

+     */

+    public void addToDefaultProfiles(Profile p) {

+        if (p != null && profiles.contains(p)) {

+            defaultProfiles.add(p);

+            updateDefaultProfilesConfiguration();

+        }

+    }

+

+    /**

+     * @return the list

+     * @see org.argouml.uml.profile.ProfileManager#getDefaultProfiles()

+     */

+    public Vector getDefaultProfiles() {

+        return defaultProfiles;

+    }

+

+    /**

+     * @param p the profile

+     * @see org.argouml.uml.profile.ProfileManager#removeFromDefaultProfiles(org.argouml.uml.profile.Profile)

+     */

+    public void removeFromDefaultProfiles(Profile p) {

+        if (p != null && profiles.contains(p)) {

+            defaultProfiles.remove(p);

+            updateDefaultProfilesConfiguration();

+        }

+    }

+

+    public void addSearchPathDirectory(String path) {

+        if (!searchDirectories.contains(path)) {

+            searchDirectories.add(path);

+            updateSearchDirectoriesConfiguration();

+        }

+    }

+

+    /**

+     * @return the directory list

+     * @see org.argouml.uml.profile.ProfileManager#getSearchPathDirectories()

+     */

+    public Vector getSearchPathDirectories() {

+        return searchDirectories;

+    }

+

+    /**

+     * @param path the directory to remove

+     * @see org.argouml.uml.profile.ProfileManager#removeSearchPathDirectory(java.lang.String)

+     */

+    public void removeSearchPathDirectory(String path) {

+        if (path != null) {

+            searchDirectories.remove(path);

+            updateSearchDirectoriesConfiguration();

+        }

+    }

+

+    /**

+     * @see org.argouml.uml.profile.ProfileManager#refreshRegisteredProfiles()

+     */

+    public void refreshRegisteredProfiles() {

+        Iterator it = searchDirectories.iterator();

+

+        while (it.hasNext()) {

+            File dir = new File((String) it.next());

+

+            if (dir.exists()) {

+                File[] files = dir.listFiles();

+

+                for (int i = 0; i < files.length; ++i) {

+                    if (files[i].getName().toLowerCase().endsWith(".xmi")) {

+

+                        boolean found = findUserDefinedProfile(files[i]) != null;

+

+                        if (!found) {

+                            UserDefinedProfile udp = new UserDefinedProfile(

+                                    files[i]);

+                            registerProfile(udp);

+                        }

+                    }

+                }

+            }

+        }

+    }

+

+    private Profile findUserDefinedProfile(File file) {

+        Iterator it2 = profiles.iterator();

+

+        while (it2.hasNext()) {

+            Profile p = (Profile) it2.next();

+

+            if (p instanceof UserDefinedProfile) {

+                UserDefinedProfile udp = (UserDefinedProfile) p;

+

+                if (udp.getModelFile().equals(file)) {

+                    return udp;

+                }

+            }

+        }

+        return null;

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileModelLoader.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,43 @@
+// $Id: ProfileModelLoader.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Collection;

+

+/**

+ * Objects implementing this class are responsible for loading profile models

+ *

+ * @author maurelio1234

+ */

+public interface ProfileModelLoader {

+    /**

+     * Tries to load a model from the specified path

+     * 

+     * @param path the path where the profile can be found. <b>

+     *             The expected string format is implementation specific! 

+     * @return the set of defined packages

+     */

+    Collection loadModel(String path);  

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ProfileUML.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,100 @@
+// $Id: ProfileUML.java 13040 2007-07-10 20:00:25Z linus $

+// 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

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies.  This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason.  IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.ArrayList;

+import java.util.Collection;

+

+import org.argouml.model.Model;

+

+/**

+ * This class represents the default UML profile

+ *

+ * @author Marcos Aurélio

+ */

+public class ProfileUML extends Profile {

+

+    private FormatingStrategy formatingStrategy;

+    private ProfileModelLoader profileModelLoader;

+    private Collection model;

+    private static ProfileUML instance;

+    

+    /**

+     * @return the unique instance for this profile

+     */

+    public static ProfileUML getInstance() {

+        if (instance == null) {

+            instance = new ProfileUML();

+        }

+        return instance;

+    }

+    

+    /**

+     * The default constructor for this class 

+     */

+    @SuppressWarnings("unchecked")

+    private ProfileUML() {

+        formatingStrategy = new JavaFormatingStrategy();

+	profileModelLoader = new ResourceModelLoader();

+	model = profileModelLoader

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

+

+        if (model == null) {

+            model = new ArrayList();

+            model.add(Model.getModelManagementFactory().createModel());

+        }        

+    }    

+

+    

+    /**

+     * @return the Java formating strategy

+     * @see org.argouml.uml.profile.Profile#getFormatingStrategy()

+     */

+    public FormatingStrategy getFormatingStrategy() {

+	return formatingStrategy;

+    }

+

+    /**

+     * @return "UML 1.4"

+     * @see org.argouml.uml.profile.Profile#getDisplayName()

+     */

+    public String getDisplayName() {

+	return "UML 1.4";

+    }

+

+    /**

+     * @return null

+     * @see org.argouml.uml.profile.Profile#getFigureStrategy()

+     */

+    public FigNodeStrategy getFigureStrategy() {

+	return null;

+    }

+

+    @Override

+    public Collection getProfilePackages() throws ProfileException {

+        return model;

+    }

+    

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ResourceModelLoader.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,74 @@
+// $Id: ResourceModelLoader.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.util.Collection;

+

+import org.apache.log4j.Logger;

+

+/**

+ * Loads models using the default class loader or a provided one.

+ *

+ * @author maurelio1234

+ */

+public class ResourceModelLoader extends StreamModelLoader {

+

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+	    .getLogger(ResourceModelLoader.class);

+    

+    private Class classloader;

+    

+    /**

+     * The default constructor for this class. Loads resources from the same 

+     * classloader that loaded this class.

+     */

+    public ResourceModelLoader() {

+	this.classloader = this.getClass();

+    }

+    

+    /**

+     * Loads resources from the classloader that loaded the given class

+     * 

+     * @param c the reference class

+     */

+    public ResourceModelLoader(Class c) {

+	this.classloader = c;

+    }

+

+    /**

+     * @param path the model path

+     * @return the model

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

+     */

+    public Collection loadModel(String path) {

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

+	return super.loadModel(this.classloader

+		.getResourceAsStream(path));

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/StreamModelLoader.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,74 @@
+// $Id: StreamModelLoader.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.io.InputStream;

+import java.util.Collection;

+

+import org.apache.log4j.Logger;

+import org.argouml.model.Model;

+import org.argouml.model.UmlException;

+import org.argouml.model.XmiReader;

+import org.xml.sax.InputSource;

+

+/**

+ * Loads models from a given InputStream

+ *

+ * @author Marcos Aurélio

+ */

+public abstract class StreamModelLoader implements ProfileModelLoader {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+	    .getLogger(StreamModelLoader.class);

+

+    /**

+     * @param path the path of the model

+     * @return the loaded model

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

+     */

+    public abstract Collection loadModel(String path);

+

+    /**

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

+     * @return the model

+     */

+    protected Collection loadModel(InputStream is) {

+        if (is != null) {

+            try {

+                XmiReader xmiReader = Model.getXmiReader();

+                InputSource inputSource = new InputSource(is);

+                Collection elements = xmiReader.parse(inputSource, true);

+                return elements;

+            } catch (UmlException e) {

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

+                return null;

+            }

+        }

+        LOG.error("Profile not found");

+        return null;	

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/UserDefinedProfile.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,108 @@
+// $Id: UserDefinedProfile.java 13094 2007-07-18 11:44:08Z maurelio1234 $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.io.File;

+import java.util.Collection;

+

+/**

+ * Represents a profile defined by the user

+ *

+ * @author Marcos Aurélio

+ */

+public class UserDefinedProfile extends Profile {

+

+    private String displayName;

+    private File modelFile;

+    private Collection model;

+    private boolean fromZargo;

+    

+    /**

+     * The default constructor for this class

+     * 

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

+     */

+    public UserDefinedProfile(File file) {

+	this.displayName = file.getName();

+	this.modelFile = file;

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

+        this.fromZargo = false;

+    }

+    

+    /**

+     * This constructor is used by the persitence subsystem

+     * when loading an user defined profile from a zargo file.

+     * 

+     * @param fileName the fake file name

+     * @param model    the model loaded from the zargo file

+     */

+    public UserDefinedProfile(String fileName, Collection model) {

+        this.displayName = fileName;

+        this.modelFile = new File(fileName);

+        this.model = model;

+        this.fromZargo = true;

+    }

+    

+    /**

+     * @return the string that should represent this profile in the GUI. An start (*) is placed on it if it comes from the currently opened zargo file.

+     * 

+     * @see org.argouml.uml.profile.Profile#getDisplayName()

+     */

+    public String getDisplayName() {

+	return displayName + (fromZargo? "*" : "");

+    }

+

+    /**

+     * @return null

+     * @see org.argouml.uml.profile.Profile#getFormatingStrategy()

+     */

+    public FormatingStrategy getFormatingStrategy() {

+	return null;

+    }

+

+    /**

+     * @return null

+     * @see org.argouml.uml.profile.Profile#getFigureStrategy()

+     */

+    public FigNodeStrategy getFigureStrategy() {

+	return null;

+    }

+

+    /**

+     * @return the file passed at the constructor

+     */

+    public File getModelFile() {

+        return modelFile;

+    }

+    

+    public String toString() {

+        return super.toString() + " [" + getModelFile() + "]";

+    }

+

+    @Override

+    public Collection getProfilePackages() throws ProfileException {

+        return model;

+    }

+}


Added: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java?view=auto&rev=13313
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/profile/ZipModelLoader.java	2007-08-13 14:10:35-0700
@@ -0,0 +1,116 @@
+// $Id: ZipModelLoader.java 13040 2007-07-10 20:00:25Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.profile;

+

+import java.io.File;

+import java.io.IOException;

+import java.io.InputStream;

+import java.net.MalformedURLException;

+import java.net.URL;

+import java.util.Collection;

+import java.util.zip.ZipEntry;

+import java.util.zip.ZipInputStream;

+

+import org.apache.log4j.Logger;

+

+/**

+ * Loads model data from a Zip file

+ * 

+ * @author maurelio1234

+ */

+public class ZipModelLoader extends StreamModelLoader {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger

+	    .getLogger(ZipModelLoader.class);

+

+    /**

+     * @param modelFilename the zip file

+     * @return the loaded model

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

+     */

+    public Collection loadModel(String modelFilename) {

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

+

+	InputStream is = null;

+	File modelFile = new File(modelFilename);

+	// TODO: This is in the wrong place.  It's not profile specific.

+	// It needs to be moved to main XMI reading code. - tfm 20060326

+	if (modelFilename.endsWith("zip")) {

+	    String filename = modelFile.getName();

+	    String extension = filename.substring(filename.indexOf('.'),

+		    filename.lastIndexOf('.'));

+	    String path = modelFile.getParent();

+	    // Add the path of the model to the search path, so we can

+	    // read dependent models

+	    if (path != null) {

+		System.setProperty("org.argouml.model.modules_search_path",

+			path);

+	    }

+	    try {

+		is = openZipStreamAt(modelFile.toURL(), extension);

+	    } catch (MalformedURLException e) {

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

+			+ "'", e);

+		return null;

+	    } catch (IOException e) {

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

+			+ "'", e);

+		return null;

+	    }

+

+	    if (is != null) {

+		return super.loadModel(is);

+	    }

+	}

+	return null;

+    }

+

+    /**

+     * Open a ZipInputStream to the first file found with a given extension.

+     *

+     * TODO: Remove since this is a duplicate of ZipFilePersister method

+     * when we have refactored the Persister subsystem.

+     *

+     * @param url

+     *            The URL of the zip file.

+     * @param ext

+     *            The required extension.

+     * @return the zip stream positioned at the required location.

+     * @throws IOException

+     *             if there is a problem opening the file.

+     */

+    private ZipInputStream openZipStreamAt(URL url, String ext)

+	throws IOException {

+	ZipInputStream zis = new ZipInputStream(url.openStream());

+	ZipEntry entry = zis.getNextEntry();

+	while (entry != null && !entry.getName().endsWith(ext)) {

+	    entry = zis.getNextEntry();

+	}

+	return zis;

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/PropPanel.java	2007-08-13 14:10:35-0700
@@ -61,7 +61,7 @@
 import org.argouml.ui.targetmanager.TargetEvent;
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.ui.targetmanager.TargettableModelView;
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.swidgets.GridLayout2;
 import org.tigris.swidgets.LabelledLayout;
@@ -446,8 +446,8 @@
     /*
      * @see org.argouml.uml.ui.UMLUserInterfaceContainer#getProfile()
      */
-    public Profile getProfile() {
-        return ProjectManager.getManager().getCurrentProject().getProfile();
+    public ProfileConfiguration getProfile() {
+        return ProjectManager.getManager().getCurrentProject().getProfileConfiguration();
     }
 
     /*
@@ -461,14 +461,14 @@
      * @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatElement(java.lang.Object)
      */
     public String formatElement(/* MModelElement */Object element) {
-        return getProfile().formatElement(element, getDisplayNamespace());
+        return getProfile().getFormatingStrategy().formatElement(element, getDisplayNamespace());
     }
 
     /*
      * @see org.argouml.uml.ui.UMLUserInterfaceContainer#formatNamespace(java.lang.Object)
      */
     public String formatNamespace(/* MNamespace */Object namespace) {
-        return getProfile().formatElement(namespace, null);
+        return getProfile().getFormatingStrategy().formatElement(namespace, null);
     }
 
     /*
@@ -476,7 +476,7 @@
      */
     public String formatCollection(Iterator iter) {
         Object namespace = getDisplayNamespace();
-        return getProfile().formatCollection(iter, namespace);
+        return getProfile().getFormatingStrategy().formatCollection(iter, namespace);
     }
 
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLComboBoxEntry.java	2007-08-13 14:10:35-0700
@@ -28,7 +28,7 @@
 
 import org.apache.log4j.Logger;
 import org.argouml.model.Model;
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.Profile;
 
 /**
  * A combobox entry. <p>

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/UMLUserInterfaceContainer.java	2007-08-13 14:10:35-0700
@@ -26,7 +26,7 @@
 package org.argouml.uml.ui;
 import java.util.Iterator;
 
-import org.argouml.uml.Profile;
+import org.argouml.uml.profile.ProfileConfiguration;
 
 /**
  * Interface supported by any container of UML user interface components.
@@ -53,7 +53,7 @@
     /**
      * @return the current profile, may not be null
      */
-    public Profile getProfile();
+    public ProfileConfiguration getProfile();
 
     /**
      * Formats the specified model element.  Typically, deferred to the

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLGeneralizationPowertypeComboBoxModel.java	2007-08-13 14:10:35-0700
@@ -70,9 +70,9 @@
                 .getAllModelElementsOfKind(model,
                         Model.getMetaTypes().getClassifier()));
         }
-        elements.addAll(Model.getModelManagementHelper()
-                .getAllModelElementsOfKind(p.getDefaultModel(),
-                        Model.getMetaTypes().getClassifier()));
+
+        elements.addAll(p.getProfileConfiguration().findByMetaType(
+                Model.getMetaTypes().getClassifier()));
         setElements(elements);
     }
 

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/core/UMLStructuralFeatureTypeComboBoxModel.java	2007-08-13 14:10:35-0700
@@ -99,10 +99,8 @@
                             model, Model.getMetaTypes().getDataType()));
         }
 
-        elements.addAll(Model.getModelManagementHelper()
-                .getAllModelElementsOfKind(
-                        p.getDefaultModel(),
-                        Model.getMetaTypes().getClassifier()));
+        elements.addAll(p.getProfileConfiguration().findByMetaType(
+                Model.getMetaTypes().getClassifier()));
 
 	// Our comparator will throw an InvalidElementException if the old
 	// list contains deleted elements (eg after a new project is loaded)

Modified: branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java?view=diff&rev=13313&p1=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java&p2=branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java&r1=13312&r2=13313
==============================================================================
--- branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	(original)
+++ branches/gsoc2007/maurelio1234/branch2/src_new/org/argouml/uml/ui/foundation/extension_mechanisms/UMLTagDefinitionComboBoxModel.java	2007-08-13 14:10:35-0700
@@ -114,10 +114,10 @@
                             model,
                             Model.getMetaTypes().getTagDefinition()));
         }
-        addAllUniqueModelElementsFrom(availableTagDefs, paths,
-                Model.getModelManagementHelper().getAllModelElementsOfKind(
-                        project.getDefaultModel(),
+        addAllUniqueModelElementsFrom(availableTagDefs, paths, project
+                .getProfileConfiguration().findByMetaType(
                         Model.getMetaTypes().getTagDefinition()));
+                        
         List notValids = new ArrayList();
         for (Object tagDef : availableTagDefs) {
             Object owner = Model.getFacade().getOwner(tagDef);
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.