svn commit: r13127 - trunk/src/model-euml: . .settings META-INF lib src/org/argouml/model/euml

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-07-23 22:30:24-0700
New Revision: 13127

Added:
   trunk/src/model-euml/lib/org.eclipse.emf.ecore.change_2.3.0.v200706262000.jar   (contents, props changed)
   trunk/src/model-euml/lib/org.eclipse.emf.edit_2.3.0.v200706262000.jar   (contents, props changed)
   trunk/src/model-euml/lib/org.eclipse.emf.mapping.ecore2xml_2.3.0.v200706262000.jar   (contents, props changed)
   trunk/src/model-euml/lib/org.eclipse.uml2.common.edit_1.3.0.v200706251652.jar   (contents, props changed)
   trunk/src/model-euml/lib/org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar   (contents, props changed)
   trunk/src/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java   (contents, props changed)
   trunk/src/model-euml/src/org/argouml/model/euml/RunnableClass.java   (contents, props changed)
Modified:
   trunk/src/model-euml/.classpath
   trunk/src/model-euml/.project
   trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs
   trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs
   trunk/src/model-euml/META-INF/MANIFEST.MF
   trunk/src/model-euml/build.properties
   trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
   trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
   trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
   trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
   trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
   trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
   trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java

Log:
Mid term checkpoint from Bogdan's b00__1 branch

Modified: trunk/src/model-euml/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/.classpath?view=diff&rev=13127&p1=trunk/src/model-euml/.classpath&p2=trunk/src/model-euml/.classpath&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/.classpath	(original)
+++ trunk/src/model-euml/.classpath	2007-07-23 22:30:24-0700
@@ -3,10 +3,5 @@
 	<classpathentry kind="src" path="src"/>

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

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

-	<classpathentry kind="lib" path="lib/org.eclipse.emf.common_2.3.0.v200703080200.jar"/>

-	<classpathentry kind="lib" path="lib/org.eclipse.emf.ecore_2.3.0.v200703080200.jar"/>

-	<classpathentry kind="lib" path="lib/org.eclipse.emf.ecore.xmi_2.3.0.v200703080200.jar"/>

-	<classpathentry kind="lib" path="lib/org.eclipse.uml2.common_1.3.0.v200703011358.jar"/>

-	<classpathentry kind="lib" path="lib/org.eclipse.uml2.uml_2.1.0.v200703011358.jar"/>

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

 </classpath>


Modified: trunk/src/model-euml/.project
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/.project?view=diff&rev=13127&p1=trunk/src/model-euml/.project&p2=trunk/src/model-euml/.project&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/.project	(original)
+++ trunk/src/model-euml/.project	2007-07-23 22:30:24-0700
@@ -10,8 +10,25 @@
 			<arguments>

 			</arguments>

 		</buildCommand>

+		<buildCommand>

+			<name>org.eclipse.pde.ManifestBuilder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+		<buildCommand>

+			<name>org.eclipse.pde.SchemaBuilder</name>

+			<arguments>

+			</arguments>

+		</buildCommand>

+		<buildCommand>

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

+			<arguments>

+			</arguments>

+		</buildCommand>

 	</buildSpec>

 	<natures>

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

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

+		<nature>org.eclipse.pde.PluginNature</nature>

 	</natures>

 </projectDescription>


Modified: trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs?view=diff&rev=13127&p1=trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs&p2=trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs	(original)
+++ trunk/src/model-euml/.settings/org.eclipse.jdt.core.prefs	2007-07-23 22:30:24-0700
@@ -1,4 +1,4 @@
-#Thu Jun 07 16:11:21 EDT 2007

+#Thu Jul 19 11:03:49 EDT 2007

 eclipse.preferences.version=1

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

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

@@ -67,3 +67,257 @@
 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning

 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Modified: trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs?view=diff&rev=13127&p1=trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs&p2=trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs	(original)
+++ trunk/src/model-euml/.settings/org.eclipse.jdt.ui.prefs	2007-07-23 22:30:24-0700
@@ -1,3 +1,5 @@
-#Mon May 28 17:57:57 EDT 2007

+#Thu Jul 19 11:03:47 EDT 2007

 eclipse.preferences.version=1

+formatter_profile=_My ArgoUML

+formatter_settings_version=11

 org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return Returns the ${bare_field_name}.\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} The ${bare_field_name} to set.\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructor
 comment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n *\r\n * ${tags}\r\n * @author ${user}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment fo
 r non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/*\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\=
 "newtype">// $$Id\: eclipse-argo-codetemplates.xml,v 1.2 2006/05/25 12\:58\:04 linus Exp $$\r\n// Copyright (c) ${year} The Regents of the University of California. All\r\n// Rights Reserved. Permission to use, copy, modify, and distribute this\r\n// software and its documentation without fee, and without a written\r\n// agreement is hereby granted, provided that the above copyright notice\r\n// and this paragraph appear in all copies. This software program and\r\n// documentation are copyrighted by The Regents of the University of\r\n// California. The software program and documentation are supplied "AS\r\n// IS", without any accompanying services from The Regents. The Regents\r\n// does not warrant that the operation of the program will be\r\n// uninterrupted or error-free. The end-user understands that the program\r\n// was developed for research purposes and is advised not to rely\
 r\n// exclusively on the program for any reason. IN NO EVENT SHALL THE\r\n// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,\r\n// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,\r\n// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF\r\n// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF\r\n// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY\r\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE\r\n// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF\r\n// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,\r\n// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\r\n\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true"
  context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><t
 emplate autoinsert\="false" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\nLOG.error("Exception", ${exception_var});</template><template autoinsert\="false" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo}\: Auto-generated method stub\r\nthrow new NotYetImplementedException();\r\n</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stu
 b</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>


Modified: trunk/src/model-euml/META-INF/MANIFEST.MF
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/META-INF/MANIFEST.MF?view=diff&rev=13127&p1=trunk/src/model-euml/META-INF/MANIFEST.MF&p2=trunk/src/model-euml/META-INF/MANIFEST.MF&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/META-INF/MANIFEST.MF	(original)
+++ trunk/src/model-euml/META-INF/MANIFEST.MF	2007-07-23 22:30:24-0700
@@ -3,11 +3,23 @@
 Bundle-Name: %pluginName

 Bundle-SymbolicName: org.argouml.core.model.euml2

 Bundle-Version: 0.25.3

+Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin

-Export-Package: org.argouml.model.euml

-Bundle-Vendor: %pluginProvider

 Require-Bundle: org.argouml.core.model,

- org.eclipse.core.runtime

-Bundle-ClassPath: 

-Eclipse-RegisterBuddy: 

+ org.eclipse.core.runtime,
+ org.eclipse.uml2.common,
+ org.eclipse.uml2.common.edit,
+ org.eclipse.uml2.uml,
+ org.eclipse.uml2.uml.edit,
+ org.eclipse.uml2.uml.resources,
+ org.eclipse.uml2,
+ org.eclipse.emf,
+ org.eclipse.emf.converter,
+ org.eclipse.emf.ecore.change.edit,
+ org.eclipse.emf.mapping,
+ org.eclipse.emf.mapping.ecore,
+ org.eclipse.emf.mapping.ecore2ecore,
+ org.eclipse.emf.mapping.ecore2xml
 Bundle-RequiredExecutionEnvironment: J2SE-1.5

+Export-Package: org.argouml.model.euml
+Eclipse-RegisterBuddy: org.argouml.core.lib

Modified: trunk/src/model-euml/build.properties
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/build.properties?view=diff&rev=13127&p1=trunk/src/model-euml/build.properties&p2=trunk/src/model-euml/build.properties&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/build.properties	(original)
+++ trunk/src/model-euml/build.properties	2007-07-23 22:30:24-0700
@@ -1,7 +1,3 @@
 bin.includes = META-INF/,\
-               lib/jmi.jar,\
-               lib/jmiutils.jar,\
-               lib/mdrapi.jar,\
-               lib/mof.jar,\
-               lib/nbmdr.jar,\
-               lib/openide-util.jar
+               .
+source.. = src/

Added: trunk/src/model-euml/lib/org.eclipse.emf.ecore.change_2.3.0.v200706262000.jar
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/lib/org.eclipse.emf.ecore.change_2.3.0.v200706262000.jar?view=auto&rev=13127
==============================================================================
Binary file. No diff available.

Added: trunk/src/model-euml/lib/org.eclipse.emf.edit_2.3.0.v200706262000.jar
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/lib/org.eclipse.emf.edit_2.3.0.v200706262000.jar?view=auto&rev=13127
==============================================================================
Binary file. No diff available.

Added: trunk/src/model-euml/lib/org.eclipse.emf.mapping.ecore2xml_2.3.0.v200706262000.jar
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/lib/org.eclipse.emf.mapping.ecore2xml_2.3.0.v200706262000.jar?view=auto&rev=13127
==============================================================================
Binary file. No diff available.

Added: trunk/src/model-euml/lib/org.eclipse.uml2.common.edit_1.3.0.v200706251652.jar
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/lib/org.eclipse.uml2.common.edit_1.3.0.v200706251652.jar?view=auto&rev=13127
==============================================================================
Binary file. No diff available.

Added: trunk/src/model-euml/lib/org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/lib/org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar?view=auto&rev=13127
==============================================================================
Binary file. No diff available.

Modified: trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/CoreFactoryEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -31,6 +31,8 @@
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.CoreFactory;
 import org.argouml.model.NotImplementedException;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.uml2.common.edit.command.ChangeCommand;
 import org.eclipse.uml2.uml.Abstraction;
 import org.eclipse.uml2.uml.AggregationKind;
 import org.eclipse.uml2.uml.Artifact;
@@ -54,7 +56,9 @@
 import org.eclipse.uml2.uml.Operation;
 import org.eclipse.uml2.uml.PackageImport;
 import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.PrimitiveType;
 import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.TemplateBinding;
 import org.eclipse.uml2.uml.TemplateParameter;
 import org.eclipse.uml2.uml.Type;
 import org.eclipse.uml2.uml.UMLFactory;
@@ -72,6 +76,10 @@
      */
     private EUMLModelImplementation modelImpl;
 
+    private EditingDomain editingDomain;
+
+    private UMLFactory uml = UMLFactory.eINSTANCE;
+
     /**
      * Constructor.
      *
@@ -79,57 +87,72 @@
      */
     public CoreFactoryEUMLImpl(EUMLModelImplementation implementation) {
         modelImpl = implementation;
+        editingDomain = implementation.getEditingDomain();
     }
 
-    public Abstraction buildAbstraction(String name, Object supplier, Object client) {
-        Abstraction abstraction = createAbstraction();
+    public Abstraction buildAbstraction(String name, Object supplier,
+            Object client) {
+        Abstraction abstraction = uml.createAbstraction();
         abstraction.setName(name);
         abstraction.getSuppliers().add((NamedElement) supplier);
         abstraction.getClients().add((NamedElement) client);
         return abstraction;
     }
 
-    // TODO: A few different ways of building Associations.  Pick one that
-    // works and is efficient - tfm
-    public Object buildAssociation(Object fromClassifier,
+    Association buildAssociation(final Object type1,
+            final Boolean navigability1, final Object aggregationKind1,
+            final String name1, final Object type2,
+            final Boolean navigability2, final Object aggregationKind2,
+            final String name2, final String associationName) {
+
+        RunnableClass run = new RunnableClass() {
+            public void run() {
+                Association assoc = ((Type) type1).createAssociation(
+                        navigability1,
+                        aggregationKind1 == null ? AggregationKind.NONE_LITERAL
+                                : (AggregationKind) aggregationKind1, name1, 0,
+                        1, (Type) type2, navigability2,
+                        aggregationKind2 == null ? AggregationKind.NONE_LITERAL
+                                : (AggregationKind) aggregationKind2, name2, 0,
+                        1);
+                for (Property p : assoc.getMemberEnds()) {
+                    p.setLowerValue(null);
+                    p.setUpperValue(null);
+                }
+                if (associationName != null) {
+                    assoc.setName(associationName);
+                }
+                getParams().add(assoc);
+            }
+        };
+        editingDomain.getCommandStack().execute(
+                new ChangeCommand(editingDomain, run));
+
+        return (Association) run.getParams().get(0);
+    }
+
+    public Association buildAssociation(Object fromClassifier,
             Object aggregationKind1, Object toClassifier,
             Object aggregationKind2, Boolean unidirectional) {
-        
-//        return ((Type) fromClassifier).createAssociation(
-//                true, (AggregationKind) aggregationKind1, null, 1, 1, 
-//                (Type) toClassifier, 
-//                true, (AggregationKind) aggregationKind2, null, 1, 1); 
-
-        Association assoc = (Association) createAssociation();
-        Property end1 = assoc.createNavigableOwnedEnd(null, (Type) fromClassifier);
-        Property end2 = assoc.createOwnedEnd(null, (Type) toClassifier);
-        boolean uni = false;
-        if (unidirectional != null && unidirectional.booleanValue()) {
-            uni = true;
-        }
-        end2.setIsNavigable(uni);
-        return assoc;
-        
+
+        return buildAssociation(fromClassifier, true, aggregationKind1, null,
+                toClassifier, !unidirectional, aggregationKind2, null, null);
     }
 
-    public Object buildAssociation(Object classifier1, Object classifier2) {
-        return buildAssociation(
-                classifier1, AggregationKind.NONE_LITERAL, classifier2,
-                AggregationKind.NONE_LITERAL, false);
+    public Association buildAssociation(Object classifier1, 
+            Object classifier2) {
+        return buildAssociation(classifier1, true,
+                AggregationKind.NONE_LITERAL, null, classifier2, true,
+                AggregationKind.NONE_LITERAL, null, null);
     }
 
-    public Object buildAssociation(Object c1, boolean nav1, Object c2,
+    public Association buildAssociation(Object c1, boolean nav1, Object c2,
             boolean nav2, String name) {
-        Association assoc = (Association) createAssociation();
-        Property end1 = assoc.createOwnedEnd(null, (Type) c1);
-        end1.setIsNavigable(nav1);
-        Property end2 = assoc.createOwnedEnd(null, (Type) c2);
-        end2.setIsNavigable(nav1);
-        assoc.setName(name);
-        return assoc;
+        return buildAssociation(c1, nav1, AggregationKind.NONE_LITERAL, null,
+                c2, nav2, AggregationKind.NONE_LITERAL, null, name);
     }
 
-    public Object buildAssociationClass(Object end1, Object end2) {
+    public Association buildAssociationClass(Object end1, Object end2) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -146,7 +169,7 @@
         // TODO Auto-generated method stub
         return null;
     }
-    
+
     Property buildAttribute() {
         Property attr = createAttribute();
         attr.setName("newAttr");
@@ -165,7 +188,7 @@
     }
 
     @SuppressWarnings("deprecation")
-	public Property buildAttribute(Object handle, Object model, Object type) {
+    public Property buildAttribute(Object handle, Object model, Object type) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -185,31 +208,30 @@
         return null;
     }
 
-    public Object buildClass() {
-        return createClass();
+    public org.eclipse.uml2.uml.Class buildClass() {
+        return uml.createClass();
     }
 
-    public Object buildClass(Object owner) {
+    public org.eclipse.uml2.uml.Class buildClass(Object owner) {
         return buildClass(null, owner);
     }
 
-    public Object buildClass(String name) {
+    public org.eclipse.uml2.uml.Class buildClass(String name) {
         return buildClass(name, null);
     }
 
-    public Object buildClass(String name, Object owner) {
-        org.eclipse.uml2.uml.Class cls =
-                (org.eclipse.uml2.uml.Class) createClass();
-        if (owner != null) {
-            modelImpl.getCoreHelper().addOwnedElement(owner, cls);
-        }
+    public org.eclipse.uml2.uml.Class buildClass(final String name,
+            final Object owner) {
+        org.eclipse.uml2.uml.Class cls = uml.createClass();
         if (name != null) {
             cls.setName(name);
         }
+        if (owner != null)
+            modelImpl.getCoreHelper().addOwnedElement(owner, cls);
         return cls;
     }
 
-    public Object buildComment(Object element, Object model) {
+    public Comment buildComment(Object element, Object model) {
         if (model == null) {
             throw new IllegalArgumentException(
                     "A namespace must be supplied."); //$NON-NLS-1$
@@ -237,7 +259,7 @@
         return null;
     }
 
-    public Object buildDataType(String name, Object owner) {
+    public DataType buildDataType(String name, Object owner) {
         DataType dt = (DataType) createDataType();
         dt.setName(name);
         modelImpl.getCoreHelper().addOwnedElement(owner, dt);
@@ -254,7 +276,7 @@
         return null;
     }
 
-    public Object buildEnumeration(String name, Object owner) {
+    public Enumeration buildEnumeration(String name, Object owner) {
         Enumeration enumer = (Enumeration) createEnumeration();
         enumer.setName(name);
         if (owner != null) {
@@ -263,7 +285,8 @@
         return enumer;
     }
 
-    public Object buildEnumerationLiteral(String name, Object enumeration) {
+    public EnumerationLiteral buildEnumerationLiteral(String name,
+            Object enumeration) {
         return ((Enumeration) enumeration).createOwnedLiteral(name);
     }
 
@@ -276,8 +299,8 @@
 
     public Generalization buildGeneralization(Object child, Object parent) {
         Generalization generalization =
-                ((BehavioredClassifier) child)
-                        .createGeneralization((Classifier) parent);
+            ((BehavioredClassifier) child)
+            .createGeneralization((Classifier) parent);
         return generalization;
     }
 
@@ -307,7 +330,7 @@
     }
 
     @SuppressWarnings("deprecation")
-	public Operation buildOperation(Object classifier, Object model,
+    public Operation buildOperation(Object classifier, Object model,
             Object returnType) {
         // TODO Auto-generated method stub
         return null;
@@ -319,19 +342,20 @@
     }
 
     @SuppressWarnings("deprecation")
-	public Operation buildOperation(Object cls, Object model,
+    public Operation buildOperation(Object cls, Object model,
             Object returnType, String name) {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public Operation buildOperation2(Object cls, Object returnType, String name) {
+    public Operation buildOperation2(Object cls, Object returnType, 
+            String name) {
         // TODO Auto-generated method stub
         return null;
     }
 
     @SuppressWarnings("deprecation")
-	public Parameter buildParameter(Object o, Object model, Object type) {
+    public Parameter buildParameter(Object o, Object model, Object type) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -350,8 +374,8 @@
             Object supplier, Object namespace) {
         // TODO: namespace is ignored
         InterfaceRealization realization =
-                ((BehavioredClassifier) client).createInterfaceRealization(
-                        null, (Interface) supplier);
+            ((BehavioredClassifier) client).createInterfaceRealization(
+                    null, (Interface) supplier);
         return realization;
     }
 
@@ -386,41 +410,41 @@
     }
 
     public Abstraction createAbstraction() {
-        return UMLFactory.eINSTANCE.createAbstraction();
+        return uml.createAbstraction();
     }
 
     public Artifact createArtifact() {
-        return UMLFactory.eINSTANCE.createArtifact();
+        return uml.createArtifact();
     }
 
     public Association createAssociation() {
-        return UMLFactory.eINSTANCE.createAssociation();
+        return uml.createAssociation();
     }
 
     public AssociationClass createAssociationClass() {
-        return UMLFactory.eINSTANCE.createAssociationClass();
+        return uml.createAssociationClass();
     }
 
     public Property createAssociationEnd() {
         // TODO: Double check - tfm
-        return UMLFactory.eINSTANCE.createProperty();
+        return uml.createProperty();
     }
 
     public Property createAttribute() {
         // TODO: Double check - tfm
-        return UMLFactory.eINSTANCE.createProperty();
+        return uml.createProperty();
     }
 
-    public Object createBinding() {
-        return UMLFactory.eINSTANCE.createTemplateBinding();
+    public TemplateBinding createBinding() {
+        return uml.createTemplateBinding();
     }
 
     public org.eclipse.uml2.uml.Class createClass() {
-        return UMLFactory.eINSTANCE.createClass();
+        return uml.createClass();
     }
 
     public Comment createComment() {
-        return UMLFactory.eINSTANCE.createComment();
+        return uml.createComment();
     }
 
     public Object createComponent() {
@@ -429,15 +453,15 @@
     }
 
     public Constraint createConstraint() {
-        return UMLFactory.eINSTANCE.createConstraint();
+        return uml.createConstraint();
     }
 
     public DataType createDataType() {
-        return UMLFactory.eINSTANCE.createDataType();
+        return uml.createDataType();
     }
 
     public Dependency createDependency() {
-        return UMLFactory.eINSTANCE.createDependency();
+        return uml.createDependency();
     }
 
     public Object createElementResidence() {
@@ -446,11 +470,11 @@
     }
 
     public Enumeration createEnumeration() {
-        return UMLFactory.eINSTANCE.createEnumeration();
+        return uml.createEnumeration();
     }
 
     public EnumerationLiteral createEnumerationLiteral() {
-        return UMLFactory.eINSTANCE.createEnumerationLiteral();
+        return uml.createEnumerationLiteral();
     }
 
     public Object createFlow() {
@@ -459,11 +483,11 @@
     }
 
     public Generalization createGeneralization() {
-        return UMLFactory.eINSTANCE.createGeneralization();
+        return uml.createGeneralization();
     }
 
     public Interface createInterface() {
-        return UMLFactory.eINSTANCE.createInterface();
+        return uml.createInterface();
     }
 
     public Object createMethod() {
@@ -472,19 +496,19 @@
     }
 
     public Node createNode() {
-        return UMLFactory.eINSTANCE.createNode();
+        return uml.createNode();
     }
 
     public Operation createOperation() {
-        return UMLFactory.eINSTANCE.createOperation();
+        return uml.createOperation();
     }
 
     public Parameter createParameter() {
-        return UMLFactory.eINSTANCE.createParameter();
+        return uml.createParameter();
     }
 
     public PackageImport createPermission() {
-        return UMLFactory.eINSTANCE.createPackageImport();
+        return uml.createPackageImport();
     }
 
     @SuppressWarnings("deprecation")
@@ -492,10 +516,10 @@
         return createPrimitiveType();
     }
 
-    public Object createPrimitiveType() {
-        return UMLFactory.eINSTANCE.createPrimitiveType();
+    public PrimitiveType createPrimitiveType() {
+        return uml.createPrimitiveType();
     }
-    
+
     @SuppressWarnings("deprecation")
     public Object createProgrammingLanguageDataType() {
         // Removed from UML 2.x & unused by ArgoUML.
@@ -508,12 +532,11 @@
     }
 
     public TemplateParameter createTemplateParameter() {
-        return UMLFactory.eINSTANCE.createTemplateParameter();
+        return uml.createTemplateParameter();
     }
 
     public Usage createUsage() {
-        return UMLFactory.eINSTANCE.createUsage();
+        return uml.createUsage();
     }
 
-
 }

Modified: trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/EUMLModelImplementation.java	2007-07-23 22:30:24-0700
@@ -24,10 +24,26 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+/*
+ * This implementation uses ideas and code snippets from the 
+ * "org.eclipse.uml2.uml.editor.presentation" package.
+ * 
+ * The package "org.eclipse.uml2.uml.editor.presentation" is part of the
+ * Eclipse UML2 plugin and it is available under the terms of 
+ * the Eclipse Public License v1.0.
+ * 
+ * The Eclipse Public License v1.0 is available at 
+ * http://www.eclipse.org/legal/epl-v10.html.
+ */
+
 package org.argouml.model.euml;
 
+import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.util.EventObject;
+import java.util.Map;
 
 import org.apache.log4j.Logger;
 import org.argouml.model.ActivityGraphsFactory;
@@ -50,7 +66,6 @@
 import org.argouml.model.ExtensionMechanismsHelper;
 import org.argouml.model.Facade;
 import org.argouml.model.MetaTypes;
-import org.argouml.model.ModelEventPump;
 import org.argouml.model.ModelImplementation;
 import org.argouml.model.ModelManagementFactory;
 import org.argouml.model.ModelManagementHelper;
@@ -67,7 +82,22 @@
 import org.argouml.model.VisibilityKind;
 import org.argouml.model.XmiReader;
 import org.argouml.model.XmiWriter;
-import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.common.command.BasicCommandStack;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.uml2.common.edit.domain.UML2AdapterFactoryEditingDomain;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.resource.UML22UMLExtendedMetaData;
+import org.eclipse.uml2.uml.resource.UML22UMLResource;
+import org.eclipse.uml2.uml.resource.UMLResource;
+import org.eclipse.uml2.uml.resource.XMI2UMLExtendedMetaData;
 import org.eclipse.uml2.uml.resource.XMI2UMLResource;
 
 /**
@@ -87,10 +117,10 @@
  * @since ArgoUML 0.25.4, May 2007
  */
 public class EUMLModelImplementation implements ModelImplementation {
-    
+
     private static final Logger LOG =
-            Logger.getLogger(EUMLModelImplementation.class);
-    
+        Logger.getLogger(EUMLModelImplementation.class);
+
     private ActivityGraphsFactory theActivityGraphsFactory;
 
     private ActivityGraphsHelper theActivityGraphsHelper;
@@ -130,7 +160,7 @@
 
     private MetaTypes theMetaTypes;
 
-    private ModelEventPump theModelEventPump;
+    private ModelEventPumpEUMLImpl theModelEventPump;
 
     private ModelManagementFactory theModelManagementFactory;
 
@@ -144,9 +174,9 @@
     private ScopeKind theScopeKind;
 
     private StateMachinesFactory theStateMachinesFactory;
-    
+
     private StateMachinesHelper theStateMachinesHelper;
-    
+
     private UmlFactory theUmlFactory;
 
     private UmlHelper theUmlHelper;
@@ -158,42 +188,162 @@
     private VisibilityKind theVisibilityKind;
 
     /**
+     * This keeps track of the editing domain that is used to track all changes
+     * to the model.
+     */
+    private AdapterFactoryEditingDomain editingDomain;
+
+    /**
      * Constructor.
      */
     public EUMLModelImplementation() {
-        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
-                XMI2UMLResource.FILE_EXTENSION, XMI2UMLResource.Factory.INSTANCE);
-        
-        // This registers the .uml extension too, but that conflicts with
-        // the ArgoUML usage for a concatenated project file.
-//        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
-//                UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
-        
-        // Create and start event pump first so it's available for all others
-//        theModelEventPump = new ModelEventPumpEUMLImpl(this);
-//        theModelEventPump.startPumpingEvents();
-//        LOG.debug("EUML Init - event pump started");
-
-        // We may want to initialize some basic packages first,
-        // but we should try to use lazy initialization for most/all.
-//        // DataTypes is next so it's available for Kinds, ModelManagement,
-//        // & Extensions
-//        theDataTypesFactory = new DataTypesFactoryEUMLImpl(this);
-//        theDataTypesHelper = new DataTypesHelperEUMLImpl(this);
-//
-//        theAggregationKind = new AggregationKindEUMLImpl(this);
-//        theChangeableKind = new ChangeableKindEUMLImpl(this);
-//        theConcurrencyKind = new ConcurrencyKindEUMLImpl(this);
-//        theDirectionKind = new DirectionKindEUMLImpl(this);
-//        theOrderingKind = new OrderingKindEUMLImpl(this);
-//        thePseudostateKind = new PseudostateKindEUMLImpl(this);
-//        theScopeKind = new ScopeKindEUMLImpl(this);
-//        theVisibilityKind = new VisibilityKindEUMLImpl(this);
+        initializeEditingDomain();
+        LOG.debug("EUML Init - editing domain initialized"); //$NON-NLS-1$
+    }
+
+    /**
+     * Verifies if the editing domain can undo the last changes in the UML
+     * model.
+     * 
+     * @return true if undo is possible, false otherwise
+     */
+    public boolean canUndo() {
+        return editingDomain.getCommandStack().canUndo();
+    }
+
+    /**
+     * Verifies if the editing domain can redo the last undone command.
+     * @return true if redo is possible, false otherwise
+     */
+    public boolean canRedo() {
+        return editingDomain.getCommandStack().canRedo();
+    }
+
+    /**
+     * Undo the last command
+     * <p>
+     * If {@link #canUndo()} returns false, nothing will happen
+     */
+    public void undo() {
+        editingDomain.getCommandStack().undo();
+    }
+
+    /**
+     * Redo the last command
+     * <p>
+     * If {@link #canRedo()} returns false, nothing will happen
+     */
+    public void redo() {
+        editingDomain.getCommandStack().redo();
+    }
+
+    /**
+     * This sets up the editing domain for the model editor.
+     */
+    private void initializeEditingDomain() {
+        // If the eUML.resources system property is defined then we are in a
+        // stand alone application, else we're in an Eclipse plug in.
+        // The eUML.resource should contain the path to the
+        // org.eclipse.uml2.uml.resource jar plugin.
+        String path = System.getProperty("eUML.resources"); //$NON-NLS-1$
+
+        ComposedAdapterFactory adapterFactory = null;
+
+        BasicCommandStack commandStack = new BasicCommandStack() {
+
+            @Override
+            protected void handleError(Exception exception) {
+                super.handleError(exception);
+                exception.printStackTrace();
+                throw new RuntimeException(exception);
+            }
+
+        };
+
+        commandStack.addCommandStackListener(new CommandStackListener() {
+
+            public void commandStackChanged(final EventObject event) {
+                LOG.debug("Command stack changed"); //$NON-NLS-1$
+                Command mostRecentCommand = 
+                    ((CommandStack) event.getSource()).getMostRecentCommand();
+                if (mostRecentCommand != null) {
+                    LOG.debug("Affected objects: " //$NON-NLS-1$
+                            + mostRecentCommand.getAffectedObjects());
+                }
+            }
+
+        });
+
+        if (path == null) {
+            // TODO: figure out how to use the ItemProviders - 
+            // delayed until the ArgoEclipse version will be out 
+//          List<AdapterFactory> factories = new ArrayList<AdapterFactory>();
+//          factories.add(new UMLResourceItemProviderAdapterFactory());
+//          factories.add(new UMLItemProviderAdapterFactory());
+//          factories.add(new EcoreItemProviderAdapterFactory());
+//          factories.add(new UMLReflectiveItemProviderAdapterFactory());
+//          adapterFactory = new ComposedAdapterFactory(factories);
+        }
+
+        editingDomain = new UML2AdapterFactoryEditingDomain(adapterFactory,
+                commandStack);
+
+        ResourceSet resourceSet = editingDomain.getResourceSet();
+        Map<String, Object> extensionToFactoryMap = 
+            resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap();
+        Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
+
+        if (path != null) {
+            try {
+                FileInputStream in = new FileInputStream(path);
+                in.close();
+            } catch (IOException e) {
+                throw (new RuntimeException(e));
+            }
+
+            path = path.replace('\\', '/');
+            if (Character.isLetter(path.charAt(0))) {
+                path = '/' + path;
+            }
+            URI uri = URI.createURI("jar:file:" + path + "!/"); //$NON-NLS-1$ //$NON-NLS-2$
+            LOG.debug("eUML.resource URI --> " + uri); //$NON-NLS-1$
+
+            resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
+                    UMLPackage.eINSTANCE);
+            resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,
+                    EcorePackage.eINSTANCE);
+            extensionToFactoryMap.put(UMLResource.FILE_EXTENSION,
+                    UMLResource.Factory.INSTANCE);
+            uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri
+                    .appendSegment("libraries").appendSegment("")); //$NON-NLS-1$ //$NON-NLS-2$
+            uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri
+                    .appendSegment("metamodels").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+            uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri
+                    .appendSegment("profiles").appendSegment("")); //$NON-NLS-1$//$NON-NLS-2$
+        }
+
+        extensionToFactoryMap.put(UML22UMLResource.FILE_EXTENSION,
+                UML22UMLResource.Factory.INSTANCE);
+        extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
+                XMI2UMLResource.Factory.INSTANCE);
+        uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
+        uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
+    }
+
+    /**
+     * Getter for {@link #editingDomain the Editing Domain}
+     * 
+     * @return the editing domain of the current EUMLModelImplementation
+     *         instance
+     */
+    public EditingDomain getEditingDomain() {
+        return editingDomain;
     }
 
     public ActivityGraphsFactory getActivityGraphsFactory() {
         if (theActivityGraphsFactory == null) {
-            theActivityGraphsFactory = new ActivityGraphsFactoryEUMLlImpl(this);
+            theActivityGraphsFactory = 
+                new ActivityGraphsFactoryEUMLlImpl(this);
         }
         return theActivityGraphsFactory;
     }
@@ -217,7 +367,6 @@
         if (theChangeableKind == null) {
             theChangeableKind = new ChangeableKindEUMLImpl();
         }
-
         return theChangeableKind;
     }
 
@@ -301,7 +450,7 @@
     public ExtensionMechanismsFactory getExtensionMechanismsFactory() {
         if (theExtensionMechanismsFactory == null) {
             theExtensionMechanismsFactory =
-                    new ExtensionMechanismsFactoryEUMLImpl(this);
+                new ExtensionMechanismsFactoryEUMLImpl(this);
         }
         return theExtensionMechanismsFactory;
     }
@@ -309,9 +458,8 @@
     public ExtensionMechanismsHelper getExtensionMechanismsHelper() {
         if (theExtensionMechanismsHelper == null) {
             theExtensionMechanismsHelper =
-                    new ExtensionMechanismsHelperEUMLImpl(this);
+                new ExtensionMechanismsHelperEUMLImpl(this);
         }
-
         return theExtensionMechanismsHelper;
     }
 
@@ -319,7 +467,6 @@
         if (theFacade == null) {
             theFacade = new FacadeEUMLImpl(this);
         }
-
         return theFacade;
     }
 
@@ -330,7 +477,7 @@
         return theMetaTypes;
     }
 
-    public ModelEventPump getModelEventPump() {
+    public ModelEventPumpEUMLImpl getModelEventPump() {
         if (theModelEventPump == null) {
             theModelEventPump = new ModelEventPumpEUMLImpl(this);
         }
@@ -340,7 +487,7 @@
     public ModelManagementFactory getModelManagementFactory() {
         if (theModelManagementFactory == null) {
             theModelManagementFactory =
-                    new ModelManagementFactoryEUMLImpl(this);
+                new ModelManagementFactoryEUMLImpl(this);
         }
         return theModelManagementFactory;
     }
@@ -356,7 +503,6 @@
         if (theOrderingKind == null) {
             theOrderingKind = new OrderingKindEUMLImpl();
         }
-
         return theOrderingKind;
     }
 
@@ -389,7 +535,7 @@
         }
         return theStateMachinesHelper;
     }
-    
+
     public UmlFactory getUmlFactory() {
         if (theUmlFactory == null) {
             theUmlFactory = new UmlFactoryEUMLImpl(this);
@@ -422,7 +568,6 @@
         if (theVisibilityKind == null) {
             theVisibilityKind = new VisibilityKindEUMLImpl();
         }
-
         return theVisibilityKind;
     }
 
@@ -431,7 +576,7 @@
     }
 
     public XmiWriter getXmiWriter(Object model, Writer writer, String version)
-        throws UmlException {
+            throws UmlException {
         return new XmiWriterEUMLImpl(this, model, writer, version);
     }
 
@@ -439,12 +584,10 @@
             String version) throws UmlException {
         return new XmiWriterEUMLImpl(this, model, stream, version);
     }
-    
+
     public DiagramInterchangeModel getDiagramInterchangeModel() {
         // TODO Auto-generated method stub
         return null;
     }
 
-
-
 }

Modified: trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/FacadeEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -106,7 +106,6 @@
 import org.eclipse.uml2.uml.StructuralFeature;
 import org.eclipse.uml2.uml.TemplateParameter;
 import org.eclipse.uml2.uml.TimeEvent;
-import org.eclipse.uml2.uml.TimeExpression;
 import org.eclipse.uml2.uml.Transition;
 import org.eclipse.uml2.uml.Trigger;
 import org.eclipse.uml2.uml.TypedElement;
@@ -299,7 +298,7 @@
             if (((Property) handle).isReadOnly()) {
                 return modelImpl.getChangeableKind().getFrozen();
             } else {
-                return modelImpl.getChangeableKind().getChangeable();                
+                return modelImpl.getChangeableKind().getChangeable();
             }
         }
         throw new NotYetImplementedException();
@@ -349,8 +348,9 @@
     public Collection<Collaboration> getCollaborations(Object handle) {
         Set<Collaboration> result = new HashSet<Collaboration>();
         if (handle instanceof Classifier) {
-            for (CollaborationUse cu : ((Classifier) handle).getCollaborationUses()) {
-                result.add(cu.getType()); 
+            for (CollaborationUse cu 
+                    : ((Classifier) handle).getCollaborationUses()) {
+                result.add(cu.getType());
             }
         }
         return result;
@@ -454,6 +454,7 @@
         throw new NotYetImplementedException();
     }
 
+    @SuppressWarnings("deprecation")
     public Object getDiscriminator(Object handle) {
         // Gone from UML 2.x
 //        throw new NotImplementedException();
@@ -473,7 +474,8 @@
     }
 
     public Collection getElementImports(Object handle) {
-        throw new NotYetImplementedException();
+        return Collections.EMPTY_LIST;
+//      throw new NotYetImplementedException();
     }
 
     public Collection getElementImports2(Object handle) {
@@ -684,7 +686,7 @@
         // MultiplicityElement is now an interface implemented
         // by element types that support multiplicities - tfm
         if (handle instanceof MultiplicityElement) {
-            return (MultiplicityElement)handle;
+            return (MultiplicityElement) handle;
         } else {
             throw new IllegalArgumentException();
         }
@@ -700,7 +702,7 @@
             // no longer named.  For a transitional period we'll
             // return a String to debug can continue, but the
             // calling code should probably be fixed. - tfm 20070607
-            return "";
+            return ""; //$NON-NLS-1$
         }
 //        throw new IllegalArgumentException();
     }
@@ -760,13 +762,13 @@
             if (((Property) handle).isOrdered()) {
                 return modelImpl.getOrderingKind().getOrdered();
             } else {
-                return modelImpl.getOrderingKind().getUnordered();               
+                return modelImpl.getOrderingKind().getUnordered();
             }
         } else if (handle instanceof MultiplicityElement) {
             if (((MultiplicityElement) handle).isOrdered()) {
                 return modelImpl.getOrderingKind().getOrdered();
             } else {
-                return modelImpl.getOrderingKind().getUnordered();               
+                return modelImpl.getOrderingKind().getUnordered();
             }
         }
         throw new NotYetImplementedException();
@@ -884,7 +886,8 @@
     }
 
     public Collection getReceptions(Object handle) {
-        // TODO: Signal -> Receptions association not navigable in this direction
+        // TODO: Signal -> Receptions association not navigable in this
+        // direction
         return Collections.EMPTY_SET;
     }
 
@@ -1223,6 +1226,7 @@
         return handle instanceof AggregationKind;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isAArgListsExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1248,7 +1252,7 @@
 
     public boolean isAAssociationEnd(Object handle) {
         return handle instanceof Property
-                && ((Property) handle).getOwningAssociation() != null;
+                && ((Property) handle).getAssociation() != null;
     }
 
     public boolean isAAssociationEndRole(Object handle) {
@@ -1283,6 +1287,7 @@
         throw new NotYetImplementedException();
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isABooleanExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1476,6 +1481,7 @@
         return handle instanceof Interface;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isAIterationExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1500,6 +1506,7 @@
         throw new NotYetImplementedException();
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isAMappingExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1565,6 +1572,7 @@
         return false;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isAObjectSetExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1599,6 +1607,7 @@
         return handle instanceof PrimitiveType;
     }
     
+    @SuppressWarnings("deprecation")
     public boolean isAProcedureExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1736,6 +1745,7 @@
         return handle instanceof TimeEvent;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isATimeExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);
@@ -1745,6 +1755,7 @@
         return handle instanceof Transition;
     }
 
+    @SuppressWarnings("deprecation")
     public boolean isATypeExpression(Object handle) {
         // TODO: Fallback for UML 1.4
         return isAExpression(handle);

Modified: trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -26,20 +26,97 @@
 
 package org.argouml.model.euml;
 
+import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-
-import org.argouml.model.ModelEventPump;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.log4j.Logger;
+import org.argouml.model.AbstractModelEventPump;
+import org.argouml.model.AddAssociationEvent;
+import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.DeleteInstanceEvent;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
 
 /**
  * The implementation of the ModelEventPump for EUML2.
  */
-class ModelEventPumpEUMLImpl implements ModelEventPump {
+class ModelEventPumpEUMLImpl extends AbstractModelEventPump {
+
+    /**
+     * A listener attached to a UML element
+     */
+    class Listener {
+
+        private PropertyChangeListener listener;
+
+        private Set<String> props;
+
+        Listener(PropertyChangeListener listener, String[] properties) {
+            this.listener = listener;
+            if (properties != null) {
+                props = null;
+                addProperties(properties);
+            }
+        }
+
+        void addProperties(String[] properties) {
+            if (properties == null) {
+                return;
+            }
+            if (props == null) {
+                props = new HashSet<String>();
+            }
+            for (String s : properties) {
+                props.add(s);
+            }
+        }
+
+        void removeProperties(String[] properties) {
+            for (String s : properties) {
+                props.remove(s);
+            }
+        }
+
+        PropertyChangeListener getListener() {
+            return listener;
+        }
+
+        Set<String> getProperties() {
+            return props;
+        }
+
+    }
 
     /**
      * The model implementation.
      */
     private EUMLModelImplementation modelImpl;
 
+    private RootContainerAdapter rootContainerAdapter = 
+        new RootContainerAdapter(this);
+
+    // Access should be fast
+    private Map<Object, List<Listener>> registerForElements = 
+        new HashMap<Object, List<Listener>>();
+
+    // Iteration should be fast
+    private Map<Object, List<Listener>> registerForClasses = 
+        new LinkedHashMap<Object, List<Listener>>();
+
+    private Object mutex;
+    
+    private Logger LOG = Logger.getLogger(ModelEventPumpEUMLImpl.class);
+    
     /**
      * Constructor.
      * 
@@ -48,81 +125,216 @@
      */
     public ModelEventPumpEUMLImpl(EUMLModelImplementation implementation) {
         modelImpl = implementation;
+        mutex = this;
     }
 
-    public void addClassModelEventListener(PropertyChangeListener listener,
-            Object modelClass, String[] propertyNames) {
-        // TODO Auto-generated method stub
-
+    /**
+     * Setter for the root container
+     * @param container
+     */
+    public void setRootContainer(Notifier container) {
+        rootContainerAdapter.setRootContainer(container);
     }
 
     public void addClassModelEventListener(PropertyChangeListener listener,
-            Object modelClass, String propertyName) {
-        // TODO Auto-generated method stub
-
+            Object modelClass, String[] propertyNames) {
+        if (!(modelClass instanceof Class && EObject.class
+                .isAssignableFrom((Class) modelClass))) {
+            throw new IllegalArgumentException();
+        }
+        registerListener(
+                modelClass, listener, propertyNames, registerForClasses);
     }
 
     public void addModelEventListener(PropertyChangeListener listener,
             Object modelelement, String[] propertyNames) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void addModelEventListener(PropertyChangeListener listener,
-            Object modelelement, String propertyName) {
-        // TODO Auto-generated method stub
-
+        if (!(modelelement instanceof EObject)) {
+            throw new IllegalArgumentException();
+        }
+        registerListener(
+                (EObject) modelelement, listener, propertyNames,
+                registerForElements);
     }
 
     public void addModelEventListener(PropertyChangeListener listener,
             Object modelelement) {
-        // TODO Auto-generated method stub
+        addModelEventListener(listener, modelelement, (String []) null);
+    }
 
+    private void registerListener(Object notifier,
+            PropertyChangeListener listener, String[] propertyNames,
+            Map<Object, List<Listener>> register) {
+        if (notifier == null || listener == null) {
+            throw new NullPointerException();
+        }
+        synchronized (mutex) {
+            List<Listener> list = register.get(notifier);
+            boolean new_ = false;
+            boolean found = false;
+            if (list == null) {
+                new_ = true;
+                list = new ArrayList<Listener>();
+            } else {
+                for (Listener l : list) {
+                    if (l.getListener() == listener) {
+                        // TODO: Do we really want to add new properties to the
+                        // already registered listener or we want to replace the
+                        // old properties
+                        l.addProperties(propertyNames);
+                        found = true;
+                        break;
+                    }
+                }
+            }
+            if (new_ || !found) {
+                list.add(new Listener(listener, propertyNames));
+                register.put(notifier, list);
+            }
+        }
     }
 
     public void flushModelEvents() {
         // TODO Auto-generated method stub
-
     }
 
     public void removeClassModelEventListener(PropertyChangeListener listener,
             Object modelClass, String[] propertyNames) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void removeClassModelEventListener(PropertyChangeListener listener,
-            Object modelClass, String propertyName) {
-        // TODO Auto-generated method stub
-
+        if (!(modelClass instanceof Class && EObject.class
+                .isAssignableFrom((Class) modelClass))) {
+            throw new IllegalArgumentException();
+        }
+        unregisterListener(
+                modelClass, listener, propertyNames, registerForClasses);
     }
 
     public void removeModelEventListener(PropertyChangeListener listener,
             Object modelelement, String[] propertyNames) {
-        // TODO Auto-generated method stub
-
+        if (!(modelelement instanceof EObject)) {
+            throw new IllegalArgumentException();
+        }
+        unregisterListener(
+                modelelement, listener, propertyNames, registerForElements);
     }
 
     public void removeModelEventListener(PropertyChangeListener listener,
-            Object modelelement, String propertyName) {
-        // TODO Auto-generated method stub
-
+            Object modelelement) {
+        removeModelEventListener(listener, modelelement, (String []) null);
     }
 
-    public void removeModelEventListener(PropertyChangeListener listener,
-            Object modelelement) {
-        // TODO Auto-generated method stub
+    private void unregisterListener(Object notifier,
+            PropertyChangeListener listener, String[] propertyNames,
+            Map<Object, List<Listener>> register) {
+        if (notifier == null || listener == null) {
+            throw new NullPointerException();
+        }
+        synchronized (mutex) {
+            List<Listener> list = register.get(notifier);
+            if (list == null) {
+                return;
+            }
+            Iterator<Listener> iter = list.iterator();
+            while (iter.hasNext()) {
+                Listener l = iter.next();
+                if (l.getListener() == listener) {
+                    if (propertyNames != null) {
+                        l.removeProperties(propertyNames);
+                    } else {
+                        iter.remove();
+                    }
+                    break;
+                }
+            }
+        }
+    }
 
+    /**
+     * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(Notification)
+     * @param notification The notification event
+     */
+    @SuppressWarnings("unchecked")
+    public void notifyChanged(Notification notification) {
+        if (notification.getEventType() == Notification.REMOVING_ADAPTER) {
+            return;
+        }
+        Object source = null;
+        switch (notification.getEventType()) {
+        case Notification.REMOVE:
+            source = notification.getOldValue();
+            break;
+        default:
+            source = notification.getNotifier();
+        }
+
+        List<Listener> listeners = new ArrayList<Listener>();
+        synchronized (mutex) {
+            List<Listener> list = registerForElements.get(source);
+            if (list != null) {
+                for (Listener l : list) {
+                    listeners.add(l);
+                }
+            }
+
+            boolean logged = false;
+            for (Object o : registerForClasses.keySet()) {
+                if (o instanceof Class) {
+                    Class type = (Class) o;
+                    if (type.isAssignableFrom(source.getClass())) {
+                        if (!logged) {
+                            LOG.debug("eUML is firing " + notification); //$NON-NLS-1$
+                            logged = true;
+                        }
+                        for (Listener l : registerForClasses.get(o)) {
+                            listeners.add(l);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (Listener l : listeners) {
+            fireNotification(notification, l);
+        }
+    }
+
+    private void fireNotification(Notification n, Listener l) {
+        PropertyChangeEvent event = null;
+        switch (n.getEventType()) {
+        case Notification.REMOVE:
+            event = new DeleteInstanceEvent(
+                    n.getOldValue(), "remove", null, null, null); //$NON-NLS-1$
+            l.getListener().propertyChange(event);
+            removeModelEventListener(l.getListener(), n.getOldValue());
+            break;
+        case Notification.SET:
+            if (n.getFeature() instanceof EAttribute) {
+                event = new AttributeChangeEvent(
+                        n.getNotifier(),
+                        ((EAttribute) n.getFeature()).getName(),
+                        n.getOldValue(), n.getNewValue(), null);
+                l.getListener().propertyChange(event);
+            }
+            break;
+        case Notification.ADD:
+//            event = new AddAssociationEvent(
+//                    n.getNewValue(), "end", null, n.getNotifier(),
+//                    n.getNotifier(), null);
+//            l.getListener().propertyChange(event);
+//            event = new AddAssociationEvent(
+//                    n.getNotifier(), "reverse-end", null, n.getNewValue(),
+//                    n.getNewValue(), null);
+//            l.getListener().propertyChange(event);
+            break;
+        default:
+            LOG.debug("Uncought notification: " + n); //$NON-NLS-1$
+        }
     }
 
     public void startPumpingEvents() {
-        // TODO Auto-generated method stub
-
+        rootContainerAdapter.setDeliverEvents(true);
     }
 
     public void stopPumpingEvents() {
-        // TODO Auto-generated method stub
-
+        rootContainerAdapter.setDeliverEvents(false);
     }
 
 }

Modified: trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/ModelManagementFactoryEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -29,6 +29,9 @@
 import org.argouml.model.AbstractModelFactory;
 import org.argouml.model.ModelManagementFactory;
 import org.argouml.model.NotImplementedException;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.EditingDomain;
 import org.eclipse.uml2.uml.ElementImport;
 import org.eclipse.uml2.uml.Model;
 import org.eclipse.uml2.uml.Namespace;
@@ -47,7 +50,11 @@
      */
     private EUMLModelImplementation modelImpl;
     
-    private Model theRootModel;
+    private EditingDomain editingDomain;
+    
+    private org.eclipse.uml2.uml.Package theRootModel;
+    
+    private UMLFactory uml = UMLFactory.eINSTANCE;
 
     /**
      * Constructor.
@@ -58,16 +65,17 @@
     public ModelManagementFactoryEUMLImpl(
             EUMLModelImplementation implementation) {
         modelImpl = implementation;
+        editingDomain = implementation.getEditingDomain();
     }
 
-    public Object buildElementImport(Object pack, Object me) {
+    public ElementImport buildElementImport(Object pack, Object me) {
         ElementImport imp = (ElementImport) createElementImport();
         imp.setImportingNamespace((Namespace) pack);
         imp.setImportedElement((PackageableElement) me);
         return imp;
     }
 
-    public Object buildPackage(String name, String uuid) {
+    public org.eclipse.uml2.uml.Package buildPackage(String name, String uuid) {
         org.eclipse.uml2.uml.Package pkg =
                 (org.eclipse.uml2.uml.Package) createPackage();
         pkg.setName(name);
@@ -80,37 +88,47 @@
         return null;
     }
 
-    public Object createElementImport() {
-        return UMLFactory.eINSTANCE.createElementImport();
+    public ElementImport createElementImport() {
+        return uml.createElementImport();
     }
 
-    public Object createModel() {
-        return UMLFactory.eINSTANCE.createModel();
+    public Model createModel() {
+        return uml.createModel();
     }
 
-    public Object createPackage() {
-        return UMLFactory.eINSTANCE.createPackage();
+    public org.eclipse.uml2.uml.Package createPackage() {
+        return uml.createPackage();
     }
 
+    @Deprecated
     public Object createSubsystem() {
-        // TODO: Removed from UML 2?
+        // Removed from UML 2
         throw new NotImplementedException();
     }
 
     // TODO: get/setRootModel aren't specific to the Model implementation
     // they could probably be moved elsewhere - tfm - 20070530
     public void setRootModel(Object rootModel) {
-        if (rootModel != null && !(rootModel instanceof Model)) {
+        if (rootModel != null 
+                && !(rootModel instanceof org.eclipse.uml2.uml.Package)) {
             throw new IllegalArgumentException(
-                    "The rootModel supplied must be a Model. Got a "
-                            + rootModel.getClass().getName());
+                    "The rootModel supplied must be a Package. Got a "
+                    + rootModel.getClass().getName());
         }
-        theRootModel = (Model) rootModel;
+	if (theRootModel != null && theRootModel.eResource() != null) {
+	    EcoreUtil.remove(theRootModel);
+	}
+        theRootModel = (org.eclipse.uml2.uml.Package) rootModel;
+	if (rootModel != null) {
+            Resource r = editingDomain.createResource(
+                    "http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
+            r.getContents().add(theRootModel);
+	}
+        modelImpl.getModelEventPump().setRootContainer(theRootModel);
     }
 
-    public Object getRootModel() {
+    public org.eclipse.uml2.uml.Package getRootModel() {
         return theRootModel;
     }
 
-
 }

Added: trunk/src/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java?view=auto&rev=13127
==============================================================================
--- (empty file)
+++ trunk/src/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java	2007-07-23 22:30:24-0700
@@ -0,0 +1,119 @@
+// $Id$
+// Copyright (c) 2007, The ArgoUML Project
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above copyright
+//       notice, this list of conditions and the following disclaimer in the
+//       documentation and/or other materials provided with the distribution.
+//     * Neither the name of the ArgoUML Project nor the
+//       names of its contributors may be used to endorse or promote products
+//       derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE ArgoUML PROJECT ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE ArgoUML PROJECT BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package org.argouml.model.euml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+
+/**
+ * Maintains a list of notifiers descendants of the root container that are
+ * firing events to this adapter.
+ * 
+ * @author Bogdan Pistol
+ */
+public class RootContainerAdapter extends EContentAdapter {
+
+    private List<Notifier> notifiers = new ArrayList<Notifier>();
+    
+    private Notifier rootContainer;
+    
+    private ModelEventPumpEUMLImpl pump;
+    
+    private boolean deliverEvents = true;
+    
+    /**
+     * Constructor
+     * @param pump The ModelEventPump instance
+     */
+    public RootContainerAdapter(ModelEventPumpEUMLImpl pump) {
+        super();
+        this.pump = pump;
+    }
+    
+    /**
+     * Stop or start the firing of events.
+     * @param value True for delivering events, false otherwise
+     */
+    public void setDeliverEvents(boolean value) {
+        deliverEvents = value;
+    }
+    
+    /**
+     * Setter for the root container
+     * @param n the new root container
+     */
+    public void setRootContainer(Notifier n) {
+        if (n == rootContainer) {
+            return;
+        }
+
+        removeAllAdapters();
+        if (n != null) {
+            rootContainer = n;
+            rootContainer.eAdapters().add(this);
+        }
+    }
+
+    @Override
+    protected void addAdapter(Notifier notifier) {
+        notifiers.add(notifier);
+        super.addAdapter(notifier);
+    }
+
+    @Override
+    protected void removeAdapter(Notifier notifier) {
+        notifiers.remove(notifier);
+        super.removeAdapter(notifier);
+    }
+
+    /**
+     * Removes this listener from all the notifiers' eAdapters list.
+     */
+    public void removeAllAdapters() {
+        for (Notifier n : notifiers) {
+            super.removeAdapter(n);
+        }
+        if (rootContainer != null) {
+            super.removeAdapter(rootContainer);
+            rootContainer = null;
+        }
+        notifiers.clear();
+    }
+
+    @Override
+    public void notifyChanged(Notification notification) {
+        super.notifyChanged(notification);
+        if (deliverEvents) {
+            pump.notifyChanged(notification);
+        }
+    }
+
+}

Added: trunk/src/model-euml/src/org/argouml/model/euml/RunnableClass.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/RunnableClass.java?view=auto&rev=13127
==============================================================================
--- (empty file)
+++ trunk/src/model-euml/src/org/argouml/model/euml/RunnableClass.java	2007-07-23 22:30:24-0700
@@ -0,0 +1,48 @@
+// $Id$
+// Copyright (c) 2007, The ArgoUML Project
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above copyright
+//       notice, this list of conditions and the following disclaimer in the
+//       documentation and/or other materials provided with the distribution.
+//     * Neither the name of the ArgoUML Project nor the
+//       names of its contributors may be used to endorse or promote products
+//       derived from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE ArgoUML PROJECT ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE ArgoUML PROJECT BE LIABLE FOR ANY
+// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package org.argouml.model.euml;
+
+import java.util.ArrayList;
+
+/**
+ * This is a utility class useful in conjunction with 
+ * {@link org.eclipse.uml2.common.edit.command.ChangeCommand ChangeCommand}
+ * 
+ * @author Bogdan Pistol
+ */
+public abstract class RunnableClass implements Runnable {
+    
+    /**
+     * A list of parameters useful for extraction/insertion of parameters
+     * into a Runnable instance.
+     */
+    private ArrayList<Object> params = new ArrayList<Object>();
+
+    public ArrayList<Object> getParams() {
+        return params;
+    }
+}

Modified: trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/XmiReaderEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -26,10 +26,7 @@
 
 package org.argouml.model.euml;
 
-import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
@@ -37,15 +34,8 @@
 import org.apache.log4j.Logger;
 import org.argouml.model.UmlException;
 import org.argouml.model.XmiReader;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EcorePackage;
 import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.URIConverter;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.resource.UMLResource;
+import org.eclipse.emf.edit.domain.EditingDomain;
 import org.xml.sax.InputSource;
 
 /**
@@ -53,18 +43,14 @@
  */
 class XmiReaderEUMLImpl implements XmiReader {
 
-    private static Logger LOG = Logger.getLogger(XmiReaderEUMLImpl.class);
-    
-    // TODO: This shouldn't really be hardcoded - tfm
-    private final static String ENCODING = "UTF-8";
-    
+    private static final Logger LOG = 
+        Logger.getLogger(XmiReaderEUMLImpl.class);
+        
     /**
      * The model implementation.
      */
     private EUMLModelImplementation modelImpl;
 
-    private ResourceSet resourceSet;
-
     /**
      * Constructor.
      * 
@@ -73,40 +59,6 @@
      */
     public XmiReaderEUMLImpl(EUMLModelImplementation implementation) {
         modelImpl = implementation;
-
-        resourceSet = new ResourceSetImpl();
-        
-        // TODO: We need both complete paths and version independence here
-        // We probably need sometype of run-time lookup scheme
-        // This code is from 
-        // http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2.0_Migration_Guide/guide.html
-        URI umlPluginURI = URI.createURI("jar:file:/" 
-                + "org.eclipse.uml2.uml_2.1.0.v200703011358.jar" 
-                + "!/");
-        URI umlResourcesPluginURI = URI.createURI("jar:file:/" 
-                + "org.eclipse.uml2.uml.resources_2.1.0.v200705251139.jar"
-                + "!/");
-
-        // register the necessary pathmaps
-        Map uriMap = URIConverter.URI_MAP;
-        uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
-                umlResourcesPluginURI.appendSegment("libraries").appendSegment(""));
-        uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
-                umlResourcesPluginURI.appendSegment("metamodels").appendSegment(""));
-        uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
-                umlResourcesPluginURI.appendSegment("profiles").appendSegment(""));
-
-
-        // for a stand alone application, it is necessary to map the
-        // platform plugin URI scheme to the workspace location
-        uriMap.put(URI.createURI("platform:/plugin/org.eclipse.uml2.uml/"), 
-                umlPluginURI);
-
-        // Add namespace URIs for eCore and eUML2 to package registry
-        Map packageRegistry = resourceSet.getPackageRegistry();
-        packageRegistry.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
-        packageRegistry.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
-
     }
 
     public int getIgnoredElementCount() {
@@ -129,20 +81,22 @@
     }
 
     public Collection parse(InputSource inputSource, boolean profile)
-    throws UmlException {
+            throws UmlException {
+        EditingDomain editingDomain = modelImpl.getEditingDomain();
+        for (Resource resource 
+                : editingDomain.getResourceSet().getResources()) {
+            resource.unload();
+        }
 
-        // TODO:  This is a hack.  Look for alternatives, possibly reworking API
-        File inputFile;
+	Resource r = editingDomain.createResource(
+	        "http://argouml.tigris.org/euml/resource/default_uri.xmi"); //$NON-NLS-1$
         try {
-            inputFile = copySource(inputSource);
+            r.load(inputSource.getByteStream(), null);
         } catch (IOException e) {
-            throw new UmlException("Error creating temporary file", e);
+            throw new UmlException(e);
         }
-        
-        Resource resource = resourceSet.getResource(URI.createFileURI(inputFile.toString()), true);
-        EcoreUtil.resolveAll(resource);
 
-        return resource.getContents();
+        return r.getContents();
     }
 
     public boolean setIgnoredElements(String[] elementNames) {
@@ -150,30 +104,10 @@
         return false;
     }
 
-    private File copySource(InputSource input) throws IOException {
-        byte[] buf = new byte[2048];
-        int len;
-
-        // Create & set up temporary output file
-        File tmpOutFile = File.createTempFile("zargo_model_", ".xmi");
-        tmpOutFile.deleteOnExit();
-        FileOutputStream out = new FileOutputStream(tmpOutFile);
-        
-        // Add our XML declaration back to the front of the file
-//        String decl = "<?xml version=\"1.0\" encoding=\"" 
-//            + ENCODING + "\"?>\n";
-//        out.write(decl.getBytes(ENCODING), 0, decl.length());
-
-        InputStream in = input.getByteStream();
-        while ((len = in.read(buf)) > 0) {
-            out.write(buf, 0, len);
-        }
-
-        LOG.debug("Wrote copied XMI file to " + tmpOutFile);
-        return tmpOutFile;
-    }
-
     public String getTagName() {
-        return "uml:Model";
+        // This is not quite right
+        // TODO: Solve this
+        return "uml:Model"; //$NON-NLS-1$
     }
+    
 }

Modified: trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java?view=diff&rev=13127&p1=trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&p2=trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java&r1=13126&r2=13127
==============================================================================
--- trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	(original)
+++ trunk/src/model-euml/src/org/argouml/model/euml/XmiWriterEUMLImpl.java	2007-07-23 22:30:24-0700
@@ -36,11 +36,7 @@
 import org.argouml.model.UmlException;
 import org.argouml.model.XmiExtensionWriter;
 import org.argouml.model.XmiWriter;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.emf.ecore.xmi.XMLResource;
 
 /**
@@ -84,7 +80,6 @@
      */
     public XmiWriterEUMLImpl(EUMLModelImplementation implementation,
             Object theModel, OutputStream stream, String version) {
-        modelImpl = implementation;
         if (stream == null) {
             throw new IllegalArgumentException("An OutputStream must be provided");
         }
@@ -101,12 +96,9 @@
     }
 
     public void write() throws UmlException {
-        // This URI is a dummy.  We're going to write to our OutputStream
-        Resource resource =
-                new ResourceSetImpl().createResource(URI
-                        .createFileURI("foo.xmi"));
-        EList<EObject> contents = resource.getContents();
-        contents.add(model);
+	if (model.eResource() == null) {
+	    throw new UmlException("Root container is not affiliated with any resource!"); //$NON-NLS-1$
+	}
 
         // Do we need to get stereotype applications for each element? - tfm
 //        for (Iterator allContents = UMLUtil.getAllContents(model, true,
@@ -116,14 +108,13 @@
 //                contents.addAll(((Element) eObject).getStereotypeApplications());
 //            }
 //        }
-
         Map options = new HashMap();
         options.put(XMLResource.OPTION_LINE_WIDTH, 100);
         
         // TODO: Is there an option we can use to save our ArgoUML version?
         
         try {
-            resource.save(oStream, options);
+            model.eResource().save(oStream, options);
         } catch (IOException ioe) {
             throw new UmlException(ioe);
         }
@@ -134,5 +125,4 @@
         throw new NotYetImplementedException();
     }
 
-    
 }
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.