diff options
211 files changed, 0 insertions, 51726 deletions
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.classpath b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.classpath deleted file mode 100644 index 309f48b473b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.classpath +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <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="src" path="src"/> - <classpathentry kind="src" path="custom-src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.project b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.project deleted file mode 100644 index 9be7fb4d2c4..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>org.eclipse.papyrus.diagram.sequence</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.core.prefs b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 442aaecc411..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,265 +0,0 @@ -#Thu May 14 15:07:50 CEST 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=1
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=1
-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=200
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=200
-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=tab
-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
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.ui.prefs b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index d560afd00ed..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Thu Aug 28 09:50:28 CEST 2008 -eclipse.preferences.version=1 -formatter_profile=_Papyrus Formatter Profile -formatter_settings_version=11 -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\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">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\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">/**\n * \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">/**\n * @author ${user}\n * ${tags}\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">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\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">/**\n * {@inheritDoc}\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">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\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">\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">\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">\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">\n</template><template autoinsert\="true" 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\n${exception_var}.printStackTrace();</template><template autoinsert\="true" 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\n${body_statement}</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}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/META-INF/MANIFEST.MF b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/META-INF/MANIFEST.MF deleted file mode 100644 index 62f3477dd09..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Localization: plugin -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.papyrus.diagram.sequence;singleton:=true -Bundle-Version: 0.7.0.vqualifier -Bundle-Activator: org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin -Bundle-Vendor: %providerName -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.ui.views, - org.eclipse.ocl.ecore, - org.eclipse.papyrus.core.adaptor.gmf;bundle-version="0.7.0", - org.eclipse.ui.navigator;bundle-version="3.3.100", - org.eclipse.ui.navigator.resources;bundle-version="3.3.100", - org.eclipse.core.expressions;bundle-version="3.4.0", - org.eclipse.papyrus.diagram.common;bundle-version="0.7.0", - org.eclipse.gmf.runtime.diagram.ui.printing;bundle-version="1.1.2", - org.eclipse.gmf.runtime.diagram.ui.printing.render;bundle-version="1.1.2" -Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.papyrus.diagram.sequence, - org.eclipse.papyrus.diagram.sequence.part -Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/about.html b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/about.html deleted file mode 100644 index 209103075a7..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/about.html +++ /dev/null @@ -1,28 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>November 14, 2008</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, "Program" will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party ("Redistributor") and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
\ No newline at end of file diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/build.properties b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/build.properties deleted file mode 100644 index 092434dbda0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/build.properties +++ /dev/null @@ -1,18 +0,0 @@ -source.. = src/,\ - custom-src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/,\ - plugin.properties,\ - messages.properties,\ - about.html -src.includes = about.html,\ - .classpath,\ - custom-src/,\ - icons/,\ - src/,\ - plugin.xml,\ - plugin.properties,\ - messages.properties diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCoveredCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCoveredCommand.java deleted file mode 100644 index 6c0f0cc9ff3..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCoveredCommand.java +++ /dev/null @@ -1,182 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.uml2.uml.CombinedFragment; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; - -public class CombinedFragmentCoveredCommand extends Command { - - private org.eclipse.emf.common.command.Command command; - private List<org.eclipse.emf.common.command.Command> commandList; - - private CombinedFragmentEditPart combinedFragmentEP; - private ViewAndElementDescriptor viewAndElementDescriptor; - private EditPartViewer editPartViewer; - - // Common - private void init() { - commandList = new ArrayList<org.eclipse.emf.common.command.Command>(); - combinedFragmentEP = null; - viewAndElementDescriptor = null; - editPartViewer = null; - } - - // New creation - public CombinedFragmentCoveredCommand(EditPartViewer epViewer, - ViewAndElementDescriptor viewAndElemDes) { - init(); - editPartViewer = epViewer; - viewAndElementDescriptor = viewAndElemDes; - } - - // Resizing - public CombinedFragmentCoveredCommand(CombinedFragmentEditPart cfEP) { - init(); - combinedFragmentEP = cfEP; - editPartViewer = cfEP.getViewer(); - } - - @Override - public boolean canExecute() { - // Resize of a existing CombinedFragment - if (combinedFragmentEP != null) - return true; - // Creation of a new CombinedFragment - if (editPartViewer != null - && viewAndElementDescriptor != null - && viewAndElementDescriptor.getSemanticHint().compareTo( - Integer.toString(CombinedFragmentEditPart.VISUAL_ID)) == 0) - return true; - - // Null or not correct parameters - return false; - } - - @Override - public void execute() { - super.execute(); - - if (combinedFragmentEP == null) { - Node cfNode = (Node) viewAndElementDescriptor - .getAdapter(Node.class); - - combinedFragmentEP = (CombinedFragmentEditPart) editPartViewer - .getEditPartRegistry().get(cfNode); - } - - // Feature to make updates - EReference feature = UMLPackage.eINSTANCE - .getInteractionFragment_Covered(); - - // Semantic element - CombinedFragment combinedFragment = (CombinedFragment) combinedFragmentEP - .resolveSemanticElement(); - - // Refresh figure - combinedFragmentEP.getFigure().getUpdateManager().performUpdate(); - - // Get Lifelines covered by the CombinedFragment figure - EList<Lifeline> coveredList = getCoveredList(combinedFragmentEP - .getParent(), combinedFragmentEP.getFigure().getBounds()); - - // Remove current elements - EList<Lifeline> removeList = new BasicEList<Lifeline>(combinedFragment - .getCovereds()); - commandList.add(RemoveCommand.create(getEditingDomain(), - combinedFragment, feature, removeList)); - - // Add new elements - commandList.add(AddCommand.create(getEditingDomain(), combinedFragment, - feature, coveredList)); - - // Execute commands - for (org.eclipse.emf.common.command.Command cmd : commandList) { - getEditingDomain().getCommandStack().execute(cmd); - } - - } - - public TransactionalEditingDomain getEditingDomain() { - if (combinedFragmentEP != null) - return combinedFragmentEP.getEditingDomain(); - else - return null; - } - - // It is not necessary for RectB to cover completely RectA. With a simple - // intersection is enough. - static public boolean isRectACoverdByRectB(Rectangle rectA, Rectangle rectB) { - return rectB.intersects(rectA); - } - - public EList<Lifeline> getCoveredList(EditPart containerEP, - Rectangle newBounds) { - EList<Lifeline> coveredList = new BasicEList<Lifeline>(); - for (Object obj : containerEP.getChildren()) { - if (obj instanceof LifelineEditPart) { - LifelineEditPart lifelineEP = (LifelineEditPart) obj; - - // Update figure - lifelineEP.getFigure().getUpdateManager().performUpdate(); - - // Case the Lifeline is covered by the - // CombinedFragment - if (isRectACoverdByRectB(lifelineEP.getFigure().getBounds(), - newBounds)) { - coveredList.add((Lifeline) lifelineEP - .resolveSemanticElement()); - } - } - } - return coveredList; - } - - @Override - public void undo() { - for (int i = commandList.size() - 1; i >= 0; i--) { - if (getEditingDomain().getCommandStack().getUndoCommand() == commandList - .get(i)) { - getEditingDomain().getCommandStack().undo(); - } - } - } - - @Override - public void redo() { - for (int i = 0; i < commandList.size(); i++) { - if (getEditingDomain().getCommandStack().getRedoCommand() == commandList - .get(i)) { - getEditingDomain().getCommandStack().redo(); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CreateLifelineAndBESCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CreateLifelineAndBESCommand.java deleted file mode 100644 index e5a71f098d0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/CreateLifelineAndBESCommand.java +++ /dev/null @@ -1,88 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz - Expanded functionality - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -public class CreateLifelineAndBESCommand extends AbstractTransactionalCommand { - - private ViewDescriptor viewDescriptor = null; - - private EditPartViewer viewer = null; - - public CreateLifelineAndBESCommand(TransactionalEditingDomain domain, - ViewDescriptor descriptor, EditPartViewer viewer) { - super(domain, "Create Lifeline and BES", null); - viewDescriptor = descriptor; - this.viewer = viewer; - } - - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - - View view = (View) viewDescriptor.getAdapter(View.class); - if (view == null) { - return CommandResult - .newErrorCommandResult("Lifeline view not created"); - } - - Command command = getBESCreateCommand(view); - if (command != null) { - command.execute(); - } - - return CommandResult.newOKCommandResult(); - } - - @Override - public boolean canExecute() { - return viewDescriptor != null && viewer != null; - } - - private Command getBESCreateCommand(View view) { - IGraphicalEditPart newLifelineEditPart = (IGraphicalEditPart) viewer - .getEditPartRegistry().get(view); - newLifelineEditPart.getFigure().getUpdateManager().performUpdate(); - - CreateElementRequest elementRequest = new CreateElementRequest( - UMLElementTypes.BehaviorExecutionSpecification_2003); - CreateElementRequestAdapter requestAdatper = new CreateElementRequestAdapter( - elementRequest); - ViewAndElementDescriptor descriptor = new ViewAndElementDescriptor( - requestAdatper, Node.class, "2003", - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - - CreateViewAndElementRequest request = new CreateViewAndElementRequest( - descriptor); - - Command command = newLifelineEditPart.getCommand(request); - return command; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/InitializeInteractionViewCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/InitializeInteractionViewCommand.java deleted file mode 100644 index a597931be60..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/InitializeInteractionViewCommand.java +++ /dev/null @@ -1,103 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz - Initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; - -import org.eclipse.papyrus.diagram.sequence.util.DiagramInitializationUtil; -import org.eclipse.papyrus.diagram.sequence.util.InteractionViewInitializationUtil; -import org.eclipse.papyrus.diagram.sequence.util.InteractionViewInitializationUtil.NodeInitDataFigure; - -/** - * Creates the views of an <Interaction>, its <Lifeline>s, - * <BehaviorExecutionSpecification>s and <Message>s. - * - * @author fjcano - * - */ -public class InitializeInteractionViewCommand extends - AbstractTransactionalCommand { - - IGraphicalEditPart parentEditPart = null; - - Interaction interaction = null; - - Point offset = null; - - public InitializeInteractionViewCommand(TransactionalEditingDomain domain, - String label, List affectedFiles) { - super(domain, label, affectedFiles); - } - - public IGraphicalEditPart getParentEditPart() { - return parentEditPart; - } - - public Interaction getInteraction() { - return interaction; - } - - public Point getOffset() { - return offset != null ? offset : new Point(0, 0); - } - - public void setParentEditPart(IGraphicalEditPart parentEditPart) { - this.parentEditPart = parentEditPart; - } - - public void setInteraction(Interaction interaction) { - this.interaction = interaction; - } - - public void setOffset(Point offset) { - this.offset = offset.getCopy(); - } - - @Override - public boolean canExecute() { - boolean canExecute = getInteraction() != null - && getParentEditPart() != null && getEditingDomain() != null; - return canExecute; - } - - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (getInteraction() != null || getParentEditPart() != null - && getEditingDomain() != null) { - List<List<Message>> orderedMessages = DiagramInitializationUtil - .getGlobalMsgOrdering(getInteraction()); - if (orderedMessages != null && orderedMessages.size() >= 0) { - NodeInitDataFigure interactionData = InteractionViewInitializationUtil - .calculateInteractionInitData(interaction, - orderedMessages, getOffset()); - if (interactionData != null) { - InteractionViewInitializationUtil.createViews( - getParentEditPart(), interactionData); - return CommandResult.newOKCommandResult(); - } - } - } - return CommandResult - .newErrorCommandResult("Unable to initialize Interaction Views."); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageOrderCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageOrderCommand.java deleted file mode 100644 index 3e9d1188dcd..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageOrderCommand.java +++ /dev/null @@ -1,829 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -import org.eclipse.emf.edit.command.SetCommand; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.ConnectionEditPart; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest.ConnectionViewAndElementDescriptor; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.GeneralOrdering; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.OccurrenceSpecification; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -public class MessageOrderCommand extends Command { - - // To store the command List - // Put the command - private List<org.eclipse.emf.common.command.Command> commandList = new ArrayList<org.eclipse.emf.common.command.Command>(); - - private ShapeNodeEditPart sourceEditPart = null; - private ShapeNodeEditPart targetEditPart = null; - - private ConnectionViewAndElementDescriptor connectionViewElemDes = null; - - private DestroyElementRequest destroyRequest = null; - private CreateConnectionViewAndElementRequest createRequest = null; - private ReconnectRequest reconnectRequest = null; - - // Only for movement of a BES EditPart - private BehaviorExecutionSpecificationEditPart besEditPart = null; - - private TransactionalEditingDomain transactionalEditingDomain; - - // New message creation - public MessageOrderCommand(CreateConnectionViewAndElementRequest req) { - - createRequest = req; - - connectionViewElemDes = createRequest - .getConnectionViewAndElementDescriptor(); - - sourceEditPart = (ShapeNodeEditPart) createRequest.getSourceEditPart(); - targetEditPart = (ShapeNodeEditPart) createRequest.getTargetEditPart(); - - transactionalEditingDomain = sourceEditPart.getEditingDomain(); - } - - // Re-orientation/Re-anchoring of one end of the message - public MessageOrderCommand(ReconnectRequest req) { - - reconnectRequest = req; - - // Used below as old source EditPart - sourceEditPart = (ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getSource(); - // Used below as old target EditPart - targetEditPart = (ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getTarget(); - - // Note: Since the reconnect command has still not been executed, the - // connection EditPart still stores the old Source/Target EditPart. That - // is the reason why it is not necessary to provide to the constructor - // these values. - - transactionalEditingDomain = sourceEditPart.getEditingDomain(); - } - - // Destruction of a Message. A re-ordering of the ends must be done - public MessageOrderCommand(DestroyElementRequest req) { - destroyRequest = req; - - sourceEditPart = null; - targetEditPart = null; - - transactionalEditingDomain = destroyRequest.getEditingDomain(); - } - - // Movement of a Behavior Execution Specification. A re-ordering of its - // Start and Finish Message Occurrence Specifications should be done. - public MessageOrderCommand(BehaviorExecutionSpecificationEditPart besEP) { - besEditPart = besEP; - transactionalEditingDomain = besEP.getEditingDomain(); - } - - @Override - public boolean canExecute() { - // TODO: Can execute should not return true in all cases - return true; - } - - @Override - public void execute() { - super.execute(); - - if (besEditPart != null) { - - // Get the BES - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) besEditPart - .resolveSemanticElement(); - - // If the BES has no Start/Finish values, nothing should be done - // Note that if one value is null the other value should be null as - // well. If not, the model is incorrect. - if (bes.getStart() == null || bes.getFinish() == null) - return; - - // Get the oldBefore MOS of Start MOS - OccurrenceSpecification oldBefore = null; - if (bes.getStart() != null - && bes.getStart().getGeneralOrderings().size() > 0) - oldBefore = bes.getStart().getGeneralOrderings().get(0) - .getBefore(); - - // Get the oldAfter MOS of Finish MOS - OccurrenceSpecification oldAfter = null; - if (bes.getFinish() != null - && bes.getFinish().getGeneralOrderings().size() > 0) - oldAfter = bes.getFinish().getGeneralOrderings().get(0) - .getAfter(); - - // Update BES figure - besEditPart.getFigure().getUpdateManager().performUpdate(); - - // Get the newBefore MOS of Start MOS - ConnectionNodeEditPart startConnEP = MessageCommonUtil - .getBESStartMessageEditPart(besEditPart); - Point pStartMOS = MessageCommonUtil.getMessageEndIntersectionPoint( - besEditPart, startConnEP, bes.getStart()); - OccurrenceSpecification newBefore = getMOSBeforePos( - (LifelineEditPart) besEditPart.getParent(), pStartMOS, - startConnEP); - // If newBefore == null, then newBefore = StartMOS - if (newBefore == null) - newBefore = bes.getStart(); - - // Get the newAfter MOS of Finish MOS - ConnectionNodeEditPart finishConnEP = MessageCommonUtil - .getBESFinishMessageEditPart(besEditPart); - Point pFinishMOS = MessageCommonUtil - .getMessageEndIntersectionPoint(besEditPart, finishConnEP, - bes.getFinish()); - OccurrenceSpecification newAfter = getMOSAfterPos( - (LifelineEditPart) besEditPart.getParent(), pFinishMOS, - finishConnEP); - // if newAfter== null, then newAfter = FinishMOS - if (newAfter == null) - newAfter = bes.getFinish(); - - // To make changes - EReference goAfterFeature = UMLPackage.eINSTANCE - .getGeneralOrdering_After(); - EReference goBeforeFeature = UMLPackage.eINSTANCE - .getGeneralOrdering_Before(); - - if (oldBefore != newBefore) { - // UPDATE oldBefore MOS - if (oldBefore != bes.getStart()) { - if (oldAfter == bes.getFinish()) - doSetCommand(oldBefore.getGeneralOrderings().get(0), - goAfterFeature, oldBefore); - else - doSetCommand(oldBefore.getGeneralOrderings().get(0), - goAfterFeature, oldAfter); - } - - // UPDATE newBefore MOS - if (newBefore != bes.getStart()) { - doSetCommand(newBefore.getGeneralOrderings().get(0), - goAfterFeature, bes.getStart()); - } - - // UPDATE Start MOS (from moving BES) - // Update the Before feature of Start MOS with newBefore - doSetCommand(bes.getStart().getGeneralOrderings().get(0), - goBeforeFeature, newBefore); - } - - if (oldAfter != newAfter) { - // UPDATE oldAfter MOS - if (oldAfter != bes.getFinish()) { - if (oldBefore == bes.getStart()) - doSetCommand(oldAfter.getGeneralOrderings().get(0), - goBeforeFeature, oldAfter); - else - doSetCommand(oldAfter.getGeneralOrderings().get(0), - goBeforeFeature, oldBefore); - } - - // UPDATE newAfter MOS - if (newAfter != bes.getFinish()) { - doSetCommand(newAfter.getGeneralOrderings().get(0), - goBeforeFeature, bes.getFinish()); - } - - // UPDATE Finish MOS (from moving BES) - // Update the After feature of Finish MOS with newAfter - doSetCommand(bes.getFinish().getGeneralOrderings().get(0), - goAfterFeature, newAfter); - } - - } - // Creation of a new message - else if (createRequest != null) { - - View newMsgView = (View) connectionViewElemDes - .getAdapter(View.class); - ConnectionEditPart newMsgEditPart = (ConnectionEditPart) sourceEditPart - .getViewer().getEditPartRegistry().get(newMsgView); - - // Needed to update the points of the connection figure - newMsgEditPart.getFigure().getUpdateManager().performUpdate(); - - orderLifelinesAddMessage(newMsgEditPart); - - } - // Destruction of a message - else if (destroyRequest != null) { - if (destroyRequest.getElementToDestroy() instanceof Message) { - orderLifelinesDelMessage(); - } - } - // Re-orientation/Re-anchoring of a existing message - else if (reconnectRequest != null) { - - Element endElement; - ShapeNodeEditPart endElementEditPart; - - Message msgElement; - ConnectionEditPart msgElementEditPart; - - MessageOccurrenceSpecification endMOS; - - // Message - msgElementEditPart = reconnectRequest.getConnectionEditPart(); - msgElement = (Message) ((ConnectionNodeEditPart) msgElementEditPart) - .resolveSemanticElement(); - - // Old Source End - if (reconnectRequest.isMovingStartAnchor()) { - endElement = (Element) sourceEditPart.resolveSemanticElement(); - endMOS = (MessageOccurrenceSpecification) msgElement - .getSendEvent(); - } - // Old Target End - else { - endElement = (Element) targetEditPart.resolveSemanticElement(); - endMOS = (MessageOccurrenceSpecification) msgElement - .getReceiveEvent(); - } - - // Remove ordering from the old end - if (endElement instanceof BehaviorExecutionSpecification) { - orderBESDelMOS((BehaviorExecutionSpecification) endElement, - endMOS); - } - orderLifelineDelMOS(endMOS); - - // To make a copy of the GeneralOrdering list - BasicEList<GeneralOrdering> goList = new BasicEList<GeneralOrdering>(); - goList.addAll(endMOS.getGeneralOrderings()); - for (Iterator<GeneralOrdering> i = goList.iterator(); i.hasNext();) { - GeneralOrdering go = i.next(); - i.remove(); - DestroyElementCommand.destroy(go); - } - - // Add the ordering to the new end - // New Source End - if (reconnectRequest.isMovingStartAnchor()) { - endElementEditPart = ((ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getSource()); - } - // New Target End - else { - endElementEditPart = ((ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getTarget()); - } - - orderLifelineAddMOS(msgElementEditPart, endElementEditPart); - - } - - } - - public void orderLifelinesAddMessage(ConnectionEditPart newMsgEditPart) { - orderLifelineAddMOS(newMsgEditPart, sourceEditPart); - orderLifelineAddMOS(newMsgEditPart, targetEditPart); - } - - public void orderLifelineAddMOS(ConnectionEditPart msgEditPart, - ShapeNodeEditPart elementEditPart) { - // Order the MOS in the Lifeline - - // Obtain the LifelineEditPart - LifelineEditPart lifelineEditPart; - if (elementEditPart instanceof BehaviorExecutionSpecificationEditPart) { - lifelineEditPart = (LifelineEditPart) elementEditPart.getParent(); - } else { - lifelineEditPart = (LifelineEditPart) elementEditPart; - } - - // Do the ordering - Message msg = (Message) ((ConnectionNodeEditPart) msgEditPart) - .resolveSemanticElement(); - MessageOccurrenceSpecification currentMOS; - Point currentPos; // Position of the currentMOS - - MessageOccurrenceSpecification beforeMOS = null; - MessageOccurrenceSpecification afterMOS = null; - - if (msgEditPart.getSource() == elementEditPart) { - currentMOS = (MessageOccurrenceSpecification) msg.getSendEvent(); - currentPos = elementEditPart.getSourceConnectionAnchor(msgEditPart) - .getReferencePoint(); - } else { - currentMOS = (MessageOccurrenceSpecification) msg.getReceiveEvent(); - currentPos = elementEditPart.getTargetConnectionAnchor(msgEditPart) - .getReferencePoint(); - } - - beforeMOS = getMOSBeforePos(lifelineEditPart, currentPos, msgEditPart); - afterMOS = getMOSAfterPos(lifelineEditPart, currentPos, msgEditPart); - - // 1.- order current MOS - GeneralOrdering currentGO = - createGeneralOrderingInMOS(currentMOS, beforeMOS, afterMOS); - - // Feature to make updates - EReference feature; - - // 2.- Update beforeMOS GeneralOrdering - if (beforeMOS != null && beforeMOS.getGeneralOrderings().size() > 0) { - feature = UMLPackage.eINSTANCE.getGeneralOrdering_After(); - doSetCommand(beforeMOS.getGeneralOrderings().get(0), feature, - currentMOS); - } - - // 3.- Update afterMOS GeneralOrdering - if (afterMOS != null && afterMOS.getGeneralOrderings().size() > 0) { - feature = UMLPackage.eINSTANCE.getGeneralOrdering_Before(); - doSetCommand(afterMOS.getGeneralOrderings().get(0), feature, - currentMOS); - } - - // In case the target was a BES, order the MOS in the BES - if (elementEditPart instanceof BehaviorExecutionSpecificationEditPart) { - orderBESAddMOS( - (BehaviorExecutionSpecificationEditPart) elementEditPart, - currentMOS); - } - } - - public MessageOccurrenceSpecification getMOSBeforePos( - LifelineEditPart lifelineEP, Point pos, ConnectionEditPart msgEP) { - return getMOSAfterOrBeforePos(lifelineEP, pos, msgEP, true); - } - - public MessageOccurrenceSpecification getMOSAfterPos( - LifelineEditPart lifelineEP, Point pos, ConnectionEditPart msgEP) { - return getMOSAfterOrBeforePos(lifelineEP, pos, msgEP, false); - } - - private MessageOccurrenceSpecification getMOSAfterOrBeforePos( - LifelineEditPart lifelineEP, Point pos, ConnectionEditPart msgEP, - boolean before) { - // return the MOS before or after the position indicated by pos - - List<EditPart> linksList = new BasicEList<EditPart>(); - - Point auxPos = null; - MessageOccurrenceSpecification auxMOS = null; - - Point returnPos = null; - MessageOccurrenceSpecification returnMOS = null; - - // Lifeline source connections (Remove itself) - linksList.clear(); - linksList.addAll(lifelineEP.getSourceConnections()); - // Remove current link - linksList.remove(msgEP); - // Remove links whose semantic element is different from Message - MessageCommonUtil.removeNonMessageConnections(linksList); - - for (Iterator i = linksList.iterator(); i.hasNext();) { - ConnectionEditPart currentLink = (ConnectionEditPart) i.next(); - - if (currentLink instanceof ConnectionNodeEditPart) { - auxPos = lifelineEP.getSourceConnectionAnchor(currentLink) - .getReferencePoint(); // intersection point - Message msg = (Message) ((ConnectionNodeEditPart) currentLink) - .resolveSemanticElement(); - auxMOS = (MessageOccurrenceSpecification) msg.getSendEvent(); // currentMOS - - if (before && auxPos.y <= pos.y) { - if (returnPos == null || auxPos.y >= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - if (!before && auxPos.y >= pos.y) { - if (returnPos == null || auxPos.y <= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - } - - } - - // Lifeline target connections - linksList.clear(); - linksList.addAll(lifelineEP.getTargetConnections()); - // Remove current link - linksList.remove(msgEP); - // Remove links whose semantic element is different from Message - MessageCommonUtil.removeNonMessageConnections(linksList); - - for (Iterator i = linksList.iterator(); i.hasNext();) { - ConnectionEditPart currentLink = (ConnectionEditPart) i.next(); - - if (currentLink instanceof ConnectionNodeEditPart) { - auxPos = lifelineEP.getTargetConnectionAnchor(currentLink) - .getReferencePoint(); // intersection point - Message msg = (Message) ((ConnectionNodeEditPart) currentLink) - .resolveSemanticElement(); - auxMOS = (MessageOccurrenceSpecification) msg.getReceiveEvent(); // currentMOS - - if (before && auxPos.y <= pos.y) { - if (returnPos == null || auxPos.y >= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - - if (!before && auxPos.y >= pos.y) { - if (returnPos == null || auxPos.y <= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - } - - } - - // BehaviorsExecutionSpecifications contained in the Lifeline - for (Iterator i = lifelineEP.getChildren().iterator(); i.hasNext();) { - Object next = i.next(); - if (next instanceof BehaviorExecutionSpecificationEditPart) { - BehaviorExecutionSpecificationEditPart besEP = (BehaviorExecutionSpecificationEditPart) next; - - // BehaviorExecutionSpecification source connections - linksList.clear(); - linksList.addAll(besEP.getSourceConnections()); - // Remove current link - linksList.remove(msgEP); - // Remove links whose semantic element is different from Message - MessageCommonUtil.removeNonMessageConnections(linksList); - - for (Iterator j = linksList.iterator(); j.hasNext();) { - ConnectionEditPart currentLink = (ConnectionEditPart) j - .next(); - - if (currentLink instanceof ConnectionNodeEditPart) { - auxPos = besEP.getSourceConnectionAnchor(currentLink) - .getReferencePoint(); // intersection point - Message msg = (Message) ((ConnectionNodeEditPart) currentLink) - .resolveSemanticElement(); - auxMOS = (MessageOccurrenceSpecification) msg - .getSendEvent(); // currentMOS - - if (before && auxPos.y <= pos.y) { - if (returnPos == null || auxPos.y >= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - - if (!before && auxPos.y >= pos.y) { - if (returnPos == null || auxPos.y <= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - } - - } - - // BehaviorExecutionSpecification target connections - linksList.clear(); - linksList.addAll(besEP.getTargetConnections()); - // Remove current link - linksList.remove(msgEP); - // Remove links whose semantic element is different from Message - MessageCommonUtil.removeNonMessageConnections(linksList); - - for (Iterator j = linksList.iterator(); j.hasNext();) { - ConnectionEditPart currentLink = (ConnectionEditPart) j - .next(); - - if (currentLink instanceof ConnectionNodeEditPart) { - auxPos = besEP.getTargetConnectionAnchor(currentLink) - .getReferencePoint(); // intersection point - Message msg = (Message) ((ConnectionNodeEditPart) currentLink) - .resolveSemanticElement(); - auxMOS = (MessageOccurrenceSpecification) msg - .getReceiveEvent(); // currentMOS - - if (before && auxPos.y <= pos.y) { - if (returnPos == null || auxPos.y >= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - - if (!before && auxPos.y >= pos.y) { - if (returnPos == null || auxPos.y <= returnPos.y) { - returnPos = auxPos; - returnMOS = auxMOS; - } - } - } - - } - - } // end if bes - } // end for bes - return returnMOS; - } - - public GeneralOrdering createGeneralOrderingInMOS( - MessageOccurrenceSpecification currentMOS, - MessageOccurrenceSpecification beforeMOS, - MessageOccurrenceSpecification afterMOS) { - GeneralOrdering currentGO = null; - // Not in a Transactional domain so we cannot use - // currentMOS.createGeneralOrdering("Name") - currentGO = UMLFactory.eINSTANCE.createGeneralOrdering(); - - // Assign Name - currentGO.setName(currentMOS.getName() + "_GO"); - - // Add the new generalOrdering to the MOS - EReference featureGO = UMLPackage.eINSTANCE - .getInteractionFragment_GeneralOrdering(); - doAddCommand(currentMOS, featureGO, currentGO); - - // features - EReference featureBefore = UMLPackage.eINSTANCE - .getGeneralOrdering_Before(); - EReference featureAfter = UMLPackage.eINSTANCE - .getGeneralOrdering_After(); - - // currentGO.setBefore(beforeMOS); - if (beforeMOS != null) { - doSetCommand(currentGO, featureBefore, beforeMOS); - } else { - doSetCommand(currentGO, featureBefore, currentMOS); - } - - // currentGO.setAfter(afterMOS); - if (afterMOS != null) { - doSetCommand(currentGO, featureAfter, afterMOS); - } else { - doSetCommand(currentGO, featureAfter, currentMOS); - } - - if (currentMOS.getGeneralOrderings().size() > 0) { - return currentMOS.getGeneralOrderings().get(0); - } else { - return null; - } - - } - - public void doSetCommand(Object owner, Object feature, Object value) { - EditingDomain editingDomain = getEditingDomain(); - org.eclipse.emf.common.command.Command cmd = SetCommand.create( - editingDomain, owner, feature, value); - commandList.add(cmd); - editingDomain.getCommandStack().execute(cmd); - } - - public void doAddCommand(Object owner, Object feature, Object value) { - EditingDomain editingDomain = getEditingDomain(); - org.eclipse.emf.common.command.Command cmd = AddCommand.create( - editingDomain, owner, feature, value); - commandList.add(cmd); - editingDomain.getCommandStack().execute(cmd); - } - - public void doRemoveCommand(Object owner, Object feature, Object value) { - EditingDomain editingDomain = getEditingDomain(); - org.eclipse.emf.common.command.Command cmd = RemoveCommand.create( - editingDomain, owner, feature, value); - commandList.add(cmd); - editingDomain.getCommandStack().execute(cmd); - } - - public TransactionalEditingDomain getEditingDomain() { - return transactionalEditingDomain; - } - - @Override - public void undo() { - for (int i = commandList.size() - 1; i >= 0; i--) { - if (getEditingDomain().getCommandStack().getUndoCommand() == commandList - .get(i)) { - getEditingDomain().getCommandStack().undo(); - } - } - } - - @Override - public void redo() { - for (int i = 0; i < commandList.size(); i++) { - if (getEditingDomain().getCommandStack().getRedoCommand() == commandList - .get(i)) { - getEditingDomain().getCommandStack().redo(); - } - } - } - - public void orderLifelinesDelMessage() { - Message msg = (Message) destroyRequest.getElementToDestroy(); - - // Obtain the elements to destroy - MessageOccurrenceSpecification msgSend = null; - MessageOccurrenceSpecification msgReceive = null; - - if (msg.getSendEvent() instanceof MessageOccurrenceSpecification) { - msgSend = (MessageOccurrenceSpecification) msg.getSendEvent(); - Element src = MessageCommonUtil.getMessageSrc(msg); - - // If source element is a BES, update BES.start && BES.finish - // attributes - if (src instanceof BehaviorExecutionSpecification) { - orderBESDelMOS((BehaviorExecutionSpecification) src, msgSend); - } - - // Reorder MOS's in its corresponding Lifeline - orderLifelineDelMOS(msgSend); - } - - if (msg.getReceiveEvent() instanceof MessageOccurrenceSpecification) { - msgReceive = (MessageOccurrenceSpecification) msg.getReceiveEvent(); - Element dst = MessageCommonUtil.getMessageDst(msg); - - // If target element is a BES, update BES.start && BES.finish - // attributes - if (dst instanceof BehaviorExecutionSpecification) { - orderBESDelMOS((BehaviorExecutionSpecification) dst, msgReceive); - } - - // Reorder MOS's in its corresponding Lifeline - orderLifelineDelMOS(msgReceive); - } - } - - public void orderLifelineDelMOS(MessageOccurrenceSpecification mos) { - - OccurrenceSpecification beforeOS = null; - OccurrenceSpecification afterOS = null; - - EReference beforeFeature = UMLPackage.eINSTANCE - .getGeneralOrdering_Before(); - EReference afterFeature = UMLPackage.eINSTANCE - .getGeneralOrdering_After(); - - if (mos.getGeneralOrderings().size() > 0) { - beforeOS = mos.getGeneralOrderings().get(0).getBefore(); - afterOS = mos.getGeneralOrderings().get(0).getAfter(); - } - - if (beforeOS != null && beforeOS != mos - && beforeOS.getGeneralOrderings().size() > 0) { - if (afterOS == mos) { - doSetCommand(beforeOS.getGeneralOrderings().get(0), - afterFeature, beforeOS); - } else { - doSetCommand(beforeOS.getGeneralOrderings().get(0), - afterFeature, afterOS); - } - } - - if (afterOS != null && afterOS != mos - && afterOS.getGeneralOrderings().size() > 0) { - if (beforeOS == mos) { - doSetCommand(afterOS.getGeneralOrderings().get(0), - beforeFeature, afterOS); - } else { - doSetCommand(afterOS.getGeneralOrderings().get(0), - beforeFeature, beforeOS); - } - } - - } - - public void orderBESDelMOS(BehaviorExecutionSpecification bes, - MessageOccurrenceSpecification mos) { - EReference featureStart = UMLPackage.eINSTANCE - .getExecutionSpecification_Start(); - EReference featureFinish = UMLPackage.eINSTANCE - .getExecutionSpecification_Finish(); - - // Do nothing. - if (mos != bes.getStart() && mos != bes.getFinish()) { - return; - } - - // Not really necessary because References are removed automatically - // when the element is deleted. - if (bes.getStart() == mos && bes.getFinish() == mos) { - doSetCommand(bes, featureStart, null); - doSetCommand(bes, featureFinish, null); - return; - } - - if (bes.getStart() == mos) { - if (mos.getGeneralOrderings().size() > 0) { - doSetCommand(bes, featureStart, mos.getGeneralOrderings() - .get(0).getAfter()); - } - - } else if (bes.getFinish() == mos) { - if (mos.getGeneralOrderings().size() > 0) { - doSetCommand(bes, featureFinish, mos.getGeneralOrderings().get( - 0).getBefore()); - } - - } - - } - - public void orderBESAddMOS( - BehaviorExecutionSpecificationEditPart besEditPart, - MessageOccurrenceSpecification currentMOS) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) besEditPart - .resolveSemanticElement(); - EReference featureStart, featureFinish; - featureStart = UMLPackage.eINSTANCE.getExecutionSpecification_Start(); - featureFinish = UMLPackage.eINSTANCE.getExecutionSpecification_Finish(); - - // Case is the first MOS on the BES - if (bes.getStart() == null && bes.getFinish() == null) { - doSetCommand(bes, featureStart, currentMOS); - doSetCommand(bes, featureFinish, currentMOS); - } - - if ((bes.getStart() != null)) { - // Check if currentMOS is before bes.startMOS - if (isOS1BeforeOS2(currentMOS, bes.getStart())) { - doSetCommand(bes, featureStart, currentMOS); - } - } - - if (bes.getFinish() != null) { - // Check if currentMOS is after bes.finishMOS - if (isOS1AfterOS2(currentMOS, bes.getFinish())) { - doSetCommand(bes, featureFinish, currentMOS); - } - } - } - - public static boolean isOS1BeforeOS2(OccurrenceSpecification os1, - OccurrenceSpecification os2) { - // Check if non of the input parameters is null - if (os1 == null || os2 == null) { - return false; - } - - if (os1.getGeneralOrderings().size() > 0) { - - if (os1.getGeneralOrderings().get(0).getAfter() == null - || os1 == os1.getGeneralOrderings().get(0).getAfter()) { - return false; - } - - if (os1.getGeneralOrderings().get(0).getAfter() == os2) { - return true; - } else { - return isOS1BeforeOS2(os1.getGeneralOrderings().get(0) - .getAfter(), os2); - } - - } else { - return false; - } - } - - public static boolean isOS1AfterOS2(OccurrenceSpecification os1, - OccurrenceSpecification os2) { - return isOS1BeforeOS2(os2, os1); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageTypeLinkCreateCommandCommon.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageTypeLinkCreateCommandCommon.java deleted file mode 100644 index 27f03c15696..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageTypeLinkCreateCommandCommon.java +++ /dev/null @@ -1,224 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.diagram.sequence.edit.commands;
-
-import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.uml2.uml.BehaviorExecutionSpecification;
-import org.eclipse.uml2.uml.CallEvent;
-import org.eclipse.uml2.uml.CreationEvent;
-import org.eclipse.uml2.uml.DestructionEvent;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Event;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.MessageSort;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.SendOperationEvent;
-import org.eclipse.uml2.uml.SendSignalEvent;
-import org.eclipse.uml2.uml.SignalEvent;
-import org.eclipse.uml2.uml.UMLPackage;
-
-import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil;
-import org.eclipse.papyrus.diagram.common.actions.LabelHelper;
-
-/**
- * @generated
- */
-public class MessageTypeLinkCreateCommandCommon extends CreateElementCommand {
-
- /**
- * @generated
- */
- public MessageTypeLinkCreateCommandCommon(CreateRelationshipRequest req) {
- super(req);
- }
-
- private Package getPackageFromInteraction(Interaction myContainer) {
- Package interactionPackage = myContainer.getPackage();
- while (interactionPackage == null) {
- if (myContainer.getPackage() == null
- && myContainer.getEnclosingInteraction() != null)
- return getPackageFromInteraction(myContainer
- .getEnclosingInteraction());
- else
- return null;
- }
-
- return interactionPackage;
- }
-
- /**
- * Main method
- *
- * @param myContainer
- * @param mySource
- * @param myTarget
- * @param newMessage
- * @generated NOT
- */
- protected void doDefaultMessageInitialize(Interaction myContainer,
- Element mySource, Element myTarget, Message newMessage) {
- // Events
- Event sourceEvent = null;
- Event targetEvent = null;
-
- // Package where the interaction is contained. Remeber that an
- // interaction may be contained withind another interaction.
- Package interactionPackage = getPackageFromInteraction(myContainer);
-
- switch (newMessage.getMessageSort().getValue()) {
- case MessageSort.SYNCH_CALL:
- case MessageSort.ASYNCH_CALL:
- // Create the SendOperationEvent
- sourceEvent = (SendOperationEvent) interactionPackage
- .createPackagedElement("SendOperationEvent",
- UMLPackage.eINSTANCE.getSendOperationEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, sourceEvent);
-
- // Create the CallEvent
- targetEvent = (CallEvent) interactionPackage.createPackagedElement(
- "CallEvent", UMLPackage.eINSTANCE.getCallEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, targetEvent);
- break;
-
- case MessageSort.REPLY:
- sourceEvent = null;
- targetEvent = null;
- break;
-
- case MessageSort.ASYNCH_SIGNAL:
- // Create the SendSignalEvent
- sourceEvent = (SendSignalEvent) interactionPackage
- .createPackagedElement("SendSignalEvent",
- UMLPackage.eINSTANCE.getSendSignalEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, sourceEvent);
-
- // create the SignalEvent (equal to RecieveSignalEvent)
- targetEvent = (SignalEvent) interactionPackage
- .createPackagedElement("SignalEvent", UMLPackage.eINSTANCE
- .getSignalEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, targetEvent);
- break;
-
- case MessageSort.DELETE_MESSAGE:
- // create the SignalEvent (equal to RecieveSignalEvent)
- targetEvent = (DestructionEvent) interactionPackage
- .createPackagedElement("DestructionEvent",
- UMLPackage.eINSTANCE.getDestructionEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, targetEvent);
- break;
-
- case MessageSort.CREATE_MESSAGE:
- // Create the CreationEvent
- targetEvent = (CreationEvent) interactionPackage
- .createPackagedElement("CreationEvent",
- UMLPackage.eINSTANCE.getCreationEvent());
- LabelHelper.INSTANCE.initName(interactionPackage, targetEvent);
- break;
- }
-
- // Create the 2 MessageOcurrenceSpecification
- MessageOccurrenceSpecification msgSend = (MessageOccurrenceSpecification) myContainer
- .createFragment("MessageOccurrenceSpecification",
- UMLPackage.eINSTANCE
- .getMessageOccurrenceSpecification());
- LabelHelper.INSTANCE.initName(myContainer, msgSend);
-
- MessageOccurrenceSpecification msgReceive = (MessageOccurrenceSpecification) myContainer
- .createFragment("MessageOccurrenceSpecification",
- UMLPackage.eINSTANCE
- .getMessageOccurrenceSpecification());
- LabelHelper.INSTANCE.initName(myContainer, msgReceive);
-
- // Initialization of the Message
- newMessage.setSendEvent(msgSend);
- newMessage.setReceiveEvent(msgReceive);
-
- // Initialization of the MessageOccurrenceSpecifications
-
- // msgSend
- if (sourceEvent != null)
- msgSend.setEvent(sourceEvent);
- msgSend.setMessage(newMessage);
- // Initialize the covered reference
- Lifeline lifeLine = null;
- if (mySource instanceof BehaviorExecutionSpecification) {
- BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) mySource;
- if (bes.getCovereds().size() > 0) {
- lifeLine = bes.getCovereds().get(0);
- msgSend.getCovereds().add(lifeLine);
- }
- } else {
- lifeLine = (Lifeline) mySource;
- msgSend.getCovereds().add(lifeLine);
- }
-
- // msgReceive
- if (targetEvent != null)
- msgReceive.setEvent(targetEvent);
- msgReceive.setMessage(newMessage);
- // Initialize the covered reference
- lifeLine = null;
- if (myTarget instanceof BehaviorExecutionSpecification) {
- BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) myTarget;
- if (bes.getCovereds().size() > 0) {
- lifeLine = bes.getCovereds().get(0);
- msgReceive.getCovereds().add(lifeLine);
- }
- } else {
- lifeLine = (Lifeline) myTarget;
- msgReceive.getCovereds().add(lifeLine);
- }
-
- // NOT DONE HERE ANYMORE - Now is responsibility of MessageOrderCommand
- // Initialization of the BehaviorExecutionSpecifications
- // BehaviorExecutionSpecification bes;
- // if (mySource instanceof BehaviorExecutionSpecification) {
- // bes = (BehaviorExecutionSpecification) mySource;
- // if (bes.getStart() == null)
- // bes.setStart(msgSend);
- //
- // bes.setFinish(msgSend);
- // }
- //
- // if (myTarget instanceof BehaviorExecutionSpecification) {
- // bes = (BehaviorExecutionSpecification) myTarget;
- // if (bes.getStart() == null)
- // bes.setStart(msgReceive);
- //
- // bes.setFinish(msgReceive);
- // }
-
- }
-
- /**
- * @generated
- *
- * @author fjcano
- */
- protected Diagram getDiagramFromRequest() {
- // used in doDefaultElementCreation()
- if (getRequest().getParameters().get(
- MultiDiagramUtil.BelongToDiagramSource) != null) {
- Object parameter = getRequest().getParameters().get(
- MultiDiagramUtil.BelongToDiagramSource);
- if (parameter instanceof Diagram) {
- return (Diagram) parameter;
- }
- }
- return null;
- }
-
-}
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java deleted file mode 100644 index e199d6db500..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionCompartmentXYLayoutEditPolicy.java +++ /dev/null @@ -1,212 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat - * de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation - * Francisco Javier Cano Muñoz - Expanded functionality - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.requests.ChangeBoundsRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; - -import org.eclipse.papyrus.diagram.common.commands.PreserveAnchorsPositionCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CombinedFragmentCoveredCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; - -public class InteractionCompartmentXYLayoutEditPolicy extends - XYLayoutEditPolicy { - - @Override - public Command getCommand(Request request) { - - if (request instanceof ChangeBoundsRequest) { - ChangeBoundsRequest cbr = (ChangeBoundsRequest) request; - - CompoundCommand compoundCmd = new CompoundCommand( - "Resize of Interaction Compartment Elements"); - - for (Iterator<EditPart> it = cbr.getEditParts().iterator(); it - .hasNext();) { - EditPart ep = it.next(); - - if (ep instanceof CombinedFragmentEditPart) { - // CombinedFragment EditPart - CombinedFragmentEditPart cfragmentEP = (CombinedFragmentEditPart) ep; - - // SetBounds command - compoundCmd.add(getSetBoundsCommand(cfragmentEP, cbr)); - - // Covered command - compoundCmd.add(new CombinedFragmentCoveredCommand( - cfragmentEP)); - - } else if (ep instanceof LifelineEditPart) { - // Lifeline EditPart - LifelineEditPart lifelineEP = (LifelineEditPart) ep; - - int preserveY = PreserveAnchorsPositionCommand.PRESERVE_Y; - Dimension newSizeDelta = PreserveAnchorsPositionCommand - .getSizeDeltaToFitAnchors(lifelineEP, cbr - .getSizeDelta(), preserveY); - - // SetBounds command modifying the sizeDelta - compoundCmd.add(getSetBoundsCommand(lifelineEP, cbr, - newSizeDelta)); - - // PreserveAnchors command - compoundCmd.add(new ICommandProxy( - new PreserveAnchorsPositionCommand(lifelineEP, - newSizeDelta, preserveY))); - - // If a Lifeline is moved or resized then all the - // CombinedFragments must be updated - for (Object obj : lifelineEP.getParent().getChildren()) { - if (obj instanceof CombinedFragmentEditPart) - compoundCmd.add(new CombinedFragmentCoveredCommand( - (CombinedFragmentEditPart) obj)); - } - } else if (ep instanceof BehaviorExecutionSpecificationEditPart) { - // Due to the fact that the Lifeline does not have a - // CompartmentEditPart - // changebounds requests are always sent to the - // InteractionCompartmentXYLayoutEditPolicy - // and need to be redirected to the - // LifelineXYLayoutEditPolicy by just executing - // the LifelineEditPart.getCommand(request). - BehaviorExecutionSpecificationEditPart besEP = (BehaviorExecutionSpecificationEditPart) ep; - if (besEP.getParent() instanceof LifelineEditPart) { - LifelineEditPart lifelineEP = (LifelineEditPart) besEP - .getParent(); - compoundCmd.add(lifelineEP.getCommand(cbr)); - } - } - } - - if (compoundCmd.size() == 0) - return super.getCommand(request); - else - return compoundCmd; - } - - if (request instanceof CreateViewAndElementRequest) { - CreateViewAndElementRequest cver = (CreateViewAndElementRequest) request; - - CompoundCommand compoundCmd = new CompoundCommand( - "Creation of a CombinedFragment"); - compoundCmd.add(super.getCommand(request)); - - if (cver.getViewAndElementDescriptor().getSemanticHint().compareTo( - Integer.toString(CombinedFragmentEditPart.VISUAL_ID)) == 0) { - - compoundCmd.add(new CombinedFragmentCoveredCommand(getHost() - .getViewer(), cver.getViewAndElementDescriptor())); - } - - if (compoundCmd.size() == 0) - return super.getCommand(request); - else - return compoundCmd; - } - - return super.getCommand(request); - } - - /** - * It obtains an appropriate SetBoundsCommand for a CombinedFragmentEditPart - * - * @param combinedFragmentEP - * The CombinedFragment that will be moved or resized - * @param cbr - * The ChangeBoundsRequest for moving or resizing the - * combinedFragmentEP - * @return The SetBoundsCommand - */ - protected Command getSetBoundsCommand( - CombinedFragmentEditPart combinedFragmentEP, ChangeBoundsRequest cbr) { - // Modify request - List epList = cbr.getEditParts(); - cbr.setEditParts(combinedFragmentEP); - // Obtain the command with the modified request - Command cmd = super.getCommand(cbr); - // Restore the request - cbr.setEditParts(epList); - // Return the SetBoundsCommand only for the CombinedFragmentEditPart - return cmd; - } - - /** - * It obtains an appropriate SetBoundsCommand for a LifelineEditPart. The - * newSizeDelta provided should be equal o less than the one contained in - * the request. The goal of this newDelta is to preserve the anchors' - * positions after the resize. It is recommended to obtain this newSizeDelta - * by means of calling - * PreserveAnchorsPositionCommand.getSizeDeltaToFitAnchors() operation - * - * @param lifelineEP - * The Lifeline that will be moved or resized - * @param cbr - * The ChangeBoundsRequest for moving or resized the lifelineEP - * @param newSizeDelta - * The sizeDelta to used instead of the one contained in the - * request - * @return The SetBoundsCommand - */ - protected Command getSetBoundsCommand(LifelineEditPart lifelineEP, - ChangeBoundsRequest cbr, Dimension newSizeDelta) { - // Modify request - List epList = cbr.getEditParts(); - Dimension oldSizeDelta = cbr.getSizeDelta(); - cbr.setEditParts(lifelineEP); - cbr.setSizeDelta(newSizeDelta); - - // Obtain the command with the modified request - Command cmd = super.getCommand(cbr); - - // Restore the request - cbr.setEditParts(epList); - cbr.setSizeDelta(oldSizeDelta); - - // Return the SetBoundsCommand only for the Lifeline and with the - // sizeDelta modified in order to preserve the links' anchors positions - return cmd; - } - - /** - * It obtains an appropriate SetBoundsCommand for a LifelineEditPart. In - * comparison with the the other getSetBoundsCommand, no newSizeDelta needs - * to be provided as it already calculates the appropriate newSizeDelta. - * PreserveAnchorsPositionCommand.getSizeDeltaToFitAnchors() operation - * - * @param lifelineEP - * The Lifeline that will be moved or resized - * @param cbr - * The ChangeBoundsRequest for moving or resized the lifelineEP - * @return The SetBoundsCommand - */ - protected Command getSetBoundsCommand(LifelineEditPart lifelineEP, - ChangeBoundsRequest cbr) { - int preserveY = PreserveAnchorsPositionCommand.PRESERVE_Y; - Dimension newSizeDelta = PreserveAnchorsPositionCommand - .getSizeDeltaToFitAnchors(lifelineEP, cbr.getSizeDelta(), - preserveY); - return getSetBoundsCommand(lifelineEP, cbr, newSizeDelta); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionDragDropEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionDragDropEditPolicy.java deleted file mode 100644 index 0cd54cda3d3..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionDragDropEditPolicy.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat - * de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.ChangeBoundsRequest; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; - -public class InteractionDragDropEditPolicy extends DragDropEditPolicy { - - @Override - protected Command getDropCommand(ChangeBoundsRequest request) { - for(Object ep : request.getEditParts()) - { - if (ep instanceof BehaviorExecutionSpecificationEditPart) - { - return UnexecutableCommand.INSTANCE; - } - else if(ep instanceof LifelineEditPart) - { - return UnexecutableCommand.INSTANCE; - } - } - - return super.getDropCommand(request); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java deleted file mode 100644 index 78a68278caf..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineXYLayoutEditPolicy.java +++ /dev/null @@ -1,519 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat - * de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation - * Francisco Javier Cano Muñoz - Expanded functionality - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.requests.ChangeBoundsRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; - -import org.eclipse.papyrus.diagram.common.commands.PreserveAnchorsPositionCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageOrderCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; - -public class LifelineXYLayoutEditPolicy extends XYLayoutEditPolicy { - - private final static int EXECUTION_INIT_WIDTH = 16; - private final static int EXECUTION_INIT_HEIGHT = 60; - - @Override - public Command getCommand(Request request) { - if (request instanceof ChangeBoundsRequest) { - ChangeBoundsRequest cbr = (ChangeBoundsRequest) request; - - // This policy is hosted in a LifelineEditPart - LifelineEditPart lifelineEP = (LifelineEditPart) getHost(); - - // Compound Command - CompoundCommand compoundCmd = new CompoundCommand(); - compoundCmd.setLabel("Movement or Resize of a BES EditPart"); - compoundCmd - .setDebugLabel("Debug: Movement or Resize of a BES EditPart"); - - - // CASE 1: Resize of the own Lifeline - if (cbr.getEditParts() != null && cbr.getEditParts().contains(getHost()) && cbr.getSizeDelta().width != 0) { - // If the width increases or decreases, BES elements need to be moved - for (Object obj: getHost().getChildren()) { - if (obj instanceof BehaviorExecutionSpecificationEditPart) { - BehaviorExecutionSpecificationEditPart besEP = (BehaviorExecutionSpecificationEditPart) obj; - - // Lifeline's figure where the child is drawn - Rectangle rDotLine = besEP.getFigure().getParent().getBounds() - .getCopy(); - - // The new bounds will be calculated from the current - // bounds - Rectangle newBounds = besEP.getFigure().getBounds().getCopy(); - - // Apply SizeDelta to the children - newBounds.x += Math - .round((float) cbr.getSizeDelta().width - / (float) 2); - - // Convert to relative - newBounds.x -= rDotLine.x; - newBounds.y -= rDotLine.y; - - SetBoundsCommand setBoundsCmd = new SetBoundsCommand(besEP.getEditingDomain(), - "Re-location of a BES due to a Lifeline movement", besEP, newBounds); - compoundCmd.add(new ICommandProxy(setBoundsCmd)); - } - } - } - - // CASE 2: Resize or movement of one child - // We are supposed to work with only one children at a time - else if (cbr.getEditParts() != null - && cbr.getEditParts().size() == 1 - && lifelineEP.getBESList().contains( - cbr.getEditParts().get(0))) { - - // The child's EditPart - BehaviorExecutionSpecificationEditPart besEP = (BehaviorExecutionSpecificationEditPart) cbr - .getEditParts().get(0); - - // The SetBounds command need an adapter. Nothing to worry, the - // child itself implements the IAdaptable interface - IAdaptable adapter = besEP; - - // Obtain the editing domain from the child's EditPart - TransactionalEditingDomain eDomain = besEP.getEditingDomain(); - - // Check if height is within the limits of the figure - Dimension newSizeDelta = adaptSizeDeltaToMaxHeight(besEP - .getFigure(), cbr.getSizeDelta()); - - // New delta to preserve the position of the last link's - // anchor - newSizeDelta = PreserveAnchorsPositionCommand - .getSizeDeltaToFitAnchors(besEP, newSizeDelta, - PreserveAnchorsPositionCommand.PRESERVE_Y); - - // Get the new BES bounds. - Rectangle newBounds = getBESNewBounds(lifelineEP, besEP, cbr - .getMoveDelta(), newSizeDelta); - - // Create and add the command to the compound command - SetBoundsCommand setBoundsCmd = new SetBoundsCommand(eDomain, - "Resize of a BES", adapter, newBounds); - compoundCmd.add(new ICommandProxy(setBoundsCmd)); - - // Apart from moving the selected BES, it's affixed BES should - // also be moved - Point realMoveDelta = getRealMoveDelta(besEP, newBounds); - if (realMoveDelta.y != 0) { - CompoundCommand auxCmd = getMoveAffixedBESCommand(besEP, - realMoveDelta); - if (auxCmd != null && auxCmd.size() > 0) - compoundCmd.add(auxCmd); - } - - // Modify anchors to preserve their positions after - // the re-size - compoundCmd.add(new ICommandProxy( - new PreserveAnchorsPositionCommand(besEP, newSizeDelta, - PreserveAnchorsPositionCommand.PRESERVE_Y))); - - // Ordering should be updated - // parent - compoundCmd.add(new MessageOrderCommand(besEP)); - // affixed BES - CompoundCommand affixedBesOrderCmd = getAffixedBESMessageOrderCommand(besEP); - if (affixedBesOrderCmd.size() > 0) - compoundCmd.add(affixedBesOrderCmd); - - } - - // return the compoundCmd - if (compoundCmd.size() == 0) - return super.getCommand(request); - else - return compoundCmd; - } - - if (request instanceof CreateViewAndElementRequest) { - - CreateViewAndElementRequest cver = (CreateViewAndElementRequest) request; - LifelineEditPart lifelineEditPart = (LifelineEditPart) getHost(); - - TransactionalEditingDomain eDomain = lifelineEditPart - .getEditingDomain(); - IAdaptable adapter = cver.getViewAndElementDescriptor(); - - // Translate the absolute location to relative - Point newLocation = cver.getLocation().getCopy(); - - if (newLocation.x < 0 || newLocation.y < 0) { - newLocation.x = newLocation.y = 0; - } - - lifelineEditPart.getPrimaryShape().getFigureDotLineFigure() - .translateToRelative(newLocation); - - int newHeight; - if (cver.getSize() != null) - newHeight = cver.getSize().height; - else - newHeight = EXECUTION_INIT_HEIGHT; - - Rectangle newInitBounds = new Rectangle( - newLocation.x, - newLocation.y, - EXECUTION_INIT_WIDTH, newHeight); - - Rectangle newBounds = getBESNewBounds(lifelineEditPart, - newInitBounds, Collections.EMPTY_LIST); - - // to avoid creation of the new figure in a non visible area - newBounds.y = newBounds.y <= 0 ? 1 : newBounds.y; - - SetBoundsCommand setBoundsCmd = new SetBoundsCommand(eDomain, - "Creation of an ExecutionBehaviourSpecification", adapter, - newBounds); - - return new ICommandProxy(setBoundsCmd); - } - - return super.getCommand(request); - } - - /** - * Useful operation to know where a BES EditPart should be positioned within - * a Lifeline EditPart. It is needed both the moveDelta and the sizeDelta. - * With these two values, and the child EditParts of the Lifeline, the new - * position is worked out. The returned bounds are relative to the Lifeline - * figure so they can be used, directly, within a SetBoundsCommand. - * - * @param lifelineEP - * @param besEP - * @param moveDelta - * @param sizeDelta - * @return The new bounds of the besEP - */ - public static Rectangle getBESNewBounds(LifelineEditPart lifelineEP, - BehaviorExecutionSpecificationEditPart besEP, Point moveDelta, - Dimension sizeDelta) { - - // Current bounds of the BES - Rectangle newBounds = besEP.getPrimaryShape().getBounds().getCopy(); - - // According to the parameters, the new bounds would be the following - newBounds.x += moveDelta.x; - newBounds.y += moveDelta.y; - newBounds.height += sizeDelta.height; - - // Not to check list - List<BehaviorExecutionSpecificationEditPart> notToCheckBesList = new BasicEList<BehaviorExecutionSpecificationEditPart>(); - // Affixed BES List - notToCheckBesList.addAll(getAffixedBESEditParts(besEP)); - // Add also current BES EditPart - notToCheckBesList.add(besEP); - - return getBESNewBounds(lifelineEP, newBounds, notToCheckBesList); - } - - /** - * Useful operation to know where the figure of a BES EditPart should be - * positioned within a Lifeline EditPart. The notToCheckList is needed to - * avoid checking those BES EditParts. The returned bounds are relative to - * the Lifeline figure so they can be used, directly, within a - * SetBoundsCommand. - * - * @param lifelineEP - * @param newInitBounds - * The new initial bounds - * @param notToCheckBesList - * The BES EditPart's List that won't be checked - * @return The new bounds of the besEP figure - */ - public static Rectangle getBESNewBounds(LifelineEditPart lifelineEP, - Rectangle newInitBounds, - List<BehaviorExecutionSpecificationEditPart> notToCheckBesList) { - // Lifeline's figure where the child is drawn - Rectangle rDotLine = lifelineEP.getPrimaryShape() - .getFigureDotLineFigure().getBounds().getCopy(); - - // To store the newBounds - Rectangle newBounds = newInitBounds.getCopy(); - - // Check first if there is contact with any of the existing BES - Rectangle childBounds = null; - - List<BehaviorExecutionSpecificationEditPart> toCheckBesList = lifelineEP - .getBESList(); - toCheckBesList.removeAll(notToCheckBesList); - - // Iterate through the toCheckBesList - for (BehaviorExecutionSpecificationEditPart auxBesEP : toCheckBesList) { - Rectangle auxBounds = auxBesEP.getPrimaryShape().getBounds() - .getCopy(); - - // Check if there is any contact - if (newInitBounds.touches(auxBounds)) { - childBounds = auxBounds; - break; // break the for - } - } - - // Case there wasn't any contact - if (childBounds == null) { - // Loop through the BES list and try to find the most to the right - // BES within the besEP Y-axis bounds - Rectangle mostToRightBesBounds = null; - for (BehaviorExecutionSpecificationEditPart auxBesEP : toCheckBesList) { - Rectangle auxBesBounds = auxBesEP.getFigure().getBounds(); - Rectangle auxBounds = newInitBounds.getCopy(); - auxBounds.x = auxBesBounds.x; - if (auxBesBounds.touches(auxBounds)) { - if (mostToRightBesBounds == null) - mostToRightBesBounds = auxBesBounds; - else if (auxBesBounds.x > mostToRightBesBounds.x) - mostToRightBesBounds = auxBesBounds; - } - } - - // If there was no luck, set it's position to the center - if (mostToRightBesBounds == null) { - newBounds.x = rDotLine.x + rDotLine.width / 2 - - EXECUTION_INIT_WIDTH / 2; - } else { - newBounds.x = mostToRightBesBounds.x + EXECUTION_INIT_WIDTH / 2 - + 1; - } - } else - newBounds.x = childBounds.x + EXECUTION_INIT_WIDTH / 2 + 1; - // Note: The last + 1 is just an extra delta - - // to avoid none visible positioning - newBounds.y = newBounds.y <= 0 ? 1 : newBounds.y; - - // Change to relative bounds of the LifelineEP - newBounds.x -= rDotLine.x; - newBounds.y -= rDotLine.y; - - return newBounds; - } - - /** - * Used to modify the sizeDelta if the given value is higher/lower than the - * highest/lowest allowed values of the figure. - * - * @param figure - * @param sizeDelta - * @return a corrected sizeDelta - */ - public static Dimension adaptSizeDeltaToMaxHeight(IFigure figure, - Dimension sizeDelta) { - Dimension newSizeDelta = new Dimension(sizeDelta); - - int y = figure.getBounds().height + sizeDelta.height; - - if (y > figure.getMaximumSize().height) { - newSizeDelta.height = figure.getMaximumSize().height - - figure.getBounds().height; - } else if (y < figure.getMinimumSize().height) { - newSizeDelta.height = figure.getMinimumSize().height - - figure.getBounds().height; - } - - return newSizeDelta; - } - - /** - * Returns all the BES EditParts that are affixed to the right side of the - * given BES EditPart. Not only the ones directly affixed to the besEP are - * returned, but the ones that are indirectly affixed as well (this is done - * recursively) - * - * @param besEP - * @return the list of affixed BES. If there is no affixed BES, then an - * empty list will be returned - */ - public static List<BehaviorExecutionSpecificationEditPart> getAffixedBESEditParts( - BehaviorExecutionSpecificationEditPart besEP) { - List<BehaviorExecutionSpecificationEditPart> notToCheckBesList = new ArrayList<BehaviorExecutionSpecificationEditPart>(); - return getAffixedBESEditParts(besEP, notToCheckBesList); - - } - - /** - * Operation used by the above operation. It's main goal is to obtain, - * recursively, all the affixed BES. In order to do so, it is needed a BES - * EditPart and the notToCheckList. - * - * @param besEP - * @param notToCheckBesList - * @return the list of affixed BES. If there is no affixed BES, then an - * empty list will be returned - */ - private static List<BehaviorExecutionSpecificationEditPart> getAffixedBESEditParts( - BehaviorExecutionSpecificationEditPart besEP, - List<BehaviorExecutionSpecificationEditPart> notToCheckBesList) { - // Add itself to the notToCheck list - List<BehaviorExecutionSpecificationEditPart> newNotToCheckBesList = new ArrayList<BehaviorExecutionSpecificationEditPart>( - notToCheckBesList); - newNotToCheckBesList.add(besEP); - - // LifelineEditPart where the BES EditPart is contained - LifelineEditPart lifelineEP = (LifelineEditPart) besEP.getParent(); - - // BES EditParts list - List<BehaviorExecutionSpecificationEditPart> besList = lifelineEP - .getBESList(); - besList.remove(newNotToCheckBesList); - - // List to store the Affixed BES - ArrayList<BehaviorExecutionSpecificationEditPart> affixedBesList = new ArrayList<BehaviorExecutionSpecificationEditPart>(); - - // Loop through the BES list - for (BehaviorExecutionSpecificationEditPart childBesEP : besList) { - if (isAffixedToRight(besEP, childBesEP)) { - affixedBesList.add(childBesEP); - // Add also it's affixed BES - affixedBesList.addAll(getAffixedBESEditParts(childBesEP, - newNotToCheckBesList)); - } - } - - // To the BES list - return affixedBesList; - } - - /** - * Checks whether the right EditPart is affixed to the left EditPart. In - * order to do so, the operation checks if the right figure is really on the - * right and, if so, it just returns true if figures touch each other. - * - * @param leftEP - * The left AbstractGraphicalEditPart - * @param rightEP - * The right AbstractGraphicalEditPart - * @return true if the rectangles of both figures touch and the right figure - * is really on the right. False otherwise - */ - public static boolean isAffixedToRight(AbstractGraphicalEditPart leftEP, - AbstractGraphicalEditPart rightEP) { - Rectangle leftFig = leftEP.getFigure().getBounds(); - Rectangle rightFig = rightEP.getFigure().getBounds(); - if (leftFig.touches(rightFig) && leftFig.x < rightFig.x) - return true; - else - return false; - } - - /** - * If a BES EditPart is going to be moved according to a moveDelta, this - * operation returns a compoundCommand that also moves the affixed BES - * according to that delta. - * - * @param besEP - * The BES EditPart that is going to be moved - * @param moveDelta - * The moveDelta of the previous EditPart - * @return - */ - public static CompoundCommand getMoveAffixedBESCommand( - BehaviorExecutionSpecificationEditPart besEP, Point moveDelta) { - CompoundCommand compoundCmd = new CompoundCommand(); - if (moveDelta.y != 0) { - for (BehaviorExecutionSpecificationEditPart childBesEP : getAffixedBESEditParts(besEP)) { - // Get Relative Bounds - Rectangle childBounds = getRelativeBounds(childBesEP); - // Apply delta - childBounds.y += moveDelta.y; - childBounds.x += moveDelta.x; - // Create the child's SetBoundsCommand - SetBoundsCommand childSetBoundsCmd = new SetBoundsCommand(besEP - .getEditingDomain(), "Movement of affixed BES", - childBesEP, childBounds); - compoundCmd.add(new ICommandProxy(childSetBoundsCmd)); - // Move it's children as well - if (getAffixedBESEditParts(childBesEP).size() > 0) - compoundCmd.add(getMoveAffixedBESCommand(childBesEP, - moveDelta)); - } - } - if (compoundCmd.size() == 0) - return null; - else - return compoundCmd; - } - - /** - * Given an AbstractGraphialEditPart and the new relative bounds that the - * EditPart will have, it returns the real delta applied to the movement - * - * @param ep - * The EditPart that will be moved - * @param newRelativeBounds - * The new position of the mentioned EditPart - * @return The real MoveDelta applied - */ - public static Point getRealMoveDelta(AbstractGraphicalEditPart ep, - Rectangle newRelativeBounds) { - Rectangle oldRelativeBounds = getRelativeBounds(ep); - Point realMoveDelta = new Point(); - realMoveDelta.x = newRelativeBounds.x - oldRelativeBounds.x; - realMoveDelta.y = newRelativeBounds.y - oldRelativeBounds.y; - return realMoveDelta; - } - - /** - * It returns the relative bounds of an AbstractGraphicalEditPart. - * - * @param ep - * The EditPart - * @return The relative bounds regarding it's parent figure - */ - public static Rectangle getRelativeBounds(AbstractGraphicalEditPart ep) { - IFigure parentFigure = ep.getFigure().getParent(); - IFigure epFigure = ep.getFigure(); - Rectangle relBounds = epFigure.getBounds().getCopy(); - relBounds.x -= parentFigure.getBounds().x; - relBounds.y -= parentFigure.getBounds().y; - return relBounds; - } - - /** - * It returns a compound command to order the messages of it's affixed BES - * - * @param besEP - * BES whose affixed BES will be re-ordered - * @return The CompoundCommand to order the Messages of the affixed BES - */ - public CompoundCommand getAffixedBESMessageOrderCommand( - BehaviorExecutionSpecificationEditPart besEP) { - CompoundCommand cCommand = new CompoundCommand(); - for (BehaviorExecutionSpecificationEditPart affixedBesEP : getAffixedBESEditParts(besEP)) { - cCommand.add(new MessageOrderCommand(affixedBesEP)); - } - return cCommand; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageDestroySemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageDestroySemanticEditPolicy.java deleted file mode 100644 index b46f2e4c9bb..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageDestroySemanticEditPolicy.java +++ /dev/null @@ -1,117 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Iterator; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.uml2.uml.Event; -import org.eclipse.uml2.uml.GeneralOrdering; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageOrderCommand; - -public class MessageDestroySemanticEditPolicy extends UMLBaseItemSemanticEditPolicy { - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - /* - * Destroy all the elements that are created when a message is created the first time: - * 1.- The Send Event - * 2.- The Receive Event - * 3.- The 2 Message Occurrence Specifications - * 4.- The message - * - * To accomplish this, will build a compound command - */ - - CompoundCommand compoundCmd = new CompoundCommand(); - - if (req.getElementToDestroy() instanceof Message) { - Message msg = (Message) req.getElementToDestroy(); - - // Obtain the elements to destroy - MessageOccurrenceSpecification msgSend = null; - MessageOccurrenceSpecification msgRecieve = null; - Event sendEvent = null; - Event receiveEvent = null; - - if (msg.getSendEvent() instanceof MessageOccurrenceSpecification) - msgSend = (MessageOccurrenceSpecification) msg.getSendEvent(); - - if (msg.getReceiveEvent() instanceof MessageOccurrenceSpecification) - msgRecieve = (MessageOccurrenceSpecification) msg - .getReceiveEvent(); - - if (msgSend != null) - sendEvent = msgSend.getEvent(); - if (msgRecieve != null) - receiveEvent = msgRecieve.getEvent(); - - // Update ordering - compoundCmd.add(new MessageOrderCommand(req)); - - // Create and compound the Destroy Element Commands - if (sendEvent != null) { - DestroyElementRequest reqSendEvent = new DestroyElementRequest(req - .getEditingDomain(), sendEvent, false); - compoundCmd - .add(getGEFWrapper(new DestroyElementCommand(reqSendEvent))); - } - - if (receiveEvent != null) { - DestroyElementRequest reqReceiveEvent = new DestroyElementRequest(req - .getEditingDomain(), receiveEvent, false); - compoundCmd - .add(getGEFWrapper(new DestroyElementCommand(reqReceiveEvent))); - } - - if (msgSend != null) { - // Destroy first its general ordering - for (Iterator<GeneralOrdering> i = msgSend.getGeneralOrderings().iterator(); i.hasNext();) { - DestroyElementRequest reqGenOrd = new DestroyElementRequest(req.getEditingDomain(), i.next(), false); - compoundCmd.add(getGEFWrapper(new DestroyElementCommand( - reqGenOrd))); - } - - // Destroy the MessageOccurrenceSpecification - DestroyElementRequest reqMsgSend = new DestroyElementRequest( - req.getEditingDomain(), msgSend, false); - compoundCmd.add(getGEFWrapper(new DestroyElementCommand( - reqMsgSend))); - } - - if (msgRecieve != null) { - // Destroy first its general ordering - for (Iterator<GeneralOrdering> i = msgRecieve.getGeneralOrderings().iterator(); i.hasNext();) { - DestroyElementRequest reqGenOrd = new DestroyElementRequest(req.getEditingDomain(), i.next(), false); - compoundCmd.add(getGEFWrapper(new DestroyElementCommand( - reqGenOrd))); - } - - // Destroy the MessageOccurrenceSpecification - DestroyElementRequest reqMsgReceive = new DestroyElementRequest( - req.getEditingDomain(), msgRecieve, false); - compoundCmd.add(getGEFWrapper(new DestroyElementCommand( - reqMsgReceive))); - } - - } - - compoundCmd.add(getGEFWrapper(new DestroyElementCommand(req))); - - return compoundCmd; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDeleteOnlyViewComponentEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDeleteOnlyViewComponentEditPolicy.java deleted file mode 100644 index 52b602d8e10..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDeleteOnlyViewComponentEditPolicy.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; - -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; - -public class SequenceDeleteOnlyViewComponentEditPolicy extends - DeleteOnlyViewComponentEditPolicy { - - @Override - protected Command getDeleteCommand(GroupRequest request) { - // The following elements should not allow the deletion of their views - IGraphicalEditPart ep = getGraphicalHost(); - - // Message - if (ep.resolveSemanticElement() instanceof Message) - return UnexecutableCommand.INSTANCE; - - // Lifeline - if (ep.resolveSemanticElement() instanceof Lifeline) - return UnexecutableCommand.INSTANCE; - - // BES - if (ep.resolveSemanticElement() instanceof BehaviorExecutionSpecification) - return UnexecutableCommand.INSTANCE; - - // For the rest, return the parent command - return super.getDeleteCommand(request); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDiagramDragAndDropEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDiagramDragAndDropEditPolicy.java deleted file mode 100644 index 42e37fdedde..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/edit/policies/SequenceDiagramDragAndDropEditPolicy.java +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz - Initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.List; - -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest; -import org.eclipse.uml2.uml.Interaction; - -import org.eclipse.papyrus.diagram.common.editpolicies.DiagramDragDropEditPolicy; -import org.eclipse.papyrus.diagram.common.editpolicies.ViewResolver; -import org.eclipse.papyrus.diagram.sequence.edit.commands.InitializeInteractionViewCommand; - -/** - * Drag and Drop edit policy for the sequence <Diagram>. Will perform the - * drag&drop of an <Interaction> correctly, creating views according to the - * general order of the <Message>s in the <Interaction>. - * - * @author fjcano - * - */ -public class SequenceDiagramDragAndDropEditPolicy extends - DiagramDragDropEditPolicy { - - /** - * Default constructor. - * - * @param resolver - */ - public SequenceDiagramDragAndDropEditPolicy(ViewResolver resolver) { - super(resolver); - } - - @Override - public Command getDropObjectsCommand(DropObjectsRequest dropRequest) { - // - get Interaction from DropRequest - List<EObject> nodeObjects = findNodesInDrop(dropRequest); - - // We are only interested in Interactions - List<Interaction> interactionObjects = new BasicEList<Interaction>(); - for (EObject obj : nodeObjects) { - if (obj instanceof Interaction) - interactionObjects.add((Interaction) obj); - } - if (interactionObjects.size() == 0) { - return UnexecutableCommand.INSTANCE; - } - // - build and return command - IGraphicalEditPart parentEditPart = getHost() instanceof IGraphicalEditPart ? (IGraphicalEditPart) getHost() - : null; - if (parentEditPart != null) { - TransactionalEditingDomain domain = parentEditPart - .getEditingDomain(); - if (domain != null) { - CompoundCommand cCommand = new CompoundCommand(); - for (Interaction interaction : interactionObjects) { - InitializeInteractionViewCommand command = new InitializeInteractionViewCommand( - domain, "Initialize Interaction view", null); - command.setParentEditPart(parentEditPart); - command.setInteraction(interaction); - command.setOffset(dropRequest.getLocation()); - cCommand.add(new ICommandProxy(command)); - } - return cCommand; - } - } - return UnexecutableCommand.INSTANCE; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/DiagramInitializationUtil.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/DiagramInitializationUtil.java deleted file mode 100644 index 7b3743a61a0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/DiagramInitializationUtil.java +++ /dev/null @@ -1,293 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Initial API implementation - * Franciso Javier Cano Muñoz (Prodevelop) - Improvements in the first msg search - * - ******************************************************************************/ - -package org.eclipse.papyrus.diagram.sequence.util; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Hashtable; -import java.util.List; -import java.util.Set; -import java.util.Map.Entry; - -import org.eclipse.gmf.runtime.common.core.util.HashUtil; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.OccurrenceSpecification; - -public class DiagramInitializationUtil { - - public static List<List<Message>> getGlobalMsgOrdering( - Interaction interaction) { - HashMap<Lifeline, List<Message>> lifelinesOrderedList = new HashMap<Lifeline, List<Message>>(); - - // For each lifeline, obtains it's ordered messages - for (Lifeline lifeline : interaction.getLifelines()) { - lifelinesOrderedList.put(lifeline, - getLifelineOrderdedMsgs(lifeline)); - } - - // Merge the information of all the lifelines in a global message - // ordered list - List<List<Message>> globalOrderedList = mergeOrderedMsgsLists(lifelinesOrderedList); - - // Return the list - return globalOrderedList; - } - - public static Message getLifelineFirstMessage(Lifeline lifeline) { - // Obtain the Interaction in which the Lifeline is contained - Interaction interaction = lifeline.getInteraction(); - - // If there is no interaction, we cannot continue - if (interaction == null) - return null; - - // Loop through the list of messages - for (Message msg : interaction.getMessages()) { - - MessageOccurrenceSpecification sourceEnd = MessageCommonUtil - .getMessageSrcMOS(msg); - MessageOccurrenceSpecification targetEnd = MessageCommonUtil - .getMessageDstMOS(msg); - - // This should not happen but just in case - if (sourceEnd == null || targetEnd == null) - continue; - - // This should not happen either - if (sourceEnd.getGeneralOrderings().size() == 0 - || targetEnd.getGeneralOrderings().size() == 0) - continue; - - // Check if the message belongs to this Lifeline - if (MessageCommonUtil.getMessageSrcLifeline(msg) == lifeline) { - // Check if it is the first message - if (sourceEnd.getGeneralOrderings().get(0).getBefore() == sourceEnd) - return msg; - } - if (MessageCommonUtil.getMessageDstLifeline(msg) == lifeline) { - // Check if it is the first message - if (targetEnd.getGeneralOrderings().get(0).getBefore() == targetEnd) - return msg; - } - } - - // If we get here it means the lifeline has no messages - return null; - } - - public static List<Message> getLifelineOrderdedMsgs(Lifeline lifeline) { - // Get it's first message - Message msg = getLifelineFirstMessage(lifeline); - - // Create the empty list - ArrayList<Message> orderedList = new ArrayList<Message>(); - - // If no message found then nothing is left to do - if (msg == null) - return orderedList; - - // Add the first element - orderedList.add(msg); - - // Get the initial OS - OccurrenceSpecification auxOS; - if (MessageCommonUtil.getMessageSrcLifeline(msg) == lifeline) { - auxOS = MessageCommonUtil.getMessageSrcMOS(msg); - } else { - auxOS = MessageCommonUtil.getMessageDstMOS(msg); - } - // Add the rest of elements - while (!isLastOS(auxOS)) { - auxOS = auxOS.getGeneralOrderings().get(0).getAfter(); - if (auxOS instanceof MessageOccurrenceSpecification - && ((MessageOccurrenceSpecification) auxOS).getMessage() != null) { - orderedList.add(((MessageOccurrenceSpecification) auxOS) - .getMessage()); - } - } - - // Return the ordered list - return orderedList; - } - - public static List<List<Message>> mergeOrderedMsgsLists( - HashMap<Lifeline, List<Message>> orderedLists) { - - ArrayList<List<Message>> globalList = new ArrayList<List<Message>>(); - - // We need one or more lists to order - if (orderedLists.size() >= 1) { - // VisitedLists - List<List<Message>> visitedLists = new ArrayList<List<Message>>(); - // HashMap - HashMap<Message, Integer> hashMap = new HashMap<Message, Integer>(); - - for (List<Message> partialList : orderedLists.values()) { - // Case the hashMap is empty - if (hashMap.size() == 0) { - for (int i = 0; i < partialList.size(); i++) { - hashMap.put(partialList.get(i), i); - } - visitedLists.add(partialList); - } - // Otherwise - else { - int offset = 0; - Integer existingPos; - for (int i = 0; i < partialList.size(); i++) { - Message msg = partialList.get(i); - existingPos = hashMap.get(msg); - // If not found add it - if (existingPos == null) { - // Add it to it's position - hashMap.put(msg, i + offset); - } - // Found - else { - if (existingPos > (i + offset)) { - // The global list rules - offset = existingPos - i; - } else if (existingPos < (i + offset)) { - // The partial list rules - - // Current message (and the ones that go after - // him) need to be moved to the new position - List<Message> followersList = getFollowersList( - msg, visitedLists); - - // Note: The followers list also includes msg - - int shift = (i + offset) - existingPos; - for (Message follower : followersList) { - // Update it's position - hashMap.put(follower, hashMap.get(follower) - + shift); - } - - } else { - // If existingPos == (i + offset), then do - // nothing - } - } - } // end for (partialList elements) - visitedLists.add(partialList); - } - } // end for (orderedLists elements) - - // If the hashMap is not empty, add the ordered elements to the - // globalList - if (!hashMap.isEmpty()) { - // Obtain the list of values ordered and without repeated elements - Set<Integer> valuesSet = new HashSet<Integer>(); - valuesSet.addAll(hashMap.values()); - Object[] valuesSortedArray = valuesSet.toArray(); - Arrays.sort(valuesSortedArray); - - // Initialize the globalList with the maximum size possible - for (int i = 0; i < valuesSortedArray.length; i++) - globalList.add(new ArrayList<Message>()); - - - // Add the ordered elements - for (Entry<Message, Integer> entry : hashMap.entrySet()) { - int pos = Arrays.binarySearch(valuesSortedArray, entry.getValue()); - globalList.get(pos).add(entry.getKey()); - } - } - } - - // Return the list - return globalList; - } - - public static List<Message> getFollowersList(Message msg, - List<List<Message>> visitedLists) { - List<Message> followersList = new ArrayList<Message>(); - HashMap<List<Message>, List<Message>> followersFoundPerList = new HashMap<List<Message>, List<Message>>(); - Set<Message> addSet = new HashSet<Message>(); - Set<Message> partialAddSet = new HashSet<Message>(); - - // Foreach visited list obtain it's followersList - for (List<Message> visitedList : visitedLists) { - followersFoundPerList.put(visitedList, followersList(msg, - visitedList)); - } - - // Build a set with the all followersLists - for (Entry<List<Message>, List<Message>> entry : followersFoundPerList - .entrySet()) { - addSet.addAll(entry.getValue()); - } - - boolean modifiedFlag; - do { - modifiedFlag = false; - - // Check if any of the visited lists has an empty followersList - for (Entry<List<Message>, List<Message>> entry : followersFoundPerList - .entrySet()) { - // If empty, obtain again it's list with the addSet - if (entry.getValue().isEmpty()) { - // Loop through the addSet - for (Message auxMsg : addSet) { - partialAddSet.addAll(followersList(auxMsg, entry - .getKey())); - } - if (!partialAddSet.isEmpty()) { - entry.getValue().addAll(partialAddSet); - addSet.addAll(partialAddSet); - partialAddSet.clear(); - modifiedFlag = true; - } - } - } - } while (modifiedFlag); - - // Add the msg - addSet.add(msg); - - // Add the set to the list - followersList.addAll(addSet); - - return followersList; - } - - public static List<Message> followersList(Message msg, List<Message> msgList) { - if (msgList.contains(msg)) { - List<Message> returnList = new ArrayList<Message>(); - returnList.addAll(msgList.subList(msgList.indexOf(msg) + 1, msgList - .size())); - return returnList; - } else - return new ArrayList<Message>(); - } - - public static boolean isLastOS(OccurrenceSpecification mos) { - // If there is no ordering, we will consider as the last MOS - if (mos.getGeneralOrderings().size() == 0) - return true; - - // If the After attribute matches with itself, then it is the last MOS - if (mos.getGeneralOrderings().get(0).getAfter() == mos) - return true; - else - return false; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/InteractionViewInitializationUtil.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/InteractionViewInitializationUtil.java deleted file mode 100644 index 15b5a497a30..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/InteractionViewInitializationUtil.java +++ /dev/null @@ -1,1110 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz - Initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.util; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.MessageSort; -import org.eclipse.uml2.uml.Package; - -import org.eclipse.papyrus.diagram.common.commands.AddEObjectReferencesToDiagram; -import org.eclipse.papyrus.diagram.common.command.wrappers.GEFtoEMFCommandWrapper; -import org.eclipse.papyrus.diagram.common.commands.GMFToEMFCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLLinkDescriptor; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -public class InteractionViewInitializationUtil { - - /** - * Helper classes for location and size data - */ - public class InitDataFigure { - EObject eObject = null; - List<InitDataFigure> children = null; - } - - /** - * A <Node> size and location data. - * - * @author fjcano - * - */ - public class NodeInitDataFigure extends InitDataFigure { - Point size = null; - Point location = null; - } - - /** - * An <Edge> start and end data. - * - * @author fjcano - * - */ - public class EdgeInitDataFigure extends InitDataFigure { - Point start = null; - Point end = null; - } - - /* - * - */ - - // //** Constants and fixed values **//// - protected static final int Interaction_Minimun_Size_X = 400; - protected static final int Interaction_Minimun_Size_Y = 250; - protected static final int Interaction_Offset_X = 40; - protected static final int Interaction_Offset_Y = 40; - protected static final int Interaction_Title_Size = 20; - - protected static final int Lifeline_Minimun_Size_X = 100; - protected static final int Lifeline_Minimun_Size_Y = 100; - protected static final int Lifeline_Offset_X = 20; - protected static final int Lifeline_Title_Size = 20; - - protected static final int BES_Minimun_Size_X = 16; - protected static final int BES_Minimun_Size_Y = 60; - protected static final int BES_Offset_X = 20; - - protected static final int Message_Slot_Size_Y = 40; - protected static final int Message_BES_Offset = 10; - - // //** General, auxiliary functions and methods for initializing an - // interaction with Lifelines, Behaviour Execution Specifications and - // Messages **//// - - private static final InteractionViewInitializationUtil INSTANCE = new InteractionViewInitializationUtil(); - - protected static int getTotalMessagesSize( - List<List<Message>> orderedMessages) { - if (orderedMessages == null) { - return 0; - } - return orderedMessages.size(); - } - - /** - * Main size initialization method. - * - * @param interaction - * @param orderedMessages - * @return - */ - public static NodeInitDataFigure calculateInteractionInitData( - Interaction interaction, List<List<Message>> orderedMessages, - Point offset) { - // Interaction initialization data. - NodeInitDataFigure interactionInitDataFigure = INSTANCE.new NodeInitDataFigure(); - // set Interaction - interactionInitDataFigure.eObject = interaction; - // prepare children's list - interactionInitDataFigure.children = new ArrayList<InitDataFigure>(); - // set Interaction real size - Point size = new Point(0, 0); - size.x = calculateInterationWidth(interaction, orderedMessages); - size.y = calculateInteractionHeight(interaction, orderedMessages); - interactionInitDataFigure.size = size; - interactionInitDataFigure.location = new Point(0, 0); - // add Lifelines initialization data. - addLifelinesToInteraction(interactionInitDataFigure, orderedMessages); - // add Messages and BES - addMessagesAndBESToInteraction(interactionInitDataFigure, - orderedMessages); - addOffsetToDataFigure(interactionInitDataFigure, offset); - return interactionInitDataFigure; - } - - protected static void addOffsetToDataFigure(InitDataFigure dataFigure, - Point offset) { - if (dataFigure == null || offset == null - || (offset.x == 0 && offset.y == 0)) { - return; - } - if (dataFigure instanceof NodeInitDataFigure) { - NodeInitDataFigure nodeData = (NodeInitDataFigure) dataFigure; - nodeData.location.x += offset.x; - nodeData.location.y += offset.y; - } - if (dataFigure instanceof EdgeInitDataFigure) { - EdgeInitDataFigure edgeData = (EdgeInitDataFigure) dataFigure; - edgeData.start.x += offset.x; - edgeData.start.y += offset.y; - edgeData.end.x += offset.x; - edgeData.end.y += offset.y; - } - if (dataFigure.children != null) { - for (InitDataFigure childFigure : dataFigure.children) { - addOffsetToDataFigure(childFigure, offset); - } - } - } - - /** - * Calculates <Interaction> height. - * - * @param interaction - * @param orderedMessages - * @return - */ - protected static int calculateInteractionHeight(Interaction interaction, - List<List<Message>> orderedMessages) { - int height = 0; - height = calculateLifelineHeight(interaction, orderedMessages); - height += Interaction_Offset_Y * 2; - height += Interaction_Title_Size; - return height >= Interaction_Minimun_Size_Y ? height - : Interaction_Minimun_Size_Y; - } - - /** - * Calculates <Interaction> width. - * - * @param interaction - * @param orderedMessages - * @return - */ - protected static int calculateInterationWidth(Interaction interaction, - List<List<Message>> orderedMessages) { - int width = 0; - if (interaction.getLifelines() != null - && interaction.getLifelines().size() > 0) { - int nLifelines = interaction.getLifelines().size(); - width += nLifelines - * calculateLifelineWidth(interaction, orderedMessages); - width += (nLifelines - 1) * Lifeline_Offset_X; - width += Interaction_Offset_X * 2; - } - return width >= Interaction_Minimun_Size_X ? width - : Interaction_Minimun_Size_X; - } - - /** - * Calculates <Lifeline> height. - * - * @param interaction - * @param orderedMessages - * @return - */ - protected static int calculateLifelineHeight(Interaction interaction, - List<List<Message>> orderedMessages) { - int height = 0; - height = getTotalMessagesSize(orderedMessages); - height *= Message_Slot_Size_Y; - height += Message_BES_Offset * 2; - height += Lifeline_Title_Size; - return height >= Lifeline_Minimun_Size_Y ? height - : Lifeline_Minimun_Size_Y; - } - - /** - * Calculates <Lifeline> width. - * - * @param interaction - * @param orderedMessages - * @return - */ - protected static int calculateLifelineWidth(Interaction interaction, - List<List<Message>> orderedMessages) { - int width = 0; - return width >= Lifeline_Minimun_Size_X ? width - : Lifeline_Minimun_Size_X; - } - - protected static int calculateBESXOffset(NodeInitDataFigure rootData, - Lifeline lifeline) { - return calculateLifelineXCenter(lifeline, rootData); - } - - /** - * Modified by gmerin - */ - protected static int calculateLifelineXCenter(Lifeline lifeline, - NodeInitDataFigure rootData) { - if (lifeline == null || rootData == null) { - return -1; - } - NodeInitDataFigure lifelineData = findElementNodeData(rootData, - lifeline); - if (lifelineData.location == null || lifelineData.size == null) { - return -1; - } - return (lifelineData.location.x + (lifelineData.size.x / 2)); - } - - /** - * Added - * - * @author gmerin - */ - protected static int calculateBESXEdge(BehaviorExecutionSpecification bes, - NodeInitDataFigure rootData, Boolean isSourceEnd) { - if (bes == null || rootData == null || isSourceEnd == null) { - return -1; - } - NodeInitDataFigure besData = findElementNodeData(rootData, bes); - if (besData == null || besData.location == null || besData.size == null) { - return -1; - } - if (isSourceEnd) - return (besData.location.x + besData.size.x - 1); - else - return (besData.location.x); - } - - /** - * Modified by gmerin - */ - protected static int calculateMessageEndXOffset(Element element, - NodeInitDataFigure rootData, Boolean isSourceEnd) { - if (element instanceof Lifeline) { - return calculateLifelineXCenter((Lifeline) element, rootData); - } else if (element instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = ((BehaviorExecutionSpecification) element); - if (bes.getCovereds().size() > 0) { - // Lifeline lifeline = bes.getCovereds().get(0); - // return calculateLifelineXCenter(lifeline, rootData); - return calculateBESXEdge(bes, rootData, isSourceEnd); - } else { - return -1; - } - } else { - return -1; - } - } - - protected static void addLifelinesToInteraction( - NodeInitDataFigure interactionData, - List<List<Message>> orderedMessages) { - // sanity check - if (interactionData == null || orderedMessages == null - || orderedMessages.size() <= 0) { - return; - } - Interaction interaction = interactionData.eObject instanceof Interaction ? (Interaction) interactionData.eObject - : null; - if (interaction == null) { - return; - } - int xOffset = Interaction_Offset_X, yOffset = Interaction_Offset_Y - + Interaction_Title_Size; - int width = calculateLifelineWidth(interaction, orderedMessages); - int height = calculateLifelineHeight(interaction, orderedMessages); - for (Lifeline lifeline : interaction.getLifelines()) { - NodeInitDataFigure lifelineData = initLifelineData(xOffset, - yOffset, width, height, lifeline); - if (lifelineData != null) { - interactionData.children.add(lifelineData); - xOffset += width + Lifeline_Offset_X; - } - } - } - - /** - * Adds Messages and BES to the Lifelines. - * - * @param interactionData - * @param orderedMessages - */ - protected static void addMessagesAndBESToInteraction( - NodeInitDataFigure interactionData, - List<List<Message>> orderedMessages) { - // sanity check - if (interactionData == null || orderedMessages == null - || orderedMessages.size() <= 0) { - return; - } - Interaction interaction = interactionData.eObject instanceof Interaction ? (Interaction) interactionData.eObject - : null; - if (interaction == null) { - return; - } - int yOffset = Interaction_Title_Size + Interaction_Offset_Y - + Lifeline_Title_Size + Message_Slot_Size_Y - + Message_BES_Offset; - - // added by gmerin - // To store the BES that added to the interactionData as ends of the - // messages - List<BehaviorExecutionSpecification> addedBESList = new BasicEList<BehaviorExecutionSpecification>(); - // end gmerin - - for (List<Message> messages : orderedMessages) { - // a slot/position can have more than one Message - for (Message message : messages) { - // Message source and target MOS - MessageOccurrenceSpecification sourceMOS = message - .getSendEvent() instanceof MessageOccurrenceSpecification ? (MessageOccurrenceSpecification) message - .getSendEvent() - : null; - MessageOccurrenceSpecification targetMOS = message - .getReceiveEvent() instanceof MessageOccurrenceSpecification ? (MessageOccurrenceSpecification) message - .getReceiveEvent() - : null; - // sanity check - if (sourceMOS == null || targetMOS == null) { - continue; - } - // Message source and target - Element source = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - // source and target Lifelines - to calculate x offsets - Lifeline sourceLifeline = getMOSLifeline(sourceMOS); - Lifeline targetLifeline = getMOSLifeline(targetMOS); - // do we have to create any BES figure at source ? - if (source instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification sourceBES = (BehaviorExecutionSpecification) source; - - // added by gmerin - addedBESList.add(sourceBES); - // end gmerin - - // is this the first Message of a BES ? - if (sourceBES.getStart() != null - && sourceBES.getStart().equals(sourceMOS)) { - int y = yOffset; - int x = calculateBESXOffset(interactionData, - sourceLifeline) - - (BES_Minimun_Size_X / 2); - addStartBES(x, y, sourceBES, sourceLifeline, - interactionData); - } - // is this the last Message of a BES ? - if (sourceBES.getFinish() != null - && sourceBES.getFinish().equals(sourceMOS)) { - int y = yOffset; - addEndBES(BES_Minimun_Size_X, y, sourceBES, - sourceLifeline, interactionData); - } - } // end source BES - // do we have to create any BES at target ? - if (target instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification targetBES = (BehaviorExecutionSpecification) target; - - // added by gmerin - addedBESList.add(targetBES); - // end gmerin - - // is the first Message of a BES ? - if (targetBES.getStart() != null - && targetBES.getStart().equals(targetMOS)) { - int y = yOffset; - int x = calculateBESXOffset(interactionData, - targetLifeline) - - (BES_Minimun_Size_X / 2); - addStartBES(x, y, targetBES, targetLifeline, - interactionData); - } - // is the last Message of a BES ? - if (targetBES.getFinish() != null - && targetBES.getFinish().equals(targetMOS)) { - int y = yOffset; - addEndBES(BES_Minimun_Size_X, y, targetBES, - targetLifeline, interactionData); - } - } // end target BES - // init edge figure data - EdgeInitDataFigure messageData = INSTANCE.new EdgeInitDataFigure(); - messageData.eObject = message; - // a message won't have children - messageData.children = Collections.EMPTY_LIST; - // y will be the same for source and target - int y = yOffset; - int xOffsetSrc = 0, xOffsetDst = 0; - // Modified by gmerin - xOffsetSrc = calculateMessageEndXOffset(source, - interactionData, true); - xOffsetDst = calculateMessageEndXOffset(target, - interactionData, false); - // start and end point of the Message edge. - messageData.start = new Point(xOffsetSrc, y); - messageData.end = new Point(xOffsetDst, y); - // add Message figure data - interactionData.children.add(messageData); - } - // increase y offset - yOffset += Message_Slot_Size_Y; - } - - // Added by gmerin - // All the BES that are ends of messages have been considered in the - // above - // code. Now is the turn of the BES that do not have messages anchored - // to them - int auxMaxYOffset = yOffset; - for(Lifeline lifeline : interaction.getLifelines()) { - int auxYOffset = yOffset; - int auxXOffset = calculateLifelineXCenter(lifeline, interactionData) - - BES_Minimun_Size_X / 2; - - List<BehaviorExecutionSpecification> notAddedBESList = MessageCommonUtil - .getLifelineBESList(lifeline); - notAddedBESList.removeAll(addedBESList); - - for (BehaviorExecutionSpecification bes : notAddedBESList) { - addStartBES(auxXOffset, auxYOffset, bes, lifeline, - interactionData); - addEndBES(BES_Minimun_Size_X, auxYOffset, bes, lifeline, - interactionData); - auxYOffset += Message_Slot_Size_Y; - } - - // Increase the height of the lifeline - if (auxYOffset - yOffset > 0) { - NodeInitDataFigure node = findElementNodeData(interactionData, - lifeline); - if (node != null && node.size != null) - node.size.y += (auxYOffset - yOffset) + Message_BES_Offset - * 2; - // Update the auxMaxYOffset in case is bigger than before - auxMaxYOffset = auxYOffset > auxMaxYOffset ? auxYOffset - : auxMaxYOffset; - } - } - // Increase the height of the Interaction - if (auxMaxYOffset - yOffset > 0) { - if (interactionData.size != null) - interactionData.size.y += (auxMaxYOffset - yOffset); - } - // end gmerin - } - - /** - * Modified by gmerin - */ - protected static void addStartBES(int x, int y, - BehaviorExecutionSpecification bes, Lifeline lifeline, - NodeInitDataFigure interactionData) { - NodeInitDataFigure BESData = startInitBESData(x, y, bes); - NodeInitDataFigure lifelineData = findElementNodeData(interactionData, - lifeline); - if (lifelineData != null) { - if (lifelineData.children == null) { - lifelineData.children = new ArrayList<InitDataFigure>(); - } - lifelineData.children.add(BESData); - } - } - - /** - * Modified by gmerin - */ - protected static void addEndBES(int width, int y, - BehaviorExecutionSpecification bes, Lifeline lifeline, - NodeInitDataFigure interactionData) { - // get the NodeInitDataFigure corresponding to the Lifeline - NodeInitDataFigure lifelineData = findElementNodeData(interactionData, - lifeline); - if (lifelineData == null || lifelineData.children == null - || lifelineData.children.size() <= 0) { - return; - } - // look in that Lifeline children figures for a corresponding BES figure - for (InitDataFigure dataFigure : lifelineData.children) { - if (dataFigure != null && dataFigure.eObject != null - && dataFigure.eObject.equals(bes)) { - if (dataFigure instanceof NodeInitDataFigure) { - // correct BES figure found -> set size - int initialY = ((NodeInitDataFigure) dataFigure).location.y; - ((NodeInitDataFigure) dataFigure).size = new Point(width, - (y - initialY) + Message_BES_Offset); - } - } - } - } - - protected static NodeInitDataFigure initLifelineData(int xOffset, - int yOffset, int width, int height, Lifeline lifeline) { - NodeInitDataFigure lifelineData = INSTANCE.new NodeInitDataFigure(); - lifelineData.eObject = lifeline; - lifelineData.location = new Point(xOffset, yOffset); - lifelineData.size = new Point(width, height); - lifelineData.children = new ArrayList<InitDataFigure>(); - return lifelineData; - } - - protected static NodeInitDataFigure startInitBESData(int xOffset, - int yOffset, BehaviorExecutionSpecification bes) { - NodeInitDataFigure BESData = INSTANCE.new NodeInitDataFigure(); - BESData.eObject = bes; - BESData.location = new Point(xOffset, yOffset - Message_BES_Offset); - BESData.children = new ArrayList<InitDataFigure>(); - // no size, as we don't know yet the height - BESData.size = new Point(0, 0); - return BESData; - } - - protected static NodeInitDataFigure endInitBESData(int width, int height, - NodeInitDataFigure BESData) { - if (BESData != null) { - BESData.size = new Point(width, height); - } - return BESData; - } - - /** - * Modified by gmerin - */ - protected static NodeInitDataFigure findElementNodeData( - InitDataFigure rootData, Element element) { - // sanity check - if (rootData == null || element == null) { - return null; - } - if (rootData.eObject != null && rootData.eObject.equals(element)) { - return rootData instanceof NodeInitDataFigure ? (NodeInitDataFigure) rootData - : null; - } - if (rootData.children == null || rootData.children.size() <= 0) { - return null; - } - for (InitDataFigure dataFigure : rootData.children) { - InitDataFigure elementDataFigure = findElementNodeData(dataFigure, - element); - if (elementDataFigure instanceof NodeInitDataFigure) { - return (NodeInitDataFigure) elementDataFigure; - } - } - return null; - } - - protected static Lifeline getMOSLifeline(MessageOccurrenceSpecification mos) { - if (mos == null) { - return null; - } - if (mos.getCovereds().size() <= 0) { - return null; - } - return mos.getCovereds().get(0); - } - - // //** View creation **//// - - public static void createViews(IGraphicalEditPart parentEditPart, - NodeInitDataFigure interactionData) { - // Map relating the EObjects and their EditParts - Map<EObject, IGraphicalEditPart> mapEObject2EditPart = new HashMap<EObject, IGraphicalEditPart>(); - // create nodes views - // - create Interaction View - createInteractionView(interactionData, parentEditPart, - mapEObject2EditPart); - IGraphicalEditPart interactionEditPart = mapEObject2EditPart - .get(interactionData.eObject); - // - create Lifelines Views - createLifelineViews(interactionData, interactionEditPart, - mapEObject2EditPart); - // - create BES Views - createBESViews(interactionData, mapEObject2EditPart); - // - create Message Views - TransactionalEditingDomain domain = parentEditPart.getEditingDomain(); - createMessageViews(interactionData, parentEditPart, mapEObject2EditPart); - // add element's created views to the Diagram list of references. - if (parentEditPart.getNotationView() instanceof Diagram) { - Diagram diagram = (Diagram) parentEditPart.getNotationView(); - Set<EObject> elements = mapEObject2EditPart.keySet(); - addReferencesToDiagram(diagram, elements, domain); - } - } - - protected static void createInteractionView( - NodeInitDataFigure interactionData, - IGraphicalEditPart parentEditPart, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - // - create Interaction View - Interaction interaction = interactionData.eObject instanceof Interaction ? (Interaction) interactionData.eObject - : null; - String semanticHint = getInteractionSemanticHint(parentEditPart); - ViewDescriptor interactionViewDescriptor = new ViewDescriptor( - new EObjectAdapter(interactionData.eObject), Node.class, - semanticHint, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - CreateViewRequest createInteractionViewRequest = new CreateViewRequest( - interactionViewDescriptor); - createInteractionViewRequest.setLocation(interactionData.location); - createInteractionViewRequest.setSize(new Dimension( - interactionData.size.x, interactionData.size.y)); - IGraphicalEditPart interactionEditPart = createView(parentEditPart, - createInteractionViewRequest); - if (interactionEditPart != null) { - interactionEditPart.getFigure().getUpdateManager().performUpdate(); - mapEObject2EditPart.put(interactionData.eObject, - interactionEditPart); - } - } - - protected static String getInteractionSemanticHint( - IGraphicalEditPart parentEditPart) { - if (parentEditPart == null - || parentEditPart.resolveSemanticElement() == null) { - return null; - } - EObject element = parentEditPart.resolveSemanticElement(); - if (element instanceof Package) { - return String.valueOf(InteractionEditPart.VISUAL_ID); - } else if (element instanceof Interaction) { - return String.valueOf(Interaction2EditPart.VISUAL_ID); - } - return null; - } - - protected static void createLifelineViews(InitDataFigure interactionData, - IGraphicalEditPart interactionEditPart, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - IGraphicalEditPart parentEditPart = null; - for (Object child : interactionEditPart.getChildren()) { - // careful here, a CompartmentEditPart is looked for here because we - // know that it is applicable to the Interaction figure; other - // figures may need other logic - if (child instanceof CompartmentEditPart) { - parentEditPart = (CompartmentEditPart) child; - } - } - - for (InitDataFigure dataFigure : interactionData.children) { - if (dataFigure instanceof NodeInitDataFigure - && dataFigure.eObject instanceof Lifeline) { - Lifeline lifeline = (Lifeline) dataFigure.eObject; - IGraphicalEditPart createdEditPart = findLifelineEditPart( - lifeline, mapEObject2EditPart); - NodeInitDataFigure nodeDataFigure = (NodeInitDataFigure) dataFigure; - if (createdEditPart != null) { - // the view and its editpart already existed; we - // destroy them to recreate them with the proper - // location and size - DeleteCommand deleteCommand = new DeleteCommand( - createdEditPart.getNotationView()); - parentEditPart.getEditingDomain().getCommandStack() - .execute(new GMFToEMFCommand(deleteCommand)); - } - ViewDescriptor viewDescriptor = new ViewDescriptor( - new EObjectAdapter(lifeline), Node.class, String - .valueOf(LifelineEditPart.VISUAL_ID), - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - CreateViewRequest createViewRequest = new CreateViewRequest( - viewDescriptor); - createViewRequest.setLocation(nodeDataFigure.location); - createViewRequest.setSize(new Dimension(nodeDataFigure.size.x, - nodeDataFigure.size.y)); - createdEditPart = createView(parentEditPart, createViewRequest); - if (createdEditPart != null) { - createdEditPart.getFigure().getUpdateManager() - .performUpdate(); - mapEObject2EditPart.put(nodeDataFigure.eObject, - createdEditPart); - } - } - } - } - - protected static IGraphicalEditPart findLifelineEditPart(Lifeline lifeline, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - if (lifeline != null && mapEObject2EditPart != null) { - Interaction interaction = lifeline.getInteraction(); - IGraphicalEditPart interactionEditPart = mapEObject2EditPart - .get(interaction); - if (interactionEditPart != null) { - return searchEObjectInEditPart(lifeline, interactionEditPart); - } - } - return null; - } - - protected static Point calculateLocationDelta(IGraphicalEditPart editPart, - Point finalLocation) { - Point locationDelta = new Point(0, 0); - if (editPart != null && finalLocation != null) { - Rectangle bounds = editPart.getFigure().getBounds(); - locationDelta.x = finalLocation.x - bounds.x; - locationDelta.y = finalLocation.y - bounds.y; - } - return locationDelta; - } - - protected static Dimension calculateSizeDelta(IGraphicalEditPart editPart, - Point finalSize) { - Dimension dimensionDelta = new Dimension(0, 0); - if (editPart != null && finalSize != null) { - Rectangle bounds = editPart.getFigure().getBounds(); - dimensionDelta.width = finalSize.x - bounds.width; - dimensionDelta.height = finalSize.y - bounds.height; - } - return dimensionDelta; - } - - protected static IGraphicalEditPart searchEObjectInEditPart( - EObject eObject, IGraphicalEditPart editPart) { - if (eObject != null && editPart != null) { - if (eObject.equals(editPart.resolveSemanticElement())) { - return editPart; - } - for (Object childEditPart : editPart.getChildren()) { - if (childEditPart instanceof IGraphicalEditPart) { - IGraphicalEditPart foundEditPart = searchEObjectInEditPart( - eObject, (IGraphicalEditPart) childEditPart); - if (foundEditPart != null) { - return foundEditPart; - } - } - } - } - return null; - } - - protected static void createBESViews(InitDataFigure interactionData, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - for (InitDataFigure dataFigure : interactionData.children) { - if (dataFigure instanceof NodeInitDataFigure - && dataFigure.eObject instanceof Lifeline) { - NodeInitDataFigure lifelineData = (NodeInitDataFigure) dataFigure; - for (InitDataFigure initFigure : lifelineData.children) { - if (initFigure instanceof NodeInitDataFigure - && initFigure.eObject instanceof BehaviorExecutionSpecification) { - NodeInitDataFigure BESData = (NodeInitDataFigure) initFigure; - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) BESData.eObject; - IGraphicalEditPart createdEditPart = findBESEditPart( - bes, mapEObject2EditPart); - IGraphicalEditPart parentEditPart = null; - if (mapEObject2EditPart - .containsKey(lifelineData.eObject)) { - parentEditPart = mapEObject2EditPart - .get(lifelineData.eObject); - } - if (createdEditPart != null) { - // the view and its editpart already existed; we - // destroy them to recreate them with the proper - // location and size - DeleteCommand deleteCommand = new DeleteCommand( - createdEditPart.getNotationView()); - parentEditPart - .getEditingDomain() - .getCommandStack() - .execute(new GMFToEMFCommand(deleteCommand)); - } - ViewDescriptor viewDescriptor = new ViewDescriptor( - new EObjectAdapter(BESData.eObject), - Node.class, - String - .valueOf(BehaviorExecutionSpecificationEditPart.VISUAL_ID), - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - CreateViewRequest createRequest = new CreateViewRequest( - viewDescriptor); - createRequest.setLocation(BESData.location); - createRequest.setSize(new Dimension(BESData.size.x, - BESData.size.y)); - if (parentEditPart != null) { - createdEditPart = createView(parentEditPart, - createRequest); - } - if (createdEditPart != null) { - createdEditPart.getFigure().getUpdateManager() - .performUpdate(); - mapEObject2EditPart.put(BESData.eObject, - createdEditPart); - } - } - } - } - } - } - - protected static IGraphicalEditPart findBESEditPart( - BehaviorExecutionSpecification bes, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - if (bes != null && bes.getCovereds().size() > 0 - && mapEObject2EditPart != null) { - Lifeline lifeline = bes.getCovereds().get(0); - IGraphicalEditPart lifelineEditPart = mapEObject2EditPart - .get(lifeline); - if (lifelineEditPart != null) { - return searchEObjectInEditPart(bes, lifelineEditPart); - } - } - return null; - } - - protected static Lifeline findContainerLifeline(Interaction interaction, - BehaviorExecutionSpecification bes) { - if (interaction == null || bes == null) { - return null; - } - for (Lifeline lifeline : interaction.getLifelines()) { - for (BehaviorExecutionSpecification childBes : MessageCommonUtil - .getLifelineBESList(lifeline)) { - if (bes.equals(childBes)) { - return lifeline; - } - } - } - return null; - } - - protected static void createMessageViews(InitDataFigure interactionData, - IGraphicalEditPart parentEditPart, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - TransactionalEditingDomain domain = parentEditPart.getEditingDomain(); - if (domain != null) { - for (InitDataFigure dataFigure : interactionData.children) { - if (dataFigure instanceof EdgeInitDataFigure - && dataFigure.eObject instanceof Message) { - EdgeInitDataFigure edgeFigure = (EdgeInitDataFigure) dataFigure; - Message message = (Message) dataFigure.eObject; - Element source = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - String semanticHint = getMessageSemanticHint(message); - IElementType type = getMessageElementType(message); - UMLLinkDescriptor linkDescriptor = new UMLLinkDescriptor( - source, target, message, type, Integer - .valueOf(semanticHint)); - ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor( - linkDescriptor.getSemanticAdapter(), semanticHint, - ViewUtil.APPEND, false, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - CreateConnectionViewRequest createRequest = new CreateConnectionViewRequest( - viewDescriptor); - createRequest.setLocation(edgeFigure.start); - createRequest - .setType(RequestConstants.REQ_CONNECTION_START); - - IGraphicalEditPart sourceEditPart = mapEObject2EditPart - .get(source); - if (sourceEditPart != null) { - createRequest.setSourceEditPart(sourceEditPart); - sourceEditPart.getCommand(createRequest); - createRequest.setLocation(edgeFigure.end); - createRequest - .setType(RequestConstants.REQ_CONNECTION_END); - IGraphicalEditPart targetEditPart = mapEObject2EditPart - .get(target); - if (targetEditPart != null) { - createRequest.setTargetEditPart(targetEditPart); - Command command = targetEditPart - .getCommand(createRequest); - if (command.canExecute() == false) { - continue; - } - domain.getCommandStack().execute( - new GEFtoEMFCommandWrapper(command)); - refreshEditPart(interactionData, - mapEObject2EditPart); - View view = getCreatedViewFromRequest(createRequest); - if (view != null) { - IGraphicalEditPart editPart = (IGraphicalEditPart) parentEditPart - .getViewer().getEditPartRegistry().get( - view); - if (editPart != null) { - mapEObject2EditPart.put(message, editPart); - } - } - } - } - } - } // for (figures) - } // if (domain != null) - } - - protected static void addReferencesToDiagram(Diagram diagram, - Set<EObject> elements, TransactionalEditingDomain domain) { - if (diagram == null || elements == null || elements.size() <= 0 - || domain == null) { - return; - } - List<EObject> eObjects = new ArrayList<EObject>(elements); - AddEObjectReferencesToDiagram command = new AddEObjectReferencesToDiagram( - domain, diagram, eObjects, false); - domain.getCommandStack().execute(new GMFToEMFCommand(command)); - } - - protected static IGraphicalEditPart createView( - IGraphicalEditPart parentEditPart, CreateViewRequest request) { - if (getAndExecuteCommand(parentEditPart, request)) { - View view = getCreatedViewFromRequest(request); - if (view != null) { - if (parentEditPart.getViewer().getEditPartRegistry() - .containsKey(view)) { - Object value = parentEditPart.getViewer() - .getEditPartRegistry().get(view); - if (value instanceof IGraphicalEditPart) { - return (IGraphicalEditPart) value; - } - } - } - } - return null; - } - - protected static View getCreatedViewFromRequest(CreateViewRequest request) { - View view = null; - Object newObject = request.getNewObject(); - if (newObject instanceof List) { - List<Object> adaptersList = ((List) newObject); - for (int i = 0; i < adaptersList.size(); i++) { - Object object = adaptersList.get(i); - if (object instanceof IAdaptable) { - Object adapted = ((IAdaptable) object) - .getAdapter(View.class); - if (adapted instanceof View) { - view = (View) adapted; - } - } - } - } - return view; - } - - protected static View getCreatedViewFromRequest( - CreateConnectionViewRequest request) { - View view = null; - Object newObject = request.getNewObject(); - if (newObject instanceof IAdaptable) { - Object object = ((IAdaptable) newObject).getAdapter(View.class); - if (object instanceof View) { - view = ((View) object); - } - } - return view; - } - - protected static boolean getAndExecuteCommand( - IGraphicalEditPart parentEditPart, Request request) { - if (parentEditPart == null || parentEditPart.getEditingDomain() == null - || request == null) { - return false; - } - Command command = parentEditPart.getCommand(request); - if (command == null) { - return false; - } - TransactionalEditingDomain domain = parentEditPart.getEditingDomain(); - domain.getCommandStack().execute(new GEFtoEMFCommandWrapper(command)); - parentEditPart.refresh(); - return true; - } - - protected static String getMessageSemanticHint(Message message) { - String hint = ""; - if (message != null) { - switch (message.getMessageSort().getValue()) { - case MessageSort.SYNCH_CALL: - hint = String.valueOf(MessageEditPart.VISUAL_ID); - break; - case MessageSort.ASYNCH_CALL: - hint = String.valueOf(Message2EditPart.VISUAL_ID); - break; - case MessageSort.REPLY: - hint = String.valueOf(Message3EditPart.VISUAL_ID); - break; - case MessageSort.ASYNCH_SIGNAL: - hint = String.valueOf(Message4EditPart.VISUAL_ID); - break; - case MessageSort.CREATE_MESSAGE: - hint = String.valueOf(Message5EditPart.VISUAL_ID); - break; - case MessageSort.DELETE_MESSAGE: - hint = String.valueOf(Message6EditPart.VISUAL_ID); - break; - default: - break; - } - } - return hint; - } - - protected static IElementType getMessageElementType(Message message) { - IElementType type = null; - if (message != null) { - switch (message.getMessageSort().getValue()) { - case MessageSort.SYNCH_CALL: - type = UMLElementTypes.Message_3001; - break; - case MessageSort.ASYNCH_CALL: - type = UMLElementTypes.Message_3002; - break; - case MessageSort.REPLY: - type = UMLElementTypes.Message_3003; - break; - case MessageSort.ASYNCH_SIGNAL: - type = UMLElementTypes.Message_3004; - break; - case MessageSort.CREATE_MESSAGE: - type = UMLElementTypes.Message_3005; - break; - case MessageSort.DELETE_MESSAGE: - type = UMLElementTypes.Message_3006; - break; - default: - break; - } - } - return type; - } - - protected static void refreshEditPart(InitDataFigure dataFigure, - Map<EObject, IGraphicalEditPart> mapEObject2EditPart) { - if (dataFigure == null) { - return; - } - IGraphicalEditPart editPart = null; - if (dataFigure.eObject != null) { - editPart = mapEObject2EditPart.get(dataFigure.eObject); - if (editPart != null) { - editPart.refresh(); - } - } - if (dataFigure.children == null) { - return; - } - for (InitDataFigure childFigure : dataFigure.children) { - refreshEditPart(childFigure, mapEObject2EditPart); - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/MessageCommonUtil.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/MessageCommonUtil.java deleted file mode 100644 index d20c0b16f68..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/custom-src/org/eclipse/papyrus/diagram/sequence/util/MessageCommonUtil.java +++ /dev/null @@ -1,961 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Initial API implementation - * Javier Muñoz (Prodevelop) - Messages are updated when properties changes - * Franciso Javier Cano Muñoz (Prodevelop) - New operations added - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.util; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.ConnectionAnchor; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.gef.ConnectionEditPart; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.CallEvent; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Event; -import org.eclipse.uml2.uml.InstanceValue; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.LiteralBoolean; -import org.eclipse.uml2.uml.LiteralInteger; -import org.eclipse.uml2.uml.LiteralString; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageEnd; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.OccurrenceSpecification; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.ReceiveOperationEvent; -import org.eclipse.uml2.uml.SendOperationEvent; -import org.eclipse.uml2.uml.ValueSpecification; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageOrderCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; - -public class MessageCommonUtil { - - /** - * Returns the source Element (a BES or a Lifeline) of a Message. - * - * @author Gabriel Merin - * @param msg - * @return The source Element - */ - public static Element getMessageSrc(Message msg) { - if (msg.getSendEvent() != null - && msg.getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mos = (MessageOccurrenceSpecification) msg - .getSendEvent(); - - if (mos.getCovereds().size() > 0) { - Element element = mos.getCovereds().get(0); - - // element should always be an instance of Lifeline - if (element instanceof Lifeline) { - // Check if the message source is connected to the Lifeline - // or to one of its owned BehaviorExecutionSpecifications - Lifeline lifeline = (Lifeline) element; - - // Get the BES's from the lifeline - EList<BehaviorExecutionSpecification> besList = getLifelineBESList(lifeline); - - // Fore each BES, check if it is contained within its - // start/finish boundaries - for (BehaviorExecutionSpecification bes : besList) { - // A MOS might be contained within the boundaries of - // more than one BE (remember that BES can contained - // sub-BES) - BehaviorExecutionSpecification mostToRightBes = null; - if (isOSinBES(mos, bes)) { - // We want the most-to-right BES - if (mostToRightBes == null - || MessageOrderCommand.isOS1AfterOS2(bes - .getStart(), mostToRightBes - .getStart())) - mostToRightBes = bes; - } - element = mostToRightBes != null ? mostToRightBes - : element; - } - } - - return element; - } - } - return null; - } - - /** - * Returns the destination Element (a BES or a Lifeline) of a Message. - * - * @author Gabriel Merin - * @param msg - * @return The destination Element - */ - public static Element getMessageDst(Message msg) { - if (msg.getReceiveEvent() != null - && msg.getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mos = (MessageOccurrenceSpecification) msg - .getReceiveEvent(); - - if (mos.getCovereds().size() > 0) { - Element element = mos.getCovereds().get(0); - - // element should always be an instance of Lifeline - if (element instanceof Lifeline) { - // Check if the message target is connected to the Lifeline - // or to one of its owned BehaviorExecutionSpecifications - Lifeline lifeline = (Lifeline) element; - - // Get the BES's from the lifeline - EList<BehaviorExecutionSpecification> besList = getLifelineBESList(lifeline); - - // Fore each BES, check if it is the source of the msg - for (BehaviorExecutionSpecification bes : besList) { - // A MOS might be contained within the boundaries of - // more than one BE (remember that BES can contained - // sub-BES) - BehaviorExecutionSpecification mostToRightBes = null; - if (isOSinBES(mos, bes)) { - // We want the most-to-right BES - if (mostToRightBes == null - || MessageOrderCommand.isOS1AfterOS2(bes - .getStart(), mostToRightBes - .getStart())) - mostToRightBes = bes; - } - element = mostToRightBes != null ? mostToRightBes - : element; - } - } - - return element; - } - } - return null; - } - - /** - * Returns the destination Lifeline of a Message. - * - * @param message - * @return - */ - public static Lifeline getMessageSrcLifeline(Message message) { - if (message == null) { - return null; - } - Element source = MessageCommonUtil.getMessageSrc(message); - if (source instanceof BehaviorExecutionSpecification) { - if (((BehaviorExecutionSpecification) source).getCovereds().size() > 0 - && ((BehaviorExecutionSpecification) source).getCovereds() - .get(0) instanceof Lifeline) { - source = ((BehaviorExecutionSpecification) source) - .getCovereds().get(0); - } - } - if (source instanceof Lifeline) { - return (Lifeline) source; - } - return null; - } - - /** - * Returns the destination Lifeline of a Message. - * - * @param message - * @return - */ - public static Lifeline getMessageDstLifeline(Message message) { - if (message == null) { - return null; - } - Element target = MessageCommonUtil.getMessageDst(message); - if (target instanceof BehaviorExecutionSpecification) { - if (((BehaviorExecutionSpecification) target).getCovereds().size() > 0 - && ((BehaviorExecutionSpecification) target).getCovereds() - .get(0) instanceof Lifeline) { - target = ((BehaviorExecutionSpecification) target) - .getCovereds().get(0); - } - } - if (target instanceof Lifeline) { - return (Lifeline) target; - } - return null; - } - - /** - * Returns a list with the BESs drawn within a Lifeline (It is important to - * mention that a BES is physically contained in a Interaction but drawn in - * a Lifeline) - * - * @author Gabriel Merin - * @param lifeline - * @return an EList with the BES - */ - public static EList<BehaviorExecutionSpecification> getLifelineBESList( - Lifeline lifeline) { - EList<BehaviorExecutionSpecification> besList = new BasicEList<BehaviorExecutionSpecification>(); - - // Get the Interaction where the Lifeline is contained. - Interaction interaction = lifeline.getInteraction(); - - if (interaction == null) - return besList; - - // Get all the BES contained in the Interaction. Only store those - // coveredBy the lifeline. - for (Iterator i = interaction.getFragments().iterator(); i.hasNext();) { - InteractionFragment fragment = (InteractionFragment) i.next(); - if (fragment instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) fragment; - if (bes.getCovereds().size() > 0 - && bes.getCovereds().get(0) == lifeline) { - besList.add((BehaviorExecutionSpecification) fragment); - } - } - - } - - // Return the besList - return besList; - } - - /** - * Returns true if an OS is contained between the BES.start and BES.finish - * Occurrence Specifications. It is important to take into account that the - * passed OS might be within the start/finish properties of a Sub-BES. - * - * @author Gabriel Merin - * @param os - * @param bes - * @return true if the OS intersects, false otherwise - */ - public static boolean isOSinBES(OccurrenceSpecification os, - BehaviorExecutionSpecification bes) { - if (bes.getStart() == os || bes.getFinish() == os) { - return true; - } - - if (bes.getStart() == null || bes.getFinish() == null) { - return false; - } - - if (MessageOrderCommand.isOS1AfterOS2(os, bes.getStart()) - && MessageOrderCommand.isOS1BeforeOS2(os, bes.getFinish())) { - return true; - } - - // In other case - return false; - } - - /** - * Checks if one of the end points is already occupied with another - * connection figure. NOTE: This is used to avoid the creation of two links - * with the same end points. - * - * @author Gabriel Merin - * @param request - * @return true if connection - */ - public static boolean checkFreeConnectionEnds(Request request) { - - if (request instanceof CreateConnectionViewAndElementRequest) { - - CreateConnectionViewAndElementRequest createRequest = (CreateConnectionViewAndElementRequest) request; - - ShapeNodeEditPart sourceEP, targetEP; - ConnectionAnchor sourceAnchor, targetAnchor; - Point targetRefLocation, sourceRefLocation; - Point targetLocation, sourceLocation; - - sourceEP = (ShapeNodeEditPart) createRequest.getSourceEditPart(); - targetEP = (ShapeNodeEditPart) createRequest.getTargetEditPart(); - - // Source and Target should not be anchored at the same EditPart - // either - if (sourceEP == targetEP) - return false; - - ICommandProxy icp = (ICommandProxy) createRequest.getStartCommand(); - - CompositeCommand cc = ((CompositeCommand) icp.getICommand()); - Iterator iterator = cc.iterator(); - // 0: (nothing interesting) - iterator.next(); - // 1: SetConnectionEndsCommand - iterator.next(); - // 2: SetConnectionAnchorsCommand - iterator.next(); - // 3: SetConnectionBendpointsCommand - SetConnectionBendpointsCommand scbp = (SetConnectionBendpointsCommand) iterator - .next(); - - sourceRefLocation = scbp.getSourceRefPoint(); - targetRefLocation = scbp.getTargetRefPoint(); - - sourceAnchor = ((NodeFigure) sourceEP.getFigure()) - .getSourceConnectionAnchorAt(sourceRefLocation); - targetAnchor = targetEP.getTargetConnectionAnchor(createRequest); - - targetLocation = targetAnchor.getLocation(sourceAnchor - .getLocation(sourceRefLocation)); - - sourceLocation = sourceAnchor.getLocation(targetAnchor - .getLocation(targetRefLocation)); - - // Source and Target should not be anchored at the same point - if (sourceLocation.x == targetLocation.x - && sourceLocation.y == targetLocation.y) - return false; - - if (checkFreeEnd(sourceEP, sourceLocation) - && checkFreeEnd(targetEP, targetLocation)) { - return true; - } else { - return false; - } - - } - - if (request instanceof ReconnectRequest - && ((ReconnectRequest) request).getTarget() instanceof ShapeNodeEditPart) { - ReconnectRequest reconnectRequest = (ReconnectRequest) request; - - ShapeNodeEditPart sourceEP; - ShapeNodeEditPart targetEP; - ShapeNodeEditPart endEP; - - ConnectionAnchor sourceAnchor; - ConnectionAnchor targetAnchor; - - Point endLocation; - - sourceEP = (ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getSource(); - targetEP = (ShapeNodeEditPart) reconnectRequest - .getConnectionEditPart().getTarget(); - - if (reconnectRequest.isMovingStartAnchor()) { - // Update the corresponding EditPart - sourceEP = (ShapeNodeEditPart) reconnectRequest.getTarget(); - - sourceAnchor = sourceEP - .getSourceConnectionAnchor(reconnectRequest); - targetAnchor = targetEP - .getTargetConnectionAnchor(reconnectRequest - .getConnectionEditPart()); - endLocation = sourceAnchor.getLocation( - targetAnchor.getReferencePoint()).getCopy(); - endEP = sourceEP; - } else { - // Update the corresponding EditPart - targetEP = (ShapeNodeEditPart) reconnectRequest.getTarget(); - - sourceAnchor = sourceEP - .getSourceConnectionAnchor(reconnectRequest - .getConnectionEditPart()); - targetAnchor = targetEP - .getTargetConnectionAnchor(reconnectRequest); - endLocation = targetAnchor.getLocation( - sourceAnchor.getReferencePoint()).getCopy(); - endEP = targetEP; - } - - // Source and Target should not be anchored at the same EditPart - // either - if (sourceEP == targetEP) - return false; - - if (checkFreeEnd(endEP, endLocation, reconnectRequest - .getConnectionEditPart())) { - return true; - } else { - return false; - } - - } - - return false; - } - - /** - * Checks if a Point is already occupied by an existing connection end. - * - * @author Gabriel Merin - * @param shapeEP - * @param endLocation - * @return true if the passed point is free, false otherwise - */ - public static boolean checkFreeEnd(ShapeNodeEditPart shapeEP, - Point endLocation) { - return checkFreeEnd(shapeEP, endLocation, null); - } - - /** - * Checks if a Point is already occupied by an existing connection end. A - * connection EditPart can be passed in order to avoid the checking of that - * connection. - * - * @author Gabriel Merin - * @param shapeEP - * @param endLocation - * @param connection - * EditPart to avoid checking - * @return true if the passed point is free, false otherwise - */ - public static boolean checkFreeEnd(ShapeNodeEditPart shapeEP, - Point endLocation, ConnectionEditPart connEPToAvoid) { - List<EditPart> sourceConnections = new BasicEList<EditPart>(); - sourceConnections.addAll(shapeEP.getSourceConnections()); - - // Remove from the list the connection EditPart to avoid - if (connEPToAvoid != null) { - sourceConnections.remove(connEPToAvoid); - } - - // Discard connections whose semantic element is different from Message - removeNonMessageConnections(sourceConnections); - - for (Iterator i = sourceConnections.iterator(); i.hasNext();) { - ConnectionEditPart linkEP = (ConnectionEditPart) i.next(); - - Point existingLocation; - - ShapeNodeEditPart sourceEP = shapeEP; - ShapeNodeEditPart targetEP = (ShapeNodeEditPart) linkEP.getTarget(); - - ConnectionAnchor sourceAnchor = sourceEP - .getSourceConnectionAnchor(linkEP); - ConnectionAnchor targetAnchor = targetEP - .getTargetConnectionAnchor(linkEP); - - existingLocation = sourceAnchor.getLocation(targetAnchor - .getReferencePoint()); - - if (endLocation.y == existingLocation.y) { - return false; - } - } - - List<EditPart> targetConnections = new BasicEList<EditPart>(); - targetConnections.addAll(shapeEP.getTargetConnections()); - - // Remove from the list the connection EditPart to avoid - if (connEPToAvoid != null) { - targetConnections.remove(connEPToAvoid); - } - - // Discard connections whose semantic element is different from Message - removeNonMessageConnections(targetConnections); - - for (Iterator i = targetConnections.iterator(); i.hasNext();) { - ConnectionEditPart linkEP = (ConnectionEditPart) i.next(); - - Point existingLocation; - - ShapeNodeEditPart sourceEP = (ShapeNodeEditPart) linkEP.getSource(); - ShapeNodeEditPart targetEP = shapeEP; - - ConnectionAnchor targetAnchor = targetEP - .getTargetConnectionAnchor(linkEP); - ConnectionAnchor sourceAnchor = sourceEP - .getSourceConnectionAnchor(linkEP); - - existingLocation = targetAnchor.getLocation(sourceAnchor - .getReferencePoint()); - - if (endLocation.y == existingLocation.y) { - return false; - } - } - - return true; - } - - /** - * Returns the Operation from the Send Operation Event of the Message. - * - * @author Gabriel Merin - * @param msg - * @return the Operation if exists, null otherwise - */ - public static Operation getMessageSendOperation(Message msg) { - return getMessageOperation(msg, true); - } - - /** - * Returns the Operation from the Receive Operation Event of the Message. - * - * @author Gabriel Merin - * @param msg - * @return the Operation if exists, null otherwise - */ - public static Operation getMessageReceiveOperation(Message msg) { - return getMessageOperation(msg, false); - } - - /** - * Used by '{@link #getMessageSendOperation() - * <em>Message Send Operation</em>}' and ' - * {@link #getMessageReceiveOperation() <em>Message Receive Operation</em>}' - * to obtain the operation from the Send/Receive Operation Event. - * - * @author Gabriel Merin - * @param msg - * @param getSendOp - * @return the Operation if exists, null otherwise - */ - public static Operation getMessageOperation(Message msg, Boolean getSendOp) { - MessageEnd msgEnd; - - if (getSendOp) { - msgEnd = msg.getSendEvent(); - } else { - msgEnd = msg.getReceiveEvent(); - } - - if (msgEnd instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosEnd = (MessageOccurrenceSpecification) msgEnd; - Event event = mosEnd.getEvent(); - - if (event instanceof SendOperationEvent) { - return ((SendOperationEvent) event).getOperation(); - } - - if (event instanceof ReceiveOperationEvent) { - return ((ReceiveOperationEvent) event).getOperation(); - } - - if (event instanceof CallEvent) { - return ((CallEvent) event).getOperation(); - } - - } - return null; - } - - /** - * Returns the sent Event of a Message. - * - * @param msg - * @return The Event if exists - */ - public static Event getMessageSendEvent(Message msg) { - return getMessageEvent(msg, true); - } - - /** - * Returns the received Event of a Message - * - * @param msg - * @return - */ - public static Event getMessageReceiveEvent(Message msg) { - return getMessageEvent(msg, false); - } - - /** - * Used by '{@link #getMessageSendEvent() <em>Message Send Event</em>}' and - * '{@link #getMessageReceiveEvent() <em>Message Receive Event</em>}'. It - * returns the sent/received Event of a Message. - * - * @author Gabriel Merin - * @param msg - * @param getSendOp - * @return the Sent/Received Event if exists, null otherwise - */ - public static Event getMessageEvent(Message msg, Boolean getSendOp) { - MessageEnd msgEnd; - - if (getSendOp) { - msgEnd = msg.getSendEvent(); - } else { - msgEnd = msg.getReceiveEvent(); - } - - if (msgEnd instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosEnd = (MessageOccurrenceSpecification) msgEnd; - return mosEnd.getEvent(); - - } - return null; - } - - /** - * Given a Message and an Operation, it returns a String representing the - * Operation appropriately. - * - * @author Gabriel Merin - * @param msg - * @param op - * @return a String representing the Operation - */ - public static String getMessageOperationString(Message msg, Operation op) { - String returnString; - - // Name of the operation - returnString = op.getName(); - - returnString += "("; - - // The value of the parameters is in the message itself - for (Iterator<ValueSpecification> i = msg.getArguments().iterator(); i - .hasNext();) { - ValueSpecification value = i.next(); - - if (value.getName() != null - && value.getName().compareTo("return") == 0) { - continue; - } - - if (value instanceof LiteralString) { - LiteralString lString = ((LiteralString) value); - returnString += "\""; - if (lString.isSetValue()) { - returnString += lString.getValue(); - } - returnString += "\""; - } else if (value instanceof LiteralBoolean) { - returnString += ((LiteralBoolean) value).stringValue(); - } else if (value instanceof LiteralInteger) { - returnString += ((LiteralInteger) value).getValue(); - } else if (value instanceof InstanceValue) { - if (((InstanceValue) value).getInstance() != null) - returnString += ((InstanceValue) value).getInstance() - .getName(); - else - returnString += "null"; - } else { - returnString += "?"; - } - - // if there are more elements, add a comma - if (i.hasNext()) - returnString += ", "; - } - - returnString += ")"; - - return returnString; - } - - /** - * Obtains the Message EditPart associated with the Start property of the - * BES. - * - * @author Gabriel Merin - * @param besEP - * @return returns the ConnectionNodeEditPart that represents the - * MessageEditPart. If no connection is not found, null is returned. - */ - public static ConnectionNodeEditPart getBESStartMessageEditPart( - BehaviorExecutionSpecificationEditPart besEP) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) besEP - .resolveSemanticElement(); - return getMessageEditPart(bes.getStart(), besEP); - } - - /** - * Obtains the Message EditPart associated with the Finish property of the - * BES. - * - * @author Gabriel Merin - * @param besEP - * @return returns the ConnectionNodeEditPart that represents the - * MessageEditPart. If no connection is not found, null is returned. - */ - public static ConnectionNodeEditPart getBESFinishMessageEditPart( - BehaviorExecutionSpecificationEditPart besEP) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) besEP - .resolveSemanticElement(); - return getMessageEditPart(bes.getFinish(), besEP); - } - - /** - * Used by '{@link #getBESStartMessageEditPart() - * <em>BES Start Message Edit Part</em>}' and ' - * {@link #getBESFinishMessageEditPart() - * <em>BES Finish Message Edit Part</em>}' It returns the Message EditPart - * associated with an OS. - * - * @author Gabriel Merin - * @param os - * @param besEP - * @return returns the ConnectionNodeEditPart that represents the - * MessageEditPart. If no connection is found, null is returned. - */ - public static ConnectionNodeEditPart getMessageEditPart( - OccurrenceSpecification os, - BehaviorExecutionSpecificationEditPart besEP) { - - // Loop through source connections - List sourceList = besEP.getSourceConnections(); - for (Iterator i = sourceList.iterator(); i.hasNext();) { - ConnectionNodeEditPart conn = (ConnectionNodeEditPart) i.next(); - if (conn.resolveSemanticElement() instanceof Message) { - Message msg = (Message) conn.resolveSemanticElement(); - if (msg.getSendEvent() == os) - return conn; - } else - continue; - } - - // Loop through target connections - List targetList = besEP.getTargetConnections(); - for (Iterator i = targetList.iterator(); i.hasNext();) { - ConnectionNodeEditPart conn = (ConnectionNodeEditPart) i.next(); - if (conn.resolveSemanticElement() instanceof Message) { - Message msg = (Message) conn.resolveSemanticElement(); - if (msg.getReceiveEvent() == os) - return conn; - } - } - - // If no connection edit part found, return null - return null; - } - - /** - * Returns the intersection point between a Shape Node EditPart and the - * source of a Connection EditPart. Used by ' - * {@link #getMessageEndIntersectionPoint() - * <em>Message End Intersection Point</em>}'. - * - * - * @author Gabriel Merin - * @param shapeEP - * @param connEP - * @return the intersection Point - */ - public static Point getSourceIntersectionPoint(ShapeNodeEditPart shapeEP, - ConnectionNodeEditPart connEP) { - return getIntersectionPoint(shapeEP, connEP, true); - } - - /** - * Returns the intersection point between a Shape Node EditPart and the - * target of a Connection EditPart. Used by ' - * {@link #getMessageEndIntersectionPoint() - * <em>Message End Intersection Point</em>}'. - * - * @author Gabriel Merin - * @param shapeEP - * @param connEP - * @return the intersection Point - */ - public static Point getTargetIntersectionPoint(ShapeNodeEditPart shapeEP, - ConnectionNodeEditPart connEP) { - return getIntersectionPoint(shapeEP, connEP, false); - } - - /** - * Used by '{@link #getSourceIntersectionPoint() - * <em>Source Intersection Point</em>}' and ' - * {@link #getTargetIntersectionPoint() <em>Target Intersection Point</em>} - * '. It returns the intersection point between a Shape Node EditPart and - * the source/target of a Connection EditPart (depends on the source value) - * - * @author Gabriel Merin - * @param shapeEP - * @param connEP - * @param source - * @return the intersection Point - */ - public static Point getIntersectionPoint(ShapeNodeEditPart shapeEP, - ConnectionNodeEditPart connEP, boolean source) { - Point p; - ConnectionAnchor cAnchor; - - if (source == true && shapeEP.getSourceConnections().contains(connEP)) { - cAnchor = shapeEP.getSourceConnectionAnchor(connEP); - p = cAnchor.getReferencePoint().getCopy(); - return p; - } - - if (source == false && shapeEP.getTargetConnections().contains(connEP)) { - cAnchor = shapeEP.getSourceConnectionAnchor(connEP); - p = cAnchor.getReferencePoint().getCopy(); - return p; - } - - // If the connEP was not within shapeEP connections then return null - return null; - } - - /** - * Returns the intersection point between a Shape Node EditPart and the end - * of a Connection EditPart indicated by the OS. - * - * @author Gabriel Merin - * @param shapeEP - * @param connEP - * @param os - * @return the intersection Point - */ - public static Point getMessageEndIntersectionPoint( - ShapeNodeEditPart shapeEP, ConnectionNodeEditPart connEP, - OccurrenceSpecification os) { - Message msg = (Message) connEP.resolveSemanticElement(); - if (msg.getSendEvent() == os) - return getSourceIntersectionPoint(shapeEP, connEP); - if (msg.getReceiveEvent() == os) - return getTargetIntersectionPoint(shapeEP, connEP); - - return null; - } - - /** - * Checks if the semantic hint (a VISUAL_ID string) matches any of the - * MessageEditPart's VISUAL_ID. - * - * @author Gabriel Merin - * @param semanticHint - * @return true if the there is a match among any of VISUAL_IDs from the - * Message EditParts. - */ - public static boolean isMessageEditPart(String semanticHint) { - - switch (Integer.valueOf(semanticHint)) { - case MessageEditPart.VISUAL_ID: - return true; - case Message2EditPart.VISUAL_ID: - return true; - case Message3EditPart.VISUAL_ID: - return true; - case Message4EditPart.VISUAL_ID: - return true; - case Message5EditPart.VISUAL_ID: - return true; - case Message6EditPart.VISUAL_ID: - return true; - default: - return false; - } - } - - /** - * Checks if the connectionEP given as a parameter is instance of any of the - * Message EditParts - * - * @author Gabriel Merin - * @param connectionEP - * @return true in case the connectionEP is instance of any of the Message - * EditParts, false otherwise. - */ - public static boolean isMessageEditPart(ConnectionEditPart connectionEP) { - if (connectionEP instanceof MessageEditPart) - return true; - if (connectionEP instanceof Message2EditPart) - return true; - if (connectionEP instanceof Message3EditPart) - return true; - if (connectionEP instanceof Message4EditPart) - return true; - if (connectionEP instanceof Message5EditPart) - return true; - if (connectionEP instanceof Message6EditPart) - return true; - - return false; - } - - /** - * Removes from a EditPart List all the elements that are not instances of - * ConnectionNodeEditPart and whose semantic element is different from - * Message - * - * @author Gabriel Merin - * @param epList - */ - public static void removeNonMessageConnections(List<EditPart> epList) { - List<EditPart> messageList = new BasicEList<EditPart>(); - for (Iterator<EditPart> i = epList.iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof ConnectionNodeEditPart) { - if (((ConnectionNodeEditPart) obj).resolveSemanticElement() instanceof Message) { - messageList.add((EditPart) obj); - } - } - } - epList.retainAll(messageList); - } - - /** - * It returns the casting of msg.getSendEvent() to - * MessageOccurrenceSpecification if possible, otherwise it returns null. - * - * @author Gabriel Merin - * @param msg - * @return The source MessageOccurrenceSpecification of the given message - */ - public static MessageOccurrenceSpecification getMessageSrcMOS(Message msg) { - return getMessageMOS(msg, true); - } - - /** - * It returns the casting of msg.getReceiveEvent() to - * MessageOccurrenceSpecification if possible, otherwise it returns null. - * - * @author Gabriel Merin - * @param msg - * @return The target MessageOccurrenceSpecification of the given message - */ - public static MessageOccurrenceSpecification getMessageDstMOS(Message msg) { - return getMessageMOS(msg, false); - } - - /** - * It returns the casting of msg.getSendEvent() (source=true) or - * msg.getReceiveEvent() (source=false) to MessageOccurrenceSpecification if - * possible, otherwise it returns null. - * - * @author Gabriel Merin - * @param msg - * @param source - * @return The source or target MessageOccurrenceSpecification - */ - private static MessageOccurrenceSpecification getMessageMOS(Message msg, - boolean source) { - MessageEnd msgEnd; - if (source) { - msgEnd = msg.getSendEvent(); - } else { - msgEnd = msg.getReceiveEvent(); - } - if (msgEnd instanceof MessageOccurrenceSpecification) - return (MessageOccurrenceSpecification) msgEnd; - else - return null; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/icons/SequenceDiagram.gif b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/icons/SequenceDiagram.gif Binary files differdeleted file mode 100644 index be5c62bae5c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/icons/SequenceDiagram.gif +++ /dev/null diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/messages.properties b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/messages.properties deleted file mode 100644 index 47054eece13..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/messages.properties +++ /dev/null @@ -1,123 +0,0 @@ -########################################################################################## -# Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat -# de la Comunitat Valenciana . All rights reserved. This program -# and the accompanying materials are made available under the terms of the -# Eclipse Public License v1.0 which accompanies this distribution, and is -# available at http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation -# -######################################################################################## -# TODO: manually put keys and values -UMLCreationWizardTitle=New UMLSequence Diagram -UMLCreationWizard_DiagramModelFilePageTitle=Create UMLSequence Diagram -UMLCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model. -UMLCreationWizard_DomainModelFilePageTitle=Create UMLSequence Diagram -UMLCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model. -UMLCreationWizardOpenEditorError=Error opening diagram editor -UMLCreationWizardCreationError=Creation Problems -UMLCreationWizardPageExtensionError=File name should have {0} extension. -UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0} -UMLDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files -UMLDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model -UMLDocumentProvider_isModifiable=Updating cache failed -UMLDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource -UMLDocumentProvider_IncorrectInputError={1} -UMLDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource -UMLDocumentProvider_DiagramLoadingError=Error loading diagram -UMLDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system -UMLDocumentProvider_SaveDiagramTask=Saving diagram -UMLDocumentProvider_SaveNextResourceTask=Saving {0} -UMLDocumentProvider_SaveAsOperation=Saving {0} diagram as -UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle=Error -UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage=Model file loading failed -UMLInitDiagramFileAction_InitDiagramFileWizardTitle=Initialize new {0} diagram file -UMLInitDiagramFileAction_OpenModelFileDialogTitle=Select domain model -UMLNewDiagramFileWizard_CreationPageName=Initialize new diagram file -UMLNewDiagramFileWizard_CreationPageTitle=Diagram file -UMLNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content -UMLNewDiagramFileWizard_RootSelectionPageName=Select diagram root element -UMLNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element -UMLNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram -UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element: -UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected -UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected -UMLNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents -UMLNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object -UMLDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted. -UMLDiagramEditor_SaveAsErrorTitle=Problem During Save As... -UMLDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor. -UMLDiagramEditor_SaveErrorTitle=Save Problems -UMLDiagramEditor_SaveErrorMessage=Could not save file. -UMLElementChooserDialog_SelectModelElementTitle=Select model element -ModelElementSelectionPageMessage=Select model element: -ValidateActionMessage=Validate -Interaction1Group_title=Interaction -Interaction1Group_desc= -Objects2Group_title=Objects -Objects2Group_desc= -Messages3Group_title=Messages -Interaction1CreationTool_title=Interaction -Interaction1CreationTool_desc=Create an Interaction -Lifeline1CreationTool_title=Lifeline -Lifeline1CreationTool_desc=Create a Lifeline -ExecutionBehaviour2CreationTool_title=Execution Behaviour -ExecutionBehaviour2CreationTool_desc=Create an Execution Behaviour -Callsynch1CreationTool_title=Call (synch.) -Callsynch1CreationTool_desc=Create a synchronous message call -Callasynch2CreationTool_title=Call (asynch.) -Callasynch2CreationTool_desc=Create an asynchronous message call -Reply3CreationTool_title=Reply -Reply3CreationTool_desc=Create a reply message -SendSignal5CreationTool_title=Send Signal -CreationEvent6CreationTool_title=Creation Event -DestructionEvent7CreationTool_title=Destruction Event -InteractionInteractionCompartmentEditPart_title=InteractionCompartment -InteractionInteractionCompartment2EditPart_title=InteractionCompartment - -CommandName_OpenDiagram=Open Diagram -NavigatorGroupName_Package_79_links=links -NavigatorGroupName_Interaction_1001_incominglinks=incoming links -NavigatorGroupName_Interaction_1001_outgoinglinks=outgoing links -NavigatorGroupName_Interaction_2001_incominglinks=incoming links -NavigatorGroupName_Interaction_2001_outgoinglinks=outgoing links -NavigatorGroupName_Lifeline_2002_incominglinks=incoming links -NavigatorGroupName_Lifeline_2002_outgoinglinks=outgoing links -NavigatorGroupName_BehaviorExecutionSpecification_2003_incominglinks=incoming links -NavigatorGroupName_BehaviorExecutionSpecification_2003_outgoinglinks=outgoing links -NavigatorGroupName_Message_3001_target=target -NavigatorGroupName_Message_3001_source=source -NavigatorGroupName_Message_3002_target=target -NavigatorGroupName_Message_3002_source=source -NavigatorGroupName_Message_3003_target=target -NavigatorGroupName_Message_3003_source=source -NavigatorGroupName_Message_3004_target=target -NavigatorGroupName_Message_3004_source=source -NavigatorGroupName_Message_3005_target=target -NavigatorGroupName_Message_3005_source=source -NavigatorGroupName_Message_3006_target=target -NavigatorGroupName_Message_3006_source=source -NavigatorActionProvider_OpenDiagramActionName=Open Diagram -AbstractParser_UnexpectedValueTypeMessage=Value of type {0} is expected -AbstractParser_WrongStringConversionMessage=String value does not convert to {0} value -AbstractParser_UnknownLiteralMessage=Unknown literal: {0} -MessageFormatParser_InvalidInputError=Invalid input at {0} -UMLModelingAssistantProviderTitle=Select domain model element -UMLModelingAssistantProviderMessage=Available domain model elements: -NavigatorGroupName_CombinedFragment_2004_incominglinks=incoming links -NavigatorGroupName_CombinedFragment_2004_outgoinglinks=outgoing links -CombinedFragment3CreationTool_title=CombinedFragment -CombinedFragment3CreationTool_desc=Create a CombinedFragment block -UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error -Comments4Group_title=Comments -Comment1CreationTool_title=Comment -Comment1CreationTool_desc=Create new Comment -CommentLink2CreationTool_title=Comment Link -CommentLink2CreationTool_desc=Link Comment -NavigatorGroupName_Package_1000_links=links -NavigatorGroupName_Comment_2005_incominglinks=incoming links -NavigatorGroupName_Comment_2005_outgoinglinks=outgoing links -NavigatorGroupName_ElementOwnedComment_3007_target=target -NavigatorGroupName_ElementOwnedComment_3007_source=source -NavigatorGroupName_CommentAnnotatedElement_3008_target=target -NavigatorGroupName_CommentAnnotatedElement_3008_source=source diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/classDiagram_constraints.gmfgraph b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/classDiagram_constraints.gmfgraph deleted file mode 100644 index ecfd24c03e2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/classDiagram_constraints.gmfgraph +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gmfgraph:Canvas xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="cnv_constraints"> - <figures - name=""> - <descriptors - name="ConstraintFigure"> - <actualFigure - xsi:type="gmfgraph:CustomFigure" - name="ConstraintFigure" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.MultilineConstraintFigure"> - <children - xsi:type="gmfgraph:Label" - name="ConstraintFigure_Value"> - <insets - top="5" - left="5" - bottom="5" - right="5"/> - <children - xsi:type="gmfgraph:Label" - name="ConstraintFigure_Value"> - <insets - top="5" - left="5" - bottom="5" - right="5"/> - </children> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="CommentFigure"> - <actualFigure - xsi:type="gmfgraph:ScalablePolygon" - name="CommentFigure"> - <layoutData - xsi:type="gmfgraph:GridLayoutData"/> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <backgroundColor - xsi:type="gmfgraph:ConstantColor"/> - <children - xsi:type="gmfgraph:Label" - name="CommentBody_label"> - <layoutData - xsi:type="gmfgraph:GridLayoutData" - grabExcessHorizontalSpace="true" - grabExcessVerticalSpace="true" - verticalAlignment="FILL" - horizontalAlignment="FILL"/> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - <insets - top="2" - left="2" - bottom="2" - right="15"/> - </children> - <template - x="90"/> - <template/> - <template - y="60"/> - <template - x="100" - y="60"/> - <template - x="100" - y="10"/> - <template - x="90"/> - <template - x="90" - y="10"/> - <template - x="100" - y="10"/> - <template - x="90"/> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.1/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="CommentLinkFigure"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="CommentLinkFigure" - lineKind="LINE_DASHDOT"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="lightGray"/> - </actualFigure> - </descriptors> - </figures> - <nodes - name="ConstraintNode" - figure="ConstraintFigure"/> - <nodes - name="CommentNode" - figure="CommentFigure"> - <facets - xsi:type="gmfgraph:DefaultSizeFacet"> - <defaultSize - dx="160" - dy="75"/> - </facets> - </nodes> - <connections - name="CommentLink" - figure="CommentLinkFigure"/> - <labels - name="Constraint_ValueSpecification" - figure="ConstraintFigure" - elementIcon="false" - accessor="//@figures.0/@descriptors.0/@accessors.0"/> - <labels - name="CommentBodyLabel" - figure="CommentFigure" - elementIcon="false" - accessor="//@figures.0/@descriptors.1/@accessors.0"/> -</gmfgraph:Canvas> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgen b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgen deleted file mode 100644 index a8cef89709d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgen +++ /dev/null @@ -1,2387 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<xmi:XMI xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:gmfgen="http://www.eclipse.org/gmf/2008/GenModel" - xmlns:mutating="http://es.cv.gvcase.mdt.common.gmfgenextension.mutating"> - <gmfgen:GenEditorGenerator - packageNamePrefix="es.cv.gvcase.mdt.uml2.diagram.sequence" - modelID="MOSKitt UMLSequence" - diagramFileExtension="sequenceuml_diagram" - dynamicTemplates="true" - templateDirectory="/es.cv.gvcase.mdt.uml2.diagram.def/dynamic-templates/codegen"> - <audits> - <categories - id="MOSKItt_Sequence_diagram_constraints" - name="MOSKitt Sequence diagram constraints" - description="UML2 sequence diagram constraints" - path="/0/@audits/@categories.0"/> - <categories - id="MOSKitt_Sequence_diagram_constraints_LIVE" - name="MOSKitt Sequence diagram constraints LIVE" - description="UML2 Sequence diagram constraints." - path="/0/@audits/@categories.0 /0/@audits/@categories.1" - audits="/0/@audits/@rules.0"/> - <rules - name="Unique name in model container" - description="Checks an element's name to be unique in its model container." - id="unique_name_in_model_container" - rule="/0/@expressionProviders/@providers.0/@expressions.10" - message="Another element exists qith that name." - useInLiveMode="true" - category="/0/@audits/@categories.1"> - <target - xsi:type="gmfgen:GenDomainElementTarget" - contextSelector="/0/@audits/@clientContexts.0"> - <element - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement"/> - </target> - </rules> - <clientContexts - ruleTargets="/0/@audits/@rules.0/@target"/> - </audits> - <diagram - visualID="79" - editPartClassName="PackageEditPart" - itemSemanticEditPolicyClassName="PackageItemSemanticEditPolicy" - notationViewFactoryClassName="PackageViewFactory" - canonicalEditPolicyClassName="PackageCanonicalEditPolicy" - iconProviderPriority="Low" - creationWizardCategoryID="es.cv.gvcase.mdt.uml2.diagram" - editingDomainID="es.cv.gvcase.mdt.uml2.diagram.SharedEditingDomainID" - validationProviderPriority="Low"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="PackageEditHelper"/> - <viewmap - xsi:type="gmfgen:FigureViewmap" - figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/> - <containsShortcutsTo>uml</containsShortcutsTo> - <shortcutsProvidedFor>UMLSequence</shortcutsProvidedFor> - <domainDiagramElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/> - <childNodes - visualID="2001" - editPartClassName="Interaction2EditPart" - itemSemanticEditPolicyClassName="Interaction2ItemSemanticEditPolicy" - notationViewFactoryClassName="Interaction2ViewFactory" - canonicalEditPolicyClassName="Interaction2CanonicalEditPolicy" - compartments="/0/@diagram/@compartments.1" - graphicalNodeEditPolicyClassName="Interaction2GraphicalNodeEditPolicy" - createCommandClassName="Interaction2CreateCommand" - containers="/0/@diagram/@compartments.1 /0/@diagram/@compartments.0"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:SpecializationType" - metamodelType="/0/@diagram/@topLevelNodes.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="InteractionRectangleFigure" - classBody="
/**
 * @generated
 */
public class InteractionRectangleFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureInteractionLabelFigure; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureInteractionCompartmentFigure; 


	/**
	 * @generated
	 */
	public InteractionRectangleFigure() {
		
	org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();
	this.setLayoutManager(layoutThis);

		this.setFill(false);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
this.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


org.eclipse.draw2d.RectangleFigure interactionLabel0 = new org.eclipse.draw2d.RectangleFigure();
interactionLabel0.setFill(false);
interactionLabel0.setOutline(false);

this.add(interactionLabel0, org.eclipse.draw2d.BorderLayout.TOP);

	org.eclipse.draw2d.BorderLayout layoutInteractionLabel0 = new org.eclipse.draw2d.BorderLayout();
	interactionLabel0.setLayoutManager(layoutInteractionLabel0);



es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure interactionLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure();



interactionLabelContainer1.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));

interactionLabel0.add(interactionLabelContainer1, org.eclipse.draw2d.BorderLayout.LEFT);

	es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout layoutInteractionLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout();


	interactionLabelContainer1.setLayoutManager(layoutInteractionLabelContainer1);



fFigureInteractionLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureInteractionLabelFigure.setText("");

fFigureInteractionLabelFigure.setFont(FFIGUREINTERACTIONLABELFIGURE_FONT);



interactionLabelContainer1.add(fFigureInteractionLabelFigure);





fFigureInteractionCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();
fFigureInteractionCompartmentFigure.setFill(false);
fFigureInteractionCompartmentFigure.setOutline(false);
fFigureInteractionCompartmentFigure.setLineWidth(0);
	fFigureInteractionCompartmentFigure.setForegroundColor(org.eclipse.draw2d.ColorConstants.white);

this.add(fFigureInteractionCompartmentFigure, org.eclipse.draw2d.BorderLayout.CENTER);


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureInteractionLabelFigure() {
		return fFigureInteractionLabelFigure;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureInteractionCompartmentFigure() {
		return fFigureInteractionCompartmentFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREINTERACTIONLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 10, org.eclipse.swt.SWT.BOLD);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="600" - height="400"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.0"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - </modelFacet> - <labels - visualID="4003" - editPartClassName="InteractionName2EditPart" - itemSemanticEditPolicyClassName="InteractionName2ItemSemanticEditPolicy" - notationViewFactoryClassName="InteractionName2ViewFactory"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureInteractionLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="sd: {0} " - editorPattern="{0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - </childNodes> - <childNodes - visualID="2002" - editPartClassName="LifelineEditPart" - itemSemanticEditPolicyClassName="LifelineItemSemanticEditPolicy" - notationViewFactoryClassName="LifelineViewFactory" - canonicalEditPolicyClassName="LifelineCanonicalEditPolicy" - childNodes="/0/@diagram/@childNodes.2" - graphicalNodeEditPolicyClassName="LifelineGraphicalNodeEditPolicy" - createCommandClassName="LifelineCreateCommand" - containers="/0/@diagram/@compartments.1 /0/@diagram/@compartments.0"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="LifelineEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="LifelineFigure" - classBody="
/**
 * @generated
 */
public class LifelineFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureLifelineLabelFigure; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureExecutionsContainerFigure; 


	/**
	 * @generated
	 */
	public LifelineFigure() {
		
	org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();
	this.setLayoutManager(layoutThis);

		this.setFill(false);
this.setOutline(false);
this.setPreferredSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(100)
, getMapMode().DPtoLP(200)
));
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


org.eclipse.draw2d.RectangleFigure lifelineNameContainerFigure0 = new org.eclipse.draw2d.RectangleFigure();
	lifelineNameContainerFigure0.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
	lifelineNameContainerFigure0.setBackgroundColor(LIFELINENAMECONTAINERFIGURE0_BACK
);

lifelineNameContainerFigure0.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(7)
));

this.add(lifelineNameContainerFigure0, org.eclipse.draw2d.BorderLayout.TOP);
lifelineNameContainerFigure0.setLayoutManager(new org.eclipse.draw2d.StackLayout());


fFigureLifelineLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureLifelineLabelFigure.setText("Lifeline");

fFigureLifelineLabelFigure.setFont(FFIGURELIFELINELABELFIGURE_FONT);



fFigureLifelineLabelFigure.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(0)
));

lifelineNameContainerFigure0.add(fFigureLifelineLabelFigure);




fFigureExecutionsContainerFigure = new org.eclipse.draw2d.RectangleFigure();
fFigureExecutionsContainerFigure.setFill(false);
fFigureExecutionsContainerFigure.setOutline(false);

this.add(fFigureExecutionsContainerFigure, org.eclipse.draw2d.BorderLayout.CENTER);
fFigureExecutionsContainerFigure.setLayoutManager(new org.eclipse.draw2d.StackLayout());


es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure lifelineLineFigure1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure();



fFigureExecutionsContainerFigure.add(lifelineLineFigure1);



org.eclipse.draw2d.RectangleFigure executionsContainerFigure1 = new org.eclipse.draw2d.RectangleFigure();
executionsContainerFigure1.setFill(false);
executionsContainerFigure1.setOutline(false);

fFigureExecutionsContainerFigure.add(executionsContainerFigure1, org.eclipse.draw2d.BorderLayout.CENTER);
executionsContainerFigure1.setLayoutManager(new org.eclipse.draw2d.StackLayout());


es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure lifelineLineFigure2 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure();



executionsContainerFigure1.add(lifelineLineFigure2);




	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureLifelineLabelFigure() {
		return fFigureLifelineLabelFigure;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureExecutionsContainerFigure() {
		return fFigureExecutionsContainerFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color LIFELINENAMECONTAINERFIGURE0_BACK = new org.eclipse.swt.graphics.Color(null, 253, 253, 221);

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGURELIFELINELABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 10, org.eclipse.swt.SWT.BOLD);

"> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="100" - height="250"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Lifeline"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/lifeline"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.1"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - </modelFacet> - <labels - visualID="4001" - editPartClassName="LifelineNameEditPart" - itemSemanticEditPolicyClassName="LifelineNameItemSemanticEditPolicy" - notationViewFactoryClassName="LifelineNameViewFactory"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureLifelineLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="{0}: %ADDSTEREOTYPES%" - editorPattern="{0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - </childNodes> - <childNodes - visualID="2003" - editPartClassName="BehaviorExecutionSpecificationEditPart" - itemSemanticEditPolicyClassName="BehaviorExecutionSpecificationItemSemanticEditPolicy" - notationViewFactoryClassName="BehaviorExecutionSpecificationViewFactory" - canonicalEditPolicyClassName="BehaviorExecutionSpecificationCanonicalEditPolicy" - graphicalNodeEditPolicyClassName="BehaviorExecutionSpecificationGraphicalNodeEditPolicy" - createCommandClassName="BehaviorExecutionSpecificationCreateCommand" - containers="/0/@diagram/@childNodes.1"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="BehaviorExecutionSpecificationEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="BehaviourExecutionFigure" - classBody="
/**
 * @generated
 */
public class BehaviourExecutionFigure extends org.eclipse.draw2d.RectangleFigure {




	/**
	 * @generated
	 */
	public BehaviourExecutionFigure() {
					this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
	this.setBackgroundColor(THIS_BACK
);
this.setMaximumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)
, getMapMode().DPtoLP(1000)
));
this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(16)
, getMapMode().DPtoLP(25)
));
	}


	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}





}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Color THIS_BACK = new org.eclipse.swt.graphics.Color(null, 255, 215, 174);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true" - fixedBackground="true"/> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="16" - height="60"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/BehaviorExecutionSpecification"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.2"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - </modelFacet> - </childNodes> - <childNodes - visualID="2004" - editPartClassName="CombinedFragmentEditPart" - itemSemanticEditPolicyClassName="CombinedFragmentItemSemanticEditPolicy" - notationViewFactoryClassName="CombinedFragmentViewFactory" - canonicalEditPolicyClassName="CombinedFragmentCanonicalEditPolicy" - graphicalNodeEditPolicyClassName="CombinedFragmentGraphicalNodeEditPolicy" - createCommandClassName="CombinedFragmentCreateCommand" - containers="/0/@diagram/@compartments.1 /0/@diagram/@compartments.0"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="CombinedFragmentEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CombinedFragmentFigure" - classBody="
/**
 * @generated
 */
public class CombinedFragmentFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureCombinedFragmentLabelFigure; 


	/**
	 * @generated
	 */
	public CombinedFragmentFigure() {
		
	org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();
	this.setLayoutManager(layoutThis);

		this.setFill(false);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
this.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


org.eclipse.draw2d.RectangleFigure combinedFragmentLabel0 = new org.eclipse.draw2d.RectangleFigure();
combinedFragmentLabel0.setFill(false);
combinedFragmentLabel0.setOutline(false);

this.add(combinedFragmentLabel0, org.eclipse.draw2d.BorderLayout.TOP);

	org.eclipse.draw2d.BorderLayout layoutCombinedFragmentLabel0 = new org.eclipse.draw2d.BorderLayout();
	combinedFragmentLabel0.setLayoutManager(layoutCombinedFragmentLabel0);



es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure combinedFragmentLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure();



combinedFragmentLabelContainer1.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));

combinedFragmentLabel0.add(combinedFragmentLabelContainer1, org.eclipse.draw2d.BorderLayout.LEFT);

	es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout layoutCombinedFragmentLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout();


	combinedFragmentLabelContainer1.setLayoutManager(layoutCombinedFragmentLabelContainer1);



fFigureCombinedFragmentLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureCombinedFragmentLabelFigure.setText("");

fFigureCombinedFragmentLabelFigure.setFont(FFIGURECOMBINEDFRAGMENTLABELFIGURE_FONT);



combinedFragmentLabelContainer1.add(fFigureCombinedFragmentLabelFigure);




	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureCombinedFragmentLabelFigure() {
		return fFigureCombinedFragmentLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGURECOMBINEDFRAGMENTLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 10, org.eclipse.swt.SWT.BOLD);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="200" - height="200"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CombinedFragment"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/fragment"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.3"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - </modelFacet> - <labels - visualID="4002" - editPartClassName="CombinedFragmentInteractionOperatorEditPart" - itemSemanticEditPolicyClassName="CombinedFragmentInteractionOperatorItemSemanticEditPolicy" - notationViewFactoryClassName="CombinedFragmentInteractionOperatorViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureCombinedFragmentLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern=""> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CombinedFragment/interactionOperator"/> - </modelFacet> - </labels> - </childNodes> - <topLevelNodes - visualID="1001" - editPartClassName="InteractionEditPart" - itemSemanticEditPolicyClassName="InteractionItemSemanticEditPolicy" - notationViewFactoryClassName="InteractionViewFactory" - canonicalEditPolicyClassName="InteractionCanonicalEditPolicy" - compartments="/0/@diagram/@compartments.0" - graphicalNodeEditPolicyClassName="InteractionGraphicalNodeEditPolicy" - createCommandClassName="InteractionCreateCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="InteractionEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="InteractionRectangleFigure" - classBody="
/**
 * @generated
 */
public class InteractionRectangleFigure extends org.eclipse.draw2d.RectangleFigure {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureInteractionLabelFigure; 
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RectangleFigure fFigureInteractionCompartmentFigure; 


	/**
	 * @generated
	 */
	public InteractionRectangleFigure() {
		
	org.eclipse.draw2d.BorderLayout layoutThis = new org.eclipse.draw2d.BorderLayout();
	this.setLayoutManager(layoutThis);

		this.setFill(false);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
this.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


org.eclipse.draw2d.RectangleFigure interactionLabel0 = new org.eclipse.draw2d.RectangleFigure();
interactionLabel0.setFill(false);
interactionLabel0.setOutline(false);

this.add(interactionLabel0, org.eclipse.draw2d.BorderLayout.TOP);

	org.eclipse.draw2d.BorderLayout layoutInteractionLabel0 = new org.eclipse.draw2d.BorderLayout();
	interactionLabel0.setLayoutManager(layoutInteractionLabel0);



es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure interactionLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure();



interactionLabelContainer1.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
, getMapMode().DPtoLP(3)
));

interactionLabel0.add(interactionLabelContainer1, org.eclipse.draw2d.BorderLayout.LEFT);

	es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout layoutInteractionLabelContainer1 = new es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout();


	interactionLabelContainer1.setLayoutManager(layoutInteractionLabelContainer1);



fFigureInteractionLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureInteractionLabelFigure.setText("");

fFigureInteractionLabelFigure.setFont(FFIGUREINTERACTIONLABELFIGURE_FONT);



interactionLabelContainer1.add(fFigureInteractionLabelFigure);





fFigureInteractionCompartmentFigure = new org.eclipse.draw2d.RectangleFigure();
fFigureInteractionCompartmentFigure.setFill(false);
fFigureInteractionCompartmentFigure.setOutline(false);
fFigureInteractionCompartmentFigure.setLineWidth(0);
	fFigureInteractionCompartmentFigure.setForegroundColor(org.eclipse.draw2d.ColorConstants.white);

this.add(fFigureInteractionCompartmentFigure, org.eclipse.draw2d.BorderLayout.CENTER);


	}




	/**
	 * @generated
	 */
	private boolean myUseLocalCoordinates = false;

	/**
	 * @generated
	 */
	protected boolean useLocalCoordinates() {
		return myUseLocalCoordinates;
	}

	/**
	 * @generated
	 */
	protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
		myUseLocalCoordinates = useLocalCoordinates;
	}



	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureInteractionLabelFigure() {
		return fFigureInteractionLabelFigure;
	}
	/**
	 * @generated
	 */
	public org.eclipse.draw2d.RectangleFigure getFigureInteractionCompartmentFigure() {
		return fFigureInteractionCompartmentFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREINTERACTIONLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 10, org.eclipse.swt.SWT.BOLD);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="600" - height="400"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package/packagedElement"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.0"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - </modelFacet> - <labels - visualID="4004" - editPartClassName="InteractionNameEditPart" - itemSemanticEditPolicyClassName="InteractionNameItemSemanticEditPolicy" - notationViewFactoryClassName="InteractionNameViewFactory"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureInteractionLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="sd: {0} " - editorPattern="{0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - </topLevelNodes> - <topLevelNodes - visualID="2005" - editPartClassName="CommentEditPart" - itemSemanticEditPolicyClassName="CommentItemSemanticEditPolicy" - notationViewFactoryClassName="CommentViewFactory" - canonicalEditPolicyClassName="CommentCanonicalEditPolicy" - graphicalNodeEditPolicyClassName="CommentGraphicalNodeEditPolicy" - createCommandClassName="CommentCreateCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <elementType - xsi:type="gmfgen:MetamodelType" - editHelperClassName="CommentEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CommentFigure" - classBody="
/**
 * @generated
 */
public class CommentFigure extends org.eclipse.draw2d.Shape {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureCommentBody_label; 


	/**
	 * @generated
	 */
	public CommentFigure() {
				this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(90)
, getMapMode().DPtoLP(0)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(60)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(100)
, getMapMode().DPtoLP(60)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(100)
, getMapMode().DPtoLP(10)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(90)
, getMapMode().DPtoLP(0)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(90)
, getMapMode().DPtoLP(10)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(100)
, getMapMode().DPtoLP(10)
));
this.addPoint(new org.eclipse.draw2d.geometry.Point(getMapMode().DPtoLP(90)
, getMapMode().DPtoLP(0)
));
this.setFill(true);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
	this.setBackgroundColor(org.eclipse.draw2d.ColorConstants.white);
		createContents();
	}
	/**
	 * @generated
	 */
	private void createContents(){


fFigureCommentBody_label = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureCommentBody_label.setText("");

fFigureCommentBody_label.setFont(FFIGURECOMMENTBODY_LABEL_FONT);



fFigureCommentBody_label.setBorder(new org.eclipse.draw2d.MarginBorder(getMapMode().DPtoLP(2)
, getMapMode().DPtoLP(2)
, getMapMode().DPtoLP(2)
, getMapMode().DPtoLP(15)
));

this.add(fFigureCommentBody_label);


	}


	/**
	 * @generated
	 */
	private final org.eclipse.draw2d.geometry.PointList myTemplate = new org.eclipse.draw2d.geometry.PointList();
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.geometry.Rectangle myTemplateBounds;
	
	/**
	 * @generated
	 */
	public void addPoint(org.eclipse.draw2d.geometry.Point point){
		myTemplate.addPoint(point);
		myTemplateBounds = null;
	}
	
	/**
	 * @generated
	 */
	protected void fillShape(org.eclipse.draw2d.Graphics graphics) {
		org.eclipse.draw2d.geometry.Rectangle bounds = getBounds();
		graphics.pushState();
		graphics.translate(bounds.x, bounds.y);
		graphics.fillPolygon(scalePointList());
		graphics.popState();
	}
	
	/**
	 * @generated
	 */
	protected void outlineShape(org.eclipse.draw2d.Graphics graphics) {
		org.eclipse.draw2d.geometry.Rectangle bounds = getBounds();
		graphics.pushState();
		graphics.translate(bounds.x, bounds.y);
		graphics.drawPolygon(scalePointList());
		graphics.popState();
	}
	
	/**
	 * @generated
	 */
	private org.eclipse.draw2d.geometry.Rectangle getTemplateBounds(){
		if (myTemplateBounds == null){
			myTemplateBounds = myTemplate.getBounds().getCopy().union(0, 0);
			//just safety -- we are going to use this as divider 
			if (myTemplateBounds.width < 1){
				myTemplateBounds.width = 1;
			}
			if (myTemplateBounds.height < 1){
				myTemplateBounds.height = 1;
			}
		}
		return myTemplateBounds;
	}
	
	/**
	 * @generated
	 */
	private int[] scalePointList() {
		org.eclipse.draw2d.geometry.Rectangle pointsBounds = getTemplateBounds();
		org.eclipse.draw2d.geometry.Rectangle actualBounds = getBounds();

		float xScale = ((float) actualBounds.width) / pointsBounds.width;
		float yScale = ((float) actualBounds.height) / pointsBounds.height;

		if (xScale == 1 && yScale == 1) {
			return myTemplate.toIntArray();
		}
		int[] scaled = (int[]) myTemplate.toIntArray().clone();
		for (int i = 0; i < scaled.length; i += 2) {
			scaled[i] = (int) Math.floor(scaled[i] * xScale);
			scaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale);
		}
		return scaled;
	}




	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureCommentBody_label() {
		return fFigureCommentBody_label;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGURECOMMENTBODY_LABEL_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true" - fixedBackground="true"/> - <attributes - xsi:type="gmfgen:DefaultSizeAttributes" - width="160" - height="75"/> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/> - </modelFacet> - <labels - visualID="5003" - editPartClassName="CommentBodyEditPart" - itemSemanticEditPolicyClassName="CommentBodyItemSemanticEditPolicy" - notationViewFactoryClassName="CommentBodyViewFactory"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureCommentBody_label" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/body"/> - </modelFacet> - </labels> - </topLevelNodes> - <links - visualID="3001" - editPartClassName="MessageEditPart" - itemSemanticEditPolicyClassName="MessageItemSemanticEditPolicy" - notationViewFactoryClassName="MessageViewFactory" - createCommandClassName="MessageCreateCommand" - reorientCommandClassName="MessageReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:MetamodelType" - displayName="Call (synch.)" - editHelperClassName="MessageEditHelper"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CallSync" - classBody="
/**
 * @generated
 */
public class CallSync extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageSyncLabelFigure; 


	/**
	 * @generated
	 */
	public CallSync() {
			this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageSyncLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageSyncLabelFigure.setText("");

fFigureMessageSyncLabelFigure.setFont(FFIGUREMESSAGESYNCLABELFIGURE_FONT);



this.add(fFigureMessageSyncLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolygonDecoration df = new org.eclipse.draw2d.PolygonDecoration();
df.setFill(true);
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
	df.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageSyncLabelFigure() {
		return fFigureMessageSyncLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGESYNCLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.0"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.4"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4005" - editPartClassName="MessageNameEditPart" - itemSemanticEditPolicyClassName="MessageNameItemSemanticEditPolicy" - notationViewFactoryClassName="MessageNameViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageSyncLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.1"/> - </links> - <links - visualID="3002" - editPartClassName="Message2EditPart" - itemSemanticEditPolicyClassName="Message2ItemSemanticEditPolicy" - notationViewFactoryClassName="Message2ViewFactory" - createCommandClassName="Message2CreateCommand" - reorientCommandClassName="Message2ReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Call (asynch.)" - metamodelType="/0/@diagram/@links.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CallAsync" - classBody="
/**
 * @generated
 */
public class CallAsync extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageAsyncLabelFigure; 


	/**
	 * @generated
	 */
	public CallAsync() {
			this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageAsyncLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageAsyncLabelFigure.setText("");

fFigureMessageAsyncLabelFigure.setFont(FFIGUREMESSAGEASYNCLABELFIGURE_FONT);



this.add(fFigureMessageAsyncLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageAsyncLabelFigure() {
		return fFigureMessageAsyncLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGEASYNCLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.2"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.1/@expressions.3"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message/messageSort"/> - </initializers> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.5"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4006" - editPartClassName="MessageName2EditPart" - itemSemanticEditPolicyClassName="MessageName2ItemSemanticEditPolicy" - notationViewFactoryClassName="MessageName2ViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageAsyncLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.4"/> - </links> - <links - visualID="3003" - editPartClassName="Message3EditPart" - itemSemanticEditPolicyClassName="Message3ItemSemanticEditPolicy" - notationViewFactoryClassName="Message3ViewFactory" - createCommandClassName="Message3CreateCommand" - reorientCommandClassName="Message3ReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Reply" - metamodelType="/0/@diagram/@links.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="Reply" - classBody="
/**
 * @generated
 */
public class Reply extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageReplyLabelFigure; 


	/**
	 * @generated
	 */
	public Reply() {
		this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASH);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageReplyLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageReplyLabelFigure.setText("");

fFigureMessageReplyLabelFigure.setFont(FFIGUREMESSAGEREPLYLABELFIGURE_FONT);



this.add(fFigureMessageReplyLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageReplyLabelFigure() {
		return fFigureMessageReplyLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGEREPLYLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.5"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.1/@expressions.6"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message/messageSort"/> - </initializers> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.6"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4007" - editPartClassName="MessageName3EditPart" - itemSemanticEditPolicyClassName="MessageName3ItemSemanticEditPolicy" - notationViewFactoryClassName="MessageName3ViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageReplyLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.7"/> - </links> - <links - visualID="3004" - editPartClassName="Message4EditPart" - itemSemanticEditPolicyClassName="Message4ItemSemanticEditPolicy" - notationViewFactoryClassName="Message4ViewFactory" - createCommandClassName="Message4CreateCommand" - reorientCommandClassName="Message4ReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Signal" - metamodelType="/0/@diagram/@links.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="Signal" - classBody="
/**
 * @generated
 */
public class Signal extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageSignalLabelFigure; 


	/**
	 * @generated
	 */
	public Signal() {
			this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageSignalLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageSignalLabelFigure.setText("");

fFigureMessageSignalLabelFigure.setFont(FFIGUREMESSAGESIGNALLABELFIGURE_FONT);



this.add(fFigureMessageSignalLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageSignalLabelFigure() {
		return fFigureMessageSignalLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGESIGNALLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.8"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.1/@expressions.9"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message/messageSort"/> - </initializers> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.7"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4008" - editPartClassName="MessageName4EditPart" - itemSemanticEditPolicyClassName="MessageName4ItemSemanticEditPolicy" - notationViewFactoryClassName="MessageName4ViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageSignalLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.10"/> - </links> - <links - visualID="3005" - editPartClassName="Message5EditPart" - itemSemanticEditPolicyClassName="Message5ItemSemanticEditPolicy" - notationViewFactoryClassName="Message5ViewFactory" - createCommandClassName="Message5CreateCommand" - reorientCommandClassName="Message5ReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Create" - metamodelType="/0/@diagram/@links.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="Creation" - classBody="
/**
 * @generated
 */
public class Creation extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageCreationLabelFigure; 


	/**
	 * @generated
	 */
	public Creation() {
			this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageCreationLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageCreationLabelFigure.setText("");

fFigureMessageCreationLabelFigure.setFont(FFIGUREMESSAGECREATIONLABELFIGURE_FONT);



this.add(fFigureMessageCreationLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageCreationLabelFigure() {
		return fFigureMessageCreationLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGECREATIONLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.11"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.1/@expressions.12"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message/messageSort"/> - </initializers> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.8"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4009" - editPartClassName="MessageName5EditPart" - itemSemanticEditPolicyClassName="MessageName5ItemSemanticEditPolicy" - notationViewFactoryClassName="MessageName5ViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageCreationLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.13"/> - </links> - <links - visualID="3006" - editPartClassName="Message6EditPart" - itemSemanticEditPolicyClassName="Message6ItemSemanticEditPolicy" - notationViewFactoryClassName="Message6ViewFactory" - createCommandClassName="Message6CreateCommand" - reorientCommandClassName="Message6ReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Destruction" - metamodelType="/0/@diagram/@links.0/@elementType"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="Destruction" - classBody="
/**
 * @generated
 */
public class Destruction extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {


	/**
	 * @generated
	 */
	private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fFigureMessageDestructionLabelFigure; 


	/**
	 * @generated
	 */
	public Destruction() {
			this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);

		createContents();
		setTargetDecoration(createTargetDecoration());
	}


	/**
	 * @generated
	 */
	private void createContents(){


fFigureMessageDestructionLabelFigure = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();
fFigureMessageDestructionLabelFigure.setText("");

fFigureMessageDestructionLabelFigure.setFont(FFIGUREMESSAGEDESTRUCTIONLABELFIGURE_FONT);



this.add(fFigureMessageDestructionLabelFigure);


	}

	/**
	 * @generated
	 */
	private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
		org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
	df.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(2)
);
pl.addPoint(getMapMode().DPtoLP(0)
, getMapMode().DPtoLP(0)
);
pl.addPoint(getMapMode().DPtoLP(-2)
, getMapMode().DPtoLP(-2)
);
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7)
, getMapMode().DPtoLP(3)
);
		return df;
	}


	/**
	 * @generated
	 */
	public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getFigureMessageDestructionLabelFigure() {
		return fFigureMessageDestructionLabelFigure;
	}


}

/**
 * @generated
 */
static final org.eclipse.swt.graphics.Font FFIGUREMESSAGEDESTRUCTIONLABELFIGURE_FONT = new org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Display.getCurrent(), "SANS", 9, org.eclipse.swt.SWT.NORMAL);

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.draw2d</requiredPluginIDs> - <requiredPluginIDs>es.cv.gvcase.mdt.uml2.diagram.common</requiredPluginIDs> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:TypeLinkModelFacet" - modelElementSelector="/0/@expressionProviders/@providers.1/@expressions.14"> - <metaClass - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/> - <containmentMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <childMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction/message"/> - <modelElementInitializer - xsi:type="gmfgen:GenFeatureSeqInitializer"> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.1/@expressions.15"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message/messageSort"/> - </initializers> - <initializers - xsi:type="gmfgen:GenFeatureValueSpec" - value="/0/@expressionProviders/@providers.0/@expressions.9"> - <feature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </initializers> - </modelElementInitializer> - <sourceMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/owner"/> - <targetMetaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedElement"/> - </modelFacet> - <labels - visualID="4010" - editPartClassName="MessageName6EditPart" - itemSemanticEditPolicyClassName="MessageName6ItemSemanticEditPolicy" - notationViewFactoryClassName="MessageName6ViewFactory" - readOnly="true"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureMessageDestructionLabelFigure" - figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedFont="true"/> - <attributes - xsi:type="gmfgen:LabelOffsetAttributes" - x="1" - y="-13"/> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLabelModelFacet" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <metaFeatures - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/> - </modelFacet> - </labels> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.16"/> - </links> - <links - visualID="3007" - editPartClassName="ElementOwnedCommentEditPart" - itemSemanticEditPolicyClassName="ElementOwnedCommentItemSemanticEditPolicy" - notationViewFactoryClassName="ElementOwnedCommentViewFactory" - createCommandClassName="ElementOwnedCommentCreateCommand" - reorientCommandClassName="ElementOwnedCommentReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Comment"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CommentLinkFigure" - classBody="
/**
 * @generated
 */
public class CommentLinkFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public CommentLinkFigure() {
		this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASHDOT);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.lightGray);

	}




}

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLinkModelFacet"> - <metaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Element/ownedComment"/> - </modelFacet> - <creationConstraints - targetEnd="/0/@expressionProviders/@providers.1/@expressions.17"/> - </links> - <links - visualID="3008" - editPartClassName="CommentAnnotatedElementEditPart" - itemSemanticEditPolicyClassName="CommentAnnotatedElementItemSemanticEditPolicy" - notationViewFactoryClassName="CommentAnnotatedElementViewFactory" - createCommandClassName="CommentAnnotatedElementCreateCommand" - reorientCommandClassName="CommentAnnotatedElementReorientCommand"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/> - <elementType - xsi:type="gmfgen:SpecializationType" - displayName="Comment link"/> - <viewmap - xsi:type="gmfgen:InnerClassViewmap" - className="CommentLinkFigure" - classBody="
/**
 * @generated
 */
public class CommentLinkFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {




	/**
	 * @generated
	 */
	public CommentLinkFigure() {
		this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_DASHDOT);
	this.setForegroundColor(org.eclipse.draw2d.ColorConstants.lightGray);

	}




}

"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - <requiredPluginIDs>org.eclipse.gmf.runtime.draw2d.ui</requiredPluginIDs> - </viewmap> - <modelFacet - xsi:type="gmfgen:FeatureLinkModelFacet"> - <metaFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment/annotatedElement"/> - </modelFacet> - <creationConstraints - sourceEnd="/0/@expressionProviders/@providers.1/@expressions.18"/> - </links> - <compartments - visualID="5001" - editPartClassName="InteractionInteractionCompartmentEditPart" - itemSemanticEditPolicyClassName="InteractionInteractionCompartmentItemSemanticEditPolicy" - notationViewFactoryClassName="InteractionInteractionCompartmentViewFactory" - canonicalEditPolicyClassName="InteractionInteractionCompartmentCanonicalEditPolicy" - childNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.3" - title="InteractionCompartment" - canCollapse="false" - needsTitle="false" - node="/0/@diagram/@topLevelNodes.0" - listLayout="false"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureInteractionCompartmentFigure" - figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - </viewmap> - </compartments> - <compartments - visualID="5002" - editPartClassName="InteractionInteractionCompartment2EditPart" - itemSemanticEditPolicyClassName="InteractionInteractionCompartment2ItemSemanticEditPolicy" - notationViewFactoryClassName="InteractionInteractionCompartment2ViewFactory" - canonicalEditPolicyClassName="InteractionInteractionCompartment2CanonicalEditPolicy" - childNodes="/0/@diagram/@childNodes.0 /0/@diagram/@childNodes.1 /0/@diagram/@childNodes.3" - title="InteractionCompartment" - canCollapse="false" - needsTitle="false" - node="/0/@diagram/@childNodes.0" - listLayout="false"> - <diagramRunTimeClass - href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/> - <viewmap - xsi:type="gmfgen:ParentAssignedViewmap" - getterName="getFigureInteractionCompartmentFigure" - figureQualifiedClassName="org.eclipse.draw2d.RectangleFigure"> - <attributes - xsi:type="gmfgen:StyleAttributes" - fixedForeground="true"/> - </viewmap> - </compartments> - <palette> - <groups - title="Interaction" - description="" - collapse="true"> - <entries - xsi:type="gmfgen:ToolEntry" - title="Interaction" - description="Create an Interaction" - genNodes="/0/@diagram/@topLevelNodes.0 /0/@diagram/@childNodes.0"/> - </groups> - <groups - title="Objects" - description="" - collapse="true"> - <entries - xsi:type="gmfgen:ToolEntry" - title="Lifeline" - description="Create a Lifeline" - genNodes="/0/@diagram/@childNodes.1"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Execution Behaviour" - description="Create an Execution Behaviour" - genNodes="/0/@diagram/@childNodes.2"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="CombinedFragment" - description="Create a CombinedFragment block" - genNodes="/0/@diagram/@childNodes.3"/> - </groups> - <groups - title="Messages" - collapse="true"> - <entries - xsi:type="gmfgen:ToolEntry" - title="Call (synch.)" - description="Create a synchronous message call" - genLinks="/0/@diagram/@links.0"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Call (asynch.)" - description="Create an asynchronous message call" - genLinks="/0/@diagram/@links.1"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Reply" - description="Create a reply message" - genLinks="/0/@diagram/@links.2"/> - <entries - xsi:type="gmfgen:Separator"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Send Signal" - genLinks="/0/@diagram/@links.3"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Creation Event" - genLinks="/0/@diagram/@links.4"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Destruction Event" - genLinks="/0/@diagram/@links.5"/> - </groups> - <groups - title="Comments" - collapse="true"> - <entries - xsi:type="gmfgen:ToolEntry" - title="Comment" - description="Create new Comment" - genNodes="/0/@diagram/@topLevelNodes.1"/> - <entries - xsi:type="gmfgen:ToolEntry" - title="Comment Link" - description="Link Comment" - genLinks="/0/@diagram/@links.6 /0/@diagram/@links.7"/> - </groups> - </palette> - <preferencePages - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.general" - name="MOSKitt UML Sequence Diagram"> - <children - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.appearance" - name="Appearance" - kind="Appearance"/> - <children - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.connections" - name="Connections" - kind="Connections"/> - <children - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.printing" - name="Printing" - kind="Printing"/> - <children - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.rulersAndGrid" - name="Rulers And Grid" - kind="RulersAndGrid"/> - <children - xsi:type="gmfgen:GenStandardPreferencePage" - iD="es.cv.gvcase.mdt.uml2.diagram.sequence.pathmaps" - name="Pathmaps" - kind="Pathmaps"/> - </preferencePages> - </diagram> - <plugin - iD="es.cv.gvcase.mdt.uml2.diagram.sequence" - name="MOSKitt UML Sequence Diagram Editor" - provider="gvCASE Project" - version="1.0.0.beta02" - printingEnabled="true"/> - <editor/> - <navigator> - <childReferences - child="/0/@diagram"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@childNodes.0"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@childNodes.2"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@childNodes.1"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@childNodes.3"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@childNodes.0"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@childNodes.1"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@childNodes.3"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@topLevelNodes.0"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@topLevelNodes.1"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.0" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.0" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.0" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.0" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.1" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.1" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.1" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.1" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.2" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.2" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.2" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.2" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.3" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.3" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.3" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.3" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.4" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.4" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.4" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.4" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.5" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.5" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.5" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.5" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.6" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.6" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@topLevelNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@childNodes.0" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@childNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@childNodes.2" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.6" - child="/0/@diagram/@childNodes.3" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.6" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram" - child="/0/@diagram/@links.7" - groupName="links" - groupIcon="icons/linksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@topLevelNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.0" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@topLevelNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@childNodes.0" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.0" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@childNodes.1" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.1" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@childNodes.2" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.2" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@childNodes.3" - referenceType="out_target" - groupName="target" - groupIcon="icons/linkTargetNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@childNodes.3" - child="/0/@diagram/@links.7" - referenceType="in_source" - groupName="incoming links" - groupIcon="icons/incomingLinksNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@links.7" - child="/0/@diagram/@topLevelNodes.1" - referenceType="in_source" - groupName="source" - groupIcon="icons/linkSourceNavigatorGroup.gif"/> - <childReferences - parent="/0/@diagram/@topLevelNodes.1" - child="/0/@diagram/@links.7" - referenceType="out_target" - groupName="outgoing links" - groupIcon="icons/outgoingLinksNavigatorGroup.gif"/> - </navigator> - <diagramUpdater/> - <propertySheet> - <tabs - xsi:type="gmfgen:GenStandardPropertyTab" - iD="appearance"/> - <tabs - xsi:type="gmfgen:GenStandardPropertyTab" - iD="diagram"/> - <tabs - xsi:type="gmfgen:GenCustomPropertyTab" - iD="domain" - label="Core"> - <filter - xsi:type="gmfgen:TypeTabFilter"> - <types>org.eclipse.gmf.runtime.notation.View</types> - <types>org.eclipse.gef.EditPart</types> - <generatedTypes>abstractNavigatorItem</generatedTypes> - </filter> - </tabs> - </propertySheet> - <domainGenModel - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/> - <expressionProviders> - <providers - xsi:type="gmfgen:GenJavaExpressionProvider"> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - body="namedElementInitName"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="// TODO"/> - </providers> - <providers - xsi:type="gmfgen:GenExpressionInterpreter"> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::synchCall"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::asynchCall"/> - <expressions - body="MessageSort::asynchCall"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::reply"/> - <expressions - body="MessageSort::reply"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::asynchSignal"/> - <expressions - body="MessageSort::asynchSignal"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::createMessage"/> - <expressions - body="MessageSort::createMessage"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="self.messageSort=MessageSort::deleteMessage"/> - <expressions - body="MessageSort::deleteMessage"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="not(self.annotatedElement->includes(oppositeEnd))"/> - <expressions - xsi:type="gmfgen:GenConstraint" - body="not(self.annotatedElement->includes(oppositeEnd))"/> - </providers> - </expressionProviders> - </gmfgen:GenEditorGenerator> - <mutating:MutatingCanvas> - <alternateCanvases - diagram="/0/@diagram"> - <domainDiagramElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/> - </alternateCanvases> - </mutating:MutatingCanvas> -</xmi:XMI> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgraph b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgraph deleted file mode 100644 index d26e4c8c6cc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfgraph +++ /dev/null @@ -1,564 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gmfgraph:Canvas xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="Sequence Diagram"> - <figures - name="Sequence Gallery" - implementationBundle="es.cv.gvcase.mdt.uml2.diagram.common"> - <figures - xsi:type="gmfgraph:PolylineDecoration" - name="OpenArrow"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <template - x="-2" - y="2"/> - <template/> - <template - x="-2" - y="-2"/> - </figures> - <figures - xsi:type="gmfgraph:PolygonDecoration" - name="ClosedArrow"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <backgroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <template - x="-2" - y="2"/> - <template/> - <template - x="-2" - y="-2"/> - <template - x="-2" - y="2"/> - </figures> - <descriptors - name="InteractionRectangleFigure"> - <actualFigure - xsi:type="gmfgraph:Rectangle" - name="InteractionRectangleFigure" - fill="false"> - <layout - xsi:type="gmfgraph:BorderLayout"/> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <border - xsi:type="gmfgraph:MarginBorder"> - <insets - top="-2" - left="3" - bottom="3" - right="3"/> - </border> - <children - xsi:type="gmfgraph:Rectangle" - name="InteractionLabel" - outline="false" - fill="false"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - alignment="BEGINNING" - vertical="true"/> - <layout - xsi:type="gmfgraph:BorderLayout"/> - <children - xsi:type="gmfgraph:CustomFigure" - name="InteractionLabelContainer" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - alignment="BEGINNING"/> - <layout - xsi:type="gmfgraph:CustomLayout" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout"/> - <insets - top="3" - left="3" - bottom="3" - right="3"/> - <children - xsi:type="gmfgraph:Label" - name="InteractionLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS" - height="10" - style="BOLD"/> - </children> - </children> - </children> - <children - xsi:type="gmfgraph:Rectangle" - name="InteractionCompartmentFigure" - outline="false" - fill="false" - lineWidth="0"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - vertical="true"/> - <foregroundColor - xsi:type="gmfgraph:ConstantColor"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.0/@actualFigure/@children.0/@children.0/@children.0"/> - <accessors - figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/> - </descriptors> - <descriptors - name="LifelineFigure"> - <actualFigure - xsi:type="gmfgraph:Rectangle" - name="LifelineFigure" - outline="false" - fill="false"> - <layout - xsi:type="gmfgraph:BorderLayout"/> - <preferredSize - dx="100" - dy="200"/> - <children - xsi:type="gmfgraph:Rectangle" - name="LifelineNameContainerFigure"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - alignment="BEGINNING" - vertical="true"/> - <layout - xsi:type="gmfgraph:StackLayout"/> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <backgroundColor - xsi:type="gmfgraph:RGBColor" - red="253" - green="253" - blue="221"/> - <insets - top="7" - left="7" - bottom="7" - right="7"/> - <children - xsi:type="gmfgraph:Label" - name="LifelineLabelFigure" - text="Lifeline"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS" - height="10" - style="BOLD"/> - <insets - top="3" - bottom="3"/> - </children> - </children> - <children - xsi:type="gmfgraph:Rectangle" - name="ExecutionsContainerFigure" - outline="false" - fill="false"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - vertical="true"/> - <layout - xsi:type="gmfgraph:StackLayout"/> - <children - xsi:type="gmfgraph:CustomFigure" - name="LifelineLineFigure" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure"/> - <children - xsi:type="gmfgraph:Rectangle" - name="ExecutionsContainerFigure" - outline="false" - fill="false"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - vertical="true"/> - <layout - xsi:type="gmfgraph:StackLayout"/> - <children - xsi:type="gmfgraph:CustomFigure" - name="LifelineLineFigure" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LifelineDotLineFigure"/> - </children> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.1/@actualFigure/@children.0/@children.0"/> - <accessors - figure="//@figures.0/@descriptors.1/@actualFigure/@children.1"/> - </descriptors> - <descriptors - name="BehaviourExecutionFigure"> - <actualFigure - xsi:type="gmfgraph:Rectangle" - name="BehaviourExecutionFigure"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <backgroundColor - xsi:type="gmfgraph:RGBColor" - red="255" - green="215" - blue="174"/> - <maximumSize - dx="16" - dy="1000"/> - <minimumSize - dx="16" - dy="25"/> - </actualFigure> - </descriptors> - <descriptors - name="CallSync"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="CallSync" - targetDecoration="//@figures.0/@figures.1"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageSyncLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.3/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="CallAsync"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="CallAsync" - targetDecoration="//@figures.0/@figures.0"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageAsyncLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.4/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="Reply"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="Reply" - lineKind="LINE_DASH" - targetDecoration="//@figures.0/@figures.0"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageReplyLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.5/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="Signal"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="Signal" - targetDecoration="//@figures.0/@figures.0"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageSignalLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.6/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="Creation"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="Creation" - targetDecoration="//@figures.0/@figures.0"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageCreationLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.7/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="Destruction"> - <actualFigure - xsi:type="gmfgraph:PolylineConnection" - name="Destruction" - targetDecoration="//@figures.0/@figures.0"> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <children - xsi:type="gmfgraph:Label" - name="MessageDestructionLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS"/> - </children> - </actualFigure> - <accessors - figure="//@figures.0/@descriptors.8/@actualFigure/@children.0"/> - </descriptors> - <descriptors - name="CombinedFragmentFigure"> - <actualFigure - xsi:type="gmfgraph:Rectangle" - name="CombinedFragmentRectangleFigure" - fill="false"> - <layout - xsi:type="gmfgraph:BorderLayout"/> - <foregroundColor - xsi:type="gmfgraph:ConstantColor" - value="black"/> - <border - xsi:type="gmfgraph:MarginBorder"> - <insets - top="-2" - left="3" - bottom="3" - right="3"/> - </border> - <children - xsi:type="gmfgraph:Rectangle" - name="CombinedFragmentLabel" - outline="false" - fill="false"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - alignment="BEGINNING" - vertical="true"/> - <layout - xsi:type="gmfgraph:BorderLayout"/> - <children - xsi:type="gmfgraph:CustomFigure" - name="CombinedFragmentLabelContainer" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.InteractionFigure"> - <layoutData - xsi:type="gmfgraph:BorderLayoutData" - alignment="BEGINNING"/> - <layout - xsi:type="gmfgraph:CustomLayout" - qualifiedClassName="es.cv.gvcase.mdt.uml2.diagram.common.draw2d.LeftToolbarLayout"/> - <insets - top="3" - left="3" - bottom="3" - right="3"/> - <children - xsi:type="gmfgraph:Label" - name="CombinedFragmentLabelFigure"> - <font - xsi:type="gmfgraph:BasicFont" - faceName="SANS" - height="10" - style="BOLD"/> - </children> - </children> - </children> - </actualFigure> - <accessors - accessor="getFigureCombinedFragmentLabelFigure" - figure="//@figures.0/@descriptors.9/@actualFigure/@children.0/@children.0/@children.0"/> - </descriptors> - </figures> - <nodes - name="InteractionNode" - figure="InteractionRectangleFigure"> - <facets - xsi:type="gmfgraph:DefaultSizeFacet"> - <defaultSize - dx="600" - dy="400"/> - </facets> - </nodes> - <nodes - name="LifelineNode" - figure="LifelineFigure"> - <facets - xsi:type="gmfgraph:DefaultSizeFacet"> - <defaultSize - dx="100" - dy="250"/> - </facets> - </nodes> - <nodes - name="BehaviourExecutionNode" - figure="BehaviourExecutionFigure"> - <facets - xsi:type="gmfgraph:DefaultSizeFacet"> - <defaultSize - dx="16" - dy="60"/> - </facets> - </nodes> - <nodes - name="CombinedFragmentNode" - figure="CombinedFragmentFigure"> - <facets - xsi:type="gmfgraph:DefaultSizeFacet"> - <defaultSize - dx="200" - dy="200"/> - </facets> - </nodes> - <connections - name="CallSyncLink" - figure="CallSync"/> - <connections - name="CallAsyncLink" - figure="CallAsync"/> - <connections - name="ReplyLink" - figure="Reply"/> - <connections - name="SignalLink" - figure="Signal"/> - <connections - name="CreateLink" - figure="Creation"/> - <connections - name="DestructionLink" - figure="Destruction"/> - <compartments - name="InteractionCompartment" - figure="InteractionRectangleFigure" - accessor="//@figures.0/@descriptors.0/@accessors.1"/> - <compartments - name="ExcecutionCompartment" - figure="LifelineFigure" - accessor="//@figures.0/@descriptors.1/@accessors.1"/> - <labels - name="InteractionLabel" - figure="InteractionRectangleFigure" - elementIcon="false" - accessor="//@figures.0/@descriptors.0/@accessors.0"/> - <labels - name="LifelineLabel" - figure="LifelineFigure" - elementIcon="false" - accessor="//@figures.0/@descriptors.1/@accessors.0"/> - <labels - name="CombinedFragmentLabel" - figure="CombinedFragmentFigure" - elementIcon="false" - accessor="//@figures.0/@descriptors.9/@accessors.0"/> - <labels - name="MessageSyncLabel" - figure="CallSync" - elementIcon="false" - accessor="//@figures.0/@descriptors.3/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> - <labels - name="MessageAsyncLabel" - figure="CallAsync" - elementIcon="false" - accessor="//@figures.0/@descriptors.4/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> - <labels - name="MessageReplyLabel" - figure="Reply" - elementIcon="false" - accessor="//@figures.0/@descriptors.5/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> - <labels - name="MessageSignalLabel" - figure="Signal" - elementIcon="false" - accessor="//@figures.0/@descriptors.6/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> - <labels - name="MessageCreationLabel" - figure="Creation" - elementIcon="false" - accessor="//@figures.0/@descriptors.7/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> - <labels - name="MessageDestructionLabel" - figure="Destruction" - elementIcon="false" - accessor="//@figures.0/@descriptors.8/@accessors.0"> - <facets - xsi:type="gmfgraph:AlignmentFacet" - alignment="CENTER"/> - <facets - xsi:type="gmfgraph:LabelOffsetFacet" - x="1" - y="-13"/> - </labels> -</gmfgraph:Canvas> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfmap b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfmap deleted file mode 100644 index 69ed6687c77..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmfmap +++ /dev/null @@ -1,544 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gmfmap:Mapping xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" - xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings" - xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> - <nodes> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Package/packagedElement"/> - <ownedChild> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - viewPattern="sd: {0} " - editorPattern="{0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#InteractionLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.0/@tools.0"/> - <diagramNode - href="sequenceDiagram.gmfgraph#InteractionNode"/> - <children - compartment="//@nodes.0/@ownedChild/@compartments.0" - referencedChild="//@nodes.0/@ownedChild"> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/fragment"/> - </children> - <children - compartment="//@nodes.0/@ownedChild/@compartments.0"> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/lifeline"/> - <ownedChild> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Lifeline"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - viewPattern="{0}: %ADDSTEREOTYPES%" - editorPattern="{0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#LifelineLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.1/@tools.0"/> - <diagramNode - href="sequenceDiagram.gmfgraph#LifelineNode"/> - <children - referencedChild="//@nodes.0/@ownedChild/@children.1/@ownedChild"> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/fragment"/> - <ownedChild> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//BehaviorExecutionSpecification"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.1/@tools.1"/> - <diagramNode - href="sequenceDiagram.gmfgraph#BehaviourExecutionNode"/> - </ownedChild> - </children> - </ownedChild> - </children> - <children - compartment="//@nodes.0/@ownedChild/@compartments.0"> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/fragment"/> - <ownedChild> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CombinedFragment"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern=""> - <diagramLabel - href="sequenceDiagram.gmfgraph#CombinedFragmentLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//CombinedFragment/interactionOperator"/> - </labelMappings> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.1/@tools.2"/> - <diagramNode - href="sequenceDiagram.gmfgraph#CombinedFragmentNode"/> - </ownedChild> - </children> - <compartments - children="//@nodes.0/@ownedChild/@children.0 //@nodes.0/@ownedChild/@children.1 //@nodes.0/@ownedChild/@children.2"> - <compartment - href="sequenceDiagram.gmfgraph#InteractionCompartment"/> - </compartments> - </ownedChild> - </nodes> - <nodes> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedComment"/> - <ownedChild> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Comment"/> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping"> - <diagramLabel - href="classDiagram_constraints.gmfgraph#CommentBodyLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Comment/body"/> - </labelMappings> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.3/@tools.0"/> - <diagramNode - href="classDiagram_constraints.gmfgraph#CommentNode"/> - </ownedChild> - </nodes> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::synchCall"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageSyncLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.0"/> - <diagramLink - href="sequenceDiagram.gmfgraph#CallSyncLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::asynchCall"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message/messageSort"/> - <value - body="MessageSort::asynchCall"/> - </initializers> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageAsyncLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.1"/> - <diagramLink - href="sequenceDiagram.gmfgraph#CallAsyncLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::reply"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message/messageSort"/> - <value - body="MessageSort::reply"/> - </initializers> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageReplyLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.2"/> - <diagramLink - href="sequenceDiagram.gmfgraph#ReplyLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::asynchSignal"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message/messageSort"/> - <value - body="MessageSort::asynchSignal"/> - </initializers> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageSignalLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.4"/> - <diagramLink - href="sequenceDiagram.gmfgraph#SignalLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::createMessage"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message/messageSort"/> - <value - body="MessageSort::createMessage"/> - </initializers> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageCreationLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.5"/> - <diagramLink - href="sequenceDiagram.gmfgraph#CreateLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message"/> - <domainSpecialization - body="self.messageSort=MessageSort::deleteMessage"/> - <domainInitializer - xsi:type="gmfmap:FeatureSeqInitializer"> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Message/messageSort"/> - <value - body="MessageSort::deleteMessage"/> - </initializers> - <initializers - xsi:type="gmfmap:FeatureValueSpec"> - <feature - xsi:type="ecore:EAttribute" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - <value - body="namedElementInitName" - language="java"/> - </initializers> - </domainInitializer> - <labelMappings - xsi:type="gmfmap:FeatureLabelMapping" - readOnly="true" - viewPattern="%ADDSTEREOTYPES% {0}" - editPattern="{0}"> - <diagramLabel - href="sequenceDiagram.gmfgraph#MessageDestructionLabel"/> - <features - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/> - </labelMappings> - <containmentFeature - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Interaction/message"/> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.2/@tools.6"/> - <diagramLink - href="sequenceDiagram.gmfgraph#DestructionLink"/> - <sourceMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/owner"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedElement"/> - <creationConstraints> - <targetEnd - body="((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())"/> - </creationConstraints> - </links> - <links> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.3/@tools.1"/> - <diagramLink - href="classDiagram_constraints.gmfgraph#CommentLink"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Element/ownedComment"/> - <creationConstraints> - <targetEnd - body="not(self.annotatedElement->includes(oppositeEnd))"/> - </creationConstraints> - </links> - <links> - <tool - xsi:type="gmftool:CreationTool" - href="sequenceDiagram.gmftool#//@palette/@tools.3/@tools.1"/> - <diagramLink - href="classDiagram_constraints.gmfgraph#CommentLink"/> - <linkMetaFeature - xsi:type="ecore:EReference" - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Comment/annotatedElement"/> - <creationConstraints> - <sourceEnd - body="not(self.annotatedElement->includes(oppositeEnd))"/> - </creationConstraints> - </links> - <diagram> - <diagramCanvas - href="sequenceDiagram.gmfgraph#Sequence Diagram"/> - <domainModel - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#/"/> - <domainMetaElement - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Package"/> - <palette - href="sequenceDiagram.gmftool#//@palette"/> - </diagram> - <audits - id="MOSKItt_Sequence_diagram_constraints" - name="MOSKitt Sequence diagram constraints" - description="UML2 sequence diagram constraints"> - <childContainers - id="MOSKitt_Sequence_diagram_constraints_LIVE" - name="MOSKitt Sequence diagram constraints LIVE" - description="UML2 Sequence diagram constraints."> - <audits - name="Unique name in model container" - description="Checks an element's name to be unique in its model container." - id="unique_name_in_model_container" - useInLiveMode="true" - message="Another element exists qith that name."> - <rule - body="// TODO" - language="java"/> - <target - xsi:type="gmfmap:DomainElementTarget"> - <element - href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement"/> - </target> - </audits> - </childContainers> - </audits> -</gmfmap:Mapping> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmftool b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmftool deleted file mode 100644 index d4299ea3e34..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.gmftool +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<gmftool:ToolRegistry xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition"> - <palette - title="Sequence Diagram" - description="Sequence Diagram Palette"> - <tools - xsi:type="gmftool:ToolGroup" - title="Interaction" - description="" - collapsible="true"> - <tools - xsi:type="gmftool:CreationTool" - title="Interaction" - description="Create an Interaction"/> - </tools> - <tools - xsi:type="gmftool:ToolGroup" - title="Objects" - description="" - collapsible="true"> - <tools - xsi:type="gmftool:CreationTool" - title="Lifeline" - description="Create a Lifeline"/> - <tools - xsi:type="gmftool:CreationTool" - title="Execution Behaviour" - description="Create an Execution Behaviour"/> - <tools - xsi:type="gmftool:CreationTool" - title="CombinedFragment" - description="Create a CombinedFragment block"/> - </tools> - <tools - xsi:type="gmftool:ToolGroup" - title="Messages" - collapsible="true"> - <tools - xsi:type="gmftool:CreationTool" - title="Call (synch.)" - description="Create a synchronous message call"/> - <tools - xsi:type="gmftool:CreationTool" - title="Call (asynch.)" - description="Create an asynchronous message call"/> - <tools - xsi:type="gmftool:CreationTool" - title="Reply" - description="Create a reply message"/> - <tools - xsi:type="gmftool:PaletteSeparator"/> - <tools - xsi:type="gmftool:CreationTool" - title="Send Signal"/> - <tools - xsi:type="gmftool:CreationTool" - title="Creation Event"/> - <tools - xsi:type="gmftool:CreationTool" - title="Destruction Event"/> - </tools> - <tools - xsi:type="gmftool:ToolGroup" - title="Comments" - collapsible="true"> - <tools - xsi:type="gmftool:CreationTool" - title="Comment" - description="Create new Comment"/> - <tools - xsi:type="gmftool:CreationTool" - title="Comment Link" - description="Link Comment"/> - </tools> - </palette> -</gmftool:ToolRegistry> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.trace b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.trace deleted file mode 100644 index 8d6eac1a2d8..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/model/sequenceDiagram.trace +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<trace:TraceModel xmi:version="2.0" - xmlns:xmi="http://www.omg.org/XMI" - xmlns:trace="http://www.eclipse.org/gmf/2006/Trace"> - <nodeTraces - visualID="1001" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Package') and _containmentMF_.name = 'packagedElement')"> - <nodeLabelTraces - visualID="4004" - queryText="true"/> - <compartmentTraces - visualID="5001" - queryText="true"/> - </nodeTraces> - <nodeTraces - visualID="2005" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Comment') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Element') and _containmentMF_.name = 'ownedComment')"> - <nodeLabelTraces - visualID="5003" - queryText="true"/> - </nodeTraces> - <childNodeTraces - visualID="2001" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and _containmentMF_.name = 'fragment')"> - <nodeLabelTraces - visualID="4003" - queryText="true"/> - <compartmentTraces - visualID="5002" - queryText="true"/> - </childNodeTraces> - <childNodeTraces - visualID="2002" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Lifeline') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and _containmentMF_.name = 'lifeline')"> - <nodeLabelTraces - visualID="4001" - queryText="true"/> - </childNodeTraces> - <childNodeTraces - visualID="2003" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'BehaviorExecutionSpecification') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and _containmentMF_.name = 'fragment')"/> - <childNodeTraces - visualID="2004" - queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'CombinedFragment') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Interaction') and _containmentMF_.name = 'fragment')"> - <nodeLabelTraces - visualID="4002" - queryText="true"/> - </childNodeTraces> - <linkTraces - visualID="3001" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4005" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3002" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4006" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3003" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4007" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3004" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4008" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3005" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4009" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3006" - queryText="modelFacet.oclIsKindOf(gmfgen::TypeLinkModelFacet) and (let _eClass_:ecore::EClass = modelFacet.oclAsType(gmfgen::TypeLinkModelFacet).metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Message')"> - <linkLabelTraces - visualID="4010" - queryText="true"/> - </linkTraces> - <linkTraces - visualID="3007" - queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Element') and _feature_.name = 'ownedComment')"/> - <linkTraces - visualID="3008" - queryText="modelFacet.oclIsKindOf(gmfgen::FeatureLinkModelFacet) and (let _feature_:ecore::EStructuralFeature = modelFacet.oclAsType(gmfgen::FeatureLinkModelFacet).metaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _feature_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/2.1.0/UML' and _eClass_.name = 'Comment') and _feature_.name = 'annotatedElement')"/> -</trace:TraceModel> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.properties b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.properties deleted file mode 100644 index 2c607f0576d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.properties +++ /dev/null @@ -1,94 +0,0 @@ -########################################################################################## -# Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat -# de la Comunitat Valenciana . All rights reserved. This program -# and the accompanying materials are made available under the terms of the -# Eclipse Public License v1.0 which accompanies this distribution, and is -# available at http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: Francisco Javier Cano Munoz (Prodevelop) - initial API implementation -# -######################################################################################## -pluginName=Papyrus Sequence Diagram (Incubation) -providerName=Eclipse.org - - -preferences.general=Papyrus Sequence Diagram (Incubation) -preferences.appearance=Appearance -preferences.connections=Connections -preferences.printing=Printing -preferences.rulersAndGrid=Rulers & Grid -preferences.pathmaps=Path Maps - -editorName=Papyrus Sequence Diagram (Incubation) -context.description=UMLSequence Diagram Editor -context.name=In UMLSequence Diagram Editor -newWizardName=UMLSequence Diagram -newWizardDesc=Creates UMLSequence diagram. - -initDiagramActionLabel=Initialize umlsequence_diagram diagram file -createShortcutActionLabel=Create Shortcut... -loadResourceActionLabel=Load Resource... - - -navigatorContentName=*.umlsequence_diagram diagram contents -domainNavigatorContentName=*.uml model contents -update.diagram.name=Update UMLSequence diagram -update.diagram.description=Perform UMLSequence diagram update - - -# Property Sheet -tab.appearance=Appearance -tab.diagram=Rulers & Grid -tab.domain=Core - -# Providers -metatype.name.Package_79=Undefined -metatype.name.Interaction_1001=Interaction -metatype.name.Interaction_2001=Interaction -metatype.name.Lifeline_2002=Lifeline -metatype.name.BehaviorExecutionSpecification_2003=Behavior Execution Specification -metatype.name.Message_3001=Message -metatype.name.Message_3002=Message -metatype.name.Message_3003=Message -metatype.name.Message_3004=Message -metatype.name.Message_3005=Message -metatype.name.Message_3006=Message - -metatype.name.CombinedFragment_2004=Combined Fragment -preference.page.title.org.eclipse.uml2.uml.diagram.general=UML Diagram -preference.page.title.org.eclipse.uml2.uml.diagram.appearance=Appearance -preference.page.title.org.eclipse.uml2.uml.diagram.connections=Connections -preference.page.title.org.eclipse.uml2.uml.diagram.printing=Printing -preference.page.title.org.eclipse.uml2.uml.diagram.rulersAndGrid=Rulers And Grid -preference.page.title.org.eclipse.uml2.uml.diagram.pathmaps=Pathmaps -metatype.name.Package_1000=Undefined -metatype.name.Comment_2005=Comment -metatype.name.ElementOwnedComment_3007=Undefined -metatype.name.CommentAnnotatedElement_3008=Undefined -preferences.icons=Icon Style -viewInfo.79=Undefined -viewInfo.1001=Interaction -viewInfo.4004=name from Interaction -viewInfo.2005=Comment -viewInfo.5003=body from Comment -viewInfo.2001=Interaction -viewInfo.4003=name from Interaction -viewInfo.2002=Lifeline -viewInfo.2003=BehaviorExecutionSpecification -viewInfo.4001=name from Lifeline -viewInfo.2004=CombinedFragment -viewInfo.4002=interactionOperator from CombinedFragment -viewInfo.3001=Call (synch.) -viewInfo.4005=name from Call (synch.) -viewInfo.3002=Call (asynch.) -viewInfo.4006=name from Call (asynch.) -viewInfo.3003=Reply -viewInfo.4007=name from Reply -viewInfo.3004=Signal -viewInfo.4008=name from Signal -viewInfo.3005=Create -viewInfo.4009=name from Create -viewInfo.3006=Destruction -viewInfo.4010=name from Destruction -viewInfo.3007=Comment -viewInfo.3008=Comment link diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.xml b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.xml deleted file mode 100644 index b0ef657c16e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/plugin.xml +++ /dev/null @@ -1,1160 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.2"?> -<plugin> - <extension - point="org.eclipse.ui.commands"> - <command - description="Create a new UML2 Sequence diagram" - id="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand" - name="New UML2 Sequence Diagram"> - </command> - </extension> - <extension - point="org.eclipse.ui.handlers"> - <handler - class="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand" - commandId="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand"> - <activeWhen> - <or> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.core.papyrusEditor"> - </equals> - </with> - </or> - </activeWhen> - </handler> - </extension> - <extension - point="org.eclipse.ui.menus"> - <menuContribution - locationURI="menu:org.eclipse.papyrus.ui.menu"> - <menu - id="org.eclipse.papyrus.diagram.ui.menu.diagrams" - label="Diagrams"> - <command - commandId="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand" - icon="icons/SequenceDiagram.gif" - label="Create a new Sequence Diagram" - style="push" - tooltip="Create a new Sequence Diagram"> - <visibleWhen> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.core.papyrusEditor"> - </equals> - </with> - </visibleWhen> - </command> - </menu> - </menuContribution> - <menuContribution - locationURI="toolbar:org.eclipse.ui.main.toolbar"> - <toolbar - id="org.eclipse.papyrus.diagram.ui.toolbar"> - <command - commandId="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand" - icon="icons/SequenceDiagram.gif" - label="Create a new Sequence Diagram" - style="push" - tooltip="Create a new Sequence Diagram"> - <visibleWhen> - <with - variable="activeEditorId"> - <equals - value="org.eclipse.papyrus.core.papyrusEditor"> - </equals> - </with> - </visibleWhen> - </command> - </toolbar> - </menuContribution> - </extension> - <extension - point="org.eclipse.papyrus.core.papyrusDiagram"> - <editorDiagram - contextId="com.cea.papyrus.gmf.editor.context" - factoryClass="org.eclipse.papyrus.diagram.sequence.part.SequenceDiagramEditorFactory" - icon="icons/SequenceDiagram.gif"> - </editorDiagram> - <creationCommand - creationCommandClass="org.eclipse.papyrus.diagram.sequence.CreateSequenceDiagramCommand" - icon="icons/SequenceDiagram.gif" - id="org.eclipse.papyrus.diagram.sequence.actions.CreationCommand" - label="UML Sequence Diagram"> - </creationCommand> - </extension> - - - <extension point="org.eclipse.team.core.fileTypes"> - <?gmfgen generated="true"?> - - <fileTypes - type="text" - extension="sequenceuml_diagram"> - </fileTypes> - - </extension> - - <extension point="org.eclipse.emf.ecore.extension_parser"> - <?gmfgen generated="true"?> - - <parser - type="sequenceuml_diagram" - class="org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory"> - </parser> - - </extension> - - <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders"> - <?gmfgen generated="false"?> - <GlobalActionHandlerProvider - class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandlerProvider" - id="MOSKitt UMLSequencePresentation"> - <Priority name="Lowest"/> - <ViewId id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"> - <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - <GlobalActionId actionId="delete"/> - </ElementType> - <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart"> - <GlobalActionId actionId="save"/> - </ElementType> - </ViewId> - </GlobalActionHandlerProvider> - <GlobalActionHandlerProvider - class="org.eclipse.gmf.runtime.diagram.ui.printing.render.providers.DiagramWithPrintGlobalActionHandlerProvider" - id="MOSKitt UMLSequencePresentationPrint"> - <Priority name="Lowest"/> - <ViewId id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"> - <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - <GlobalActionId actionId="print"/> - </ElementType> - </ViewId> - </GlobalActionHandlerProvider> - <GlobalActionHandlerProvider - class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider" - id="MOSKitt UMLSequencePresentationIDE"> - <Priority name="Lowest"/> - <ViewId id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"> - <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - <GlobalActionId actionId="bookmark"/> - </ElementType> - </ViewId> - </GlobalActionHandlerProvider> - <GlobalActionHandlerProvider - class="org.eclipse.papyrus.diagram.common.actions.handlers.ClipboardActionHandlerProvider" - id="MOSKitt UMLSequenceRender"> - <Priority name="Lowest"/> - <ViewId id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"> - <ElementType class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"> - <GlobalActionId actionId="cut"/> - <GlobalActionId actionId="copy"/> - <GlobalActionId actionId="paste"/> - </ElementType> - </ViewId> - </GlobalActionHandlerProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.common.ui.services.action.contributionItemProviders"> - <?gmfgen generated="false"?> - <contributionItemProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLContributionItemProvider"> - <Priority name="Low"/> - <partContribution id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"> - <partAction menubarPath="/file/print" id="printPreviewAction"/> - </partContribution> - </contributionItemProvider> - <contributionItemProvider - class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider" - checkPluginLoaded="false"> - <Priority name="Low"/> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="flase"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart"/> - <popupAction path="/editGroup" id="deleteFromModelAction"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart"/> - <popupAction path="/editGroup" id="deleteFromModelAction"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - </popupContribution> - -<popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider"> - <popupStructuredContributionCriteria objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart"/> - <popupPredefinedItem id="deleteFromDiagramAction" remove="false"/> - <popupPredefinedItem id="deleteFromModelAction" remove="false"/> - </popupContribution> - </contributionItemProvider> -</extension> - - <extension point="org.eclipse.core.runtime.preferences"> - <?gmfgen generated="true"?> - <initializer class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramPreferenceInitializer"/> - </extension> - - <extension point="org.eclipse.ui.preferencePages"> - <?gmfgen generated="true"?> - <page - id="org.eclipse.papyrus.diagram.sequence.general" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.general" - category="org.eclipse.uml2.uml.diagram" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramGeneralPreferencePage"> - </page> - <page - id="org.eclipse.papyrus.diagram.sequence.appearance" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.appearance" - category="org.eclipse.papyrus.diagram.sequence.general" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramAppearancePreferencePage"> - </page> - <page - id="org.eclipse.papyrus.diagram.sequence.connections" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.connections" - category="org.eclipse.papyrus.diagram.sequence.general" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramConnectionsPreferencePage"> - </page> - <page - id="org.eclipse.papyrus.diagram.sequence.printing" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.printing" - category="org.eclipse.papyrus.diagram.sequence.general" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramPrintingPreferencePage"> - </page> - <page - id="org.eclipse.papyrus.diagram.sequence.rulersAndGrid" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.rulersAndGrid" - category="org.eclipse.papyrus.diagram.sequence.general" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramRulersAndGridPreferencePage"> - </page> - <page - id="org.eclipse.papyrus.diagram.sequence.pathmaps" - name="%preference.page.title.org.eclipse.papyrus.diagram.sequence.pathmaps" - category="org.eclipse.papyrus.diagram.sequence.general" - class="org.eclipse.gmf.runtime.emf.ui.preferences.PathmapsPreferencePage"> - </page> - </extension> - - <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor"> - <?gmfgen generated="true"?> - <propertyContributor - contributorId="org.eclipse.papyrus.diagram.sequence" - labelProvider="org.eclipse.papyrus.diagram.sequence.sheet.UMLSheetLabelProvider"> - <propertyCategory category="domain"/> - <propertyCategory category="visual"/> - <propertyCategory category="extra"/> - </propertyContributor> - </extension> - - <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs"> - <?gmfgen generated="true"?> - <propertyTabs contributorId="org.eclipse.papyrus.diagram.sequence"> - <propertyTab - category="visual" - id="property.tab.AppearancePropertySection" - label="%tab.appearance"/> - <propertyTab - category="visual" - id="property.tab.DiagramPropertySection" - label="%tab.diagram"/> - <propertyTab - category="domain" - id="property.tab.domain" - label="%tab.domain"/> - </propertyTabs> - </extension> - - <extension point="org.eclipse.ui.views.properties.tabbed.propertySections"> - <?gmfgen generated="true"?> - <propertySections contributorId="org.eclipse.papyrus.diagram.sequence"> - <propertySection id="property.section.ConnectorAppearancePropertySection" - filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter" - class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection" - tab="property.tab.AppearancePropertySection"> - </propertySection> - <propertySection id="property.section.ShapeColorAndFontPropertySection" - filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter" - class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection" - tab="property.tab.AppearancePropertySection"> - </propertySection> - <propertySection id="property.section.DiagramColorsAndFontsPropertySection" - filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" - class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection" - tab="property.tab.AppearancePropertySection"> - </propertySection> - <propertySection id="property.section.RulerGridPropertySection" - filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter" - class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection" - tab="property.tab.DiagramPropertySection"> - </propertySection> - <propertySection - id="property.section.domain" - tab="property.tab.domain" - class="org.eclipse.papyrus.diagram.sequence.sheet.UMLPropertySection"> - <input type="org.eclipse.gmf.runtime.notation.View"/> - <input type="org.eclipse.gef.EditPart"/> - <input type="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </propertySection> - </propertySections> - </extension> - - <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders"> - <?gmfgen generated="true"?> - <viewProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLViewProvider"> - <Priority name="Lowest"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="MOSKitt UMLSequence"/> - <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints=""/> - <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints=""/> - </viewProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders"> - <?gmfgen generated="true"?> - <editpartProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLEditPartProvider"> - <Priority name="Lowest"/> - </editpartProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders"> - <?gmfgen generated="true"?> - <modelingAssistantProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLModelingAssistantProvider"> - <Priority name="Lowest"/> - </modelingAssistantProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders"> - <?gmfgen generated="true"?> - <IconProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLIconProvider"> - <Priority name="Low"/> - </IconProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders"> - <?gmfgen generated="true"?> - <ParserProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider"> - <Priority name="Lowest"/> - </ParserProvider> - </extension> - - <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes"> - <?gmfgen generated="true"?> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.Package_79" - name="%metatype.name.Package_79" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="Package" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.PackageEditHelper"> - <param name="semanticHint" value="79"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.Interaction_1001" - name="%metatype.name.Interaction_1001" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="Interaction" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.InteractionEditHelper"> - <param name="semanticHint" value="1001"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.Comment_2005" - name="%metatype.name.Comment_2005" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="Comment" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.CommentEditHelper"> - <param name="semanticHint" value="2005"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Interaction_2001" - name="%metatype.name.Interaction_2001" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Interaction_1001"/> - <param name="semanticHint" value="2001"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.Lifeline_2002" - name="%metatype.name.Lifeline_2002" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="Lifeline" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.LifelineEditHelper"> - <param name="semanticHint" value="2002"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.BehaviorExecutionSpecification_2003" - name="%metatype.name.BehaviorExecutionSpecification_2003" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="BehaviorExecutionSpecification" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.BehaviorExecutionSpecificationEditHelper"> - <param name="semanticHint" value="2003"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.CombinedFragment_2004" - name="%metatype.name.CombinedFragment_2004" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="CombinedFragment" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.CombinedFragmentEditHelper"> - <param name="semanticHint" value="2004"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <metamodelType - id="org.eclipse.papyrus.diagram.sequence.Message_3001" - name="%metatype.name.Message_3001" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType" - eclass="Message" - edithelper="org.eclipse.papyrus.diagram.sequence.edit.helpers.MessageEditHelper"> - <param name="semanticHint" value="3001"/> - </metamodelType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Message_3002" - name="%metatype.name.Message_3002" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <param name="semanticHint" value="3002"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Message_3003" - name="%metatype.name.Message_3003" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <param name="semanticHint" value="3003"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Message_3004" - name="%metatype.name.Message_3004" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <param name="semanticHint" value="3004"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Message_3005" - name="%metatype.name.Message_3005" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <param name="semanticHint" value="3005"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.Message_3006" - name="%metatype.name.Message_3006" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <param name="semanticHint" value="3006"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.ElementOwnedComment_3007" - name="%metatype.name.ElementOwnedComment_3007" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/> - <param name="semanticHint" value="3007"/> - </specializationType> - </metamodel> - <metamodel nsURI="http://www.eclipse.org/uml2/2.1.0/UML"> - <specializationType - id="org.eclipse.papyrus.diagram.sequence.CommentAnnotatedElement_3008" - name="%metatype.name.CommentAnnotatedElement_3008" - kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"> - <specializes id="org.eclipse.gmf.runtime.emf.type.core.null"/> - <param name="semanticHint" value="3008"/> - </specializationType> - </metamodel> - </extension> - - <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings"> - <?gmfgen generated="true"?> - <binding context="com.cea.papyrus.gmf.editor.context"> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Package_79"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Interaction_1001"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Comment_2005"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Interaction_2001"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Lifeline_2002"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.BehaviorExecutionSpecification_2003"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.CombinedFragment_2004"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3001"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3002"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3003"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3004"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3005"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.Message_3006"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.ElementOwnedComment_3007"/> - <elementType ref="org.eclipse.papyrus.diagram.sequence.CommentAnnotatedElement_3008"/> - <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/> - </binding> - </extension> - <extension point="org.eclipse.core.expressions.propertyTesters"> - <?gmfgen generated="true"?> - <propertyTester - id="org.eclipse.papyrus.diagram.sequence.URIEditorInputPropertyTester" - type="org.eclipse.emf.common.ui.URIEditorInput" - namespace="org.eclipse.papyrus.diagram.sequence" - properties="isURIEditorInput" - class="org.eclipse.papyrus.diagram.sequence.part.UMLUriEditorInputTester"> - </propertyTester> - </extension> - - <extension point="org.eclipse.core.expressions.propertyTesters"> - <?gmfgen generated="true"?> - <propertyTester - id="org.eclipse.papyrus.diagram.sequence.DomainModelElementPropertyTester" - type="org.eclipse.emf.ecore.EObject" - namespace="org.eclipse.papyrus.diagram.sequence" - properties="isDomainModelElement" - class="org.eclipse.papyrus.diagram.sequence.part.UMLDomainModelElementTester"> - </propertyTester> - </extension> - - <extension point="org.eclipse.ui.navigator.viewer"> - <?gmfgen generated="true"?> - <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <contentExtension pattern="org.eclipse.papyrus.diagram.sequence.resourceContent"/> - <contentExtension pattern="org.eclipse.papyrus.diagram.sequence.domainResourceContent"/> - <contentExtension pattern="org.eclipse.papyrus.diagram.sequence.navigatorLinkHelper"/> - </includes> - </viewerContentBinding> - <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer"> - <includes> - <actionExtension pattern="org.eclipse.papyrus.diagram.sequence.navigatorActionProvider"/> - </includes> - </viewerActionBinding> - </extension> - - <extension point="org.eclipse.ui.navigator.navigatorContent"> - <?gmfgen generated="true"?> - <navigatorContent - id="org.eclipse.papyrus.diagram.sequence.resourceContent" - name="%navigatorContentName" - priority="normal" - contentProvider="org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorContentProvider" - labelProvider="org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorLabelProvider" - icon="icons/obj16/UMLDiagramFile.gif" - activeByDefault="true"> - <triggerPoints> - <or> - <and> - <instanceof value="org.eclipse.core.resources.IFile"/> - <test property="org.eclipse.core.resources.extension" value="sequenceuml_diagram"/> - </and> - <instanceof value="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </or> - </triggerPoints> - <possibleChildren> - <or> - <instanceof value="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </or> - </possibleChildren> - <commonSorter - id="org.eclipse.papyrus.diagram.sequence.navigatorSorter" - class="org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorSorter"> - <parentExpression> - <or> - <and> - <instanceof value="org.eclipse.core.resources.IFile"/> - <test property="org.eclipse.core.resources.extension" value="sequenceuml_diagram"/> - </and> - <instanceof value="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </or> - </parentExpression> - </commonSorter> - </navigatorContent> - <navigatorContent - id="org.eclipse.papyrus.diagram.sequence.domainResourceContent" - name="%domainNavigatorContentName" - priority="normal" - contentProvider="org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorContentProvider" - labelProvider="org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorLabelProvider" - icon="icons/obj16/UMLDiagramFile.gif" - activeByDefault="true"> - <triggerPoints> - <or> - <and> - <instanceof value="org.eclipse.core.resources.IFile"/> - <test property="org.eclipse.core.resources.extension" value="uml"/> - </and> - <and> - <instanceof value="org.eclipse.emf.ecore.EObject"/> - <test property="org.eclipse.papyrus.diagram.sequence.isDomainModelElement"/> - </and> - </or> - </triggerPoints> - <possibleChildren> - <and> - <instanceof value="org.eclipse.emf.ecore.EObject"/> - <test property="org.eclipse.papyrus.diagram.sequence.isDomainModelElement"/> - </and> - </possibleChildren> - </navigatorContent> - <actionProvider - id="org.eclipse.papyrus.diagram.sequence.navigatorActionProvider" - class="org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorActionProvider"> - <enablement> - <or> - <instanceof value="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </or> - </enablement> - </actionProvider> - </extension> - - <extension point="org.eclipse.ui.navigator.linkHelper"> - <?gmfgen generated="true"?> - <linkHelper - id="org.eclipse.papyrus.diagram.sequence.navigatorLinkHelper" - class="org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorLinkHelper"> - <editorInputEnablement> - <and> - <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/> - <test property="org.eclipse.papyrus.diagram.sequence.isURIEditorInput"/> - </and> - </editorInputEnablement> - <selectionEnablement> - <instanceof value="org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem"/> - </selectionEnablement> - </linkHelper> - </extension> - <extension point="org.eclipse.ui.commands"> - <?gmfgen generated="true"?> - <command - categoryId="org.eclipse.ui.category.edit" - defaultHandler="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramUpdateCommand" - description="%update.diagram.description" - id="org.eclipse.papyrus.diagram.sequence.updateDiagram" - name="%update.diagram.name"/> - </extension> - - <extension point="org.eclipse.ui.bindings"> - <?gmfgen generated="true"?> - <key - commandId="org.eclipse.papyrus.diagram.sequence.updateDiagram" - contextId="org.eclipse.papyrus.diagram.sequence.ui.diagramContext" - schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" - sequence="F5"/> - </extension> - <extension - point="org.eclipse.papyrus.diagram.common.modelToEditorMap"> - <modelToEditor - editorID="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID" - label="UML Sequence" - modelID="MOSKitt UMLSequence"> - </modelToEditor> - </extension><extension point="org.eclipse.ui.editors"> - <?gmfgen generated="true"?> - <editor - id="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID" - name="%editorName" - icon="icons/SequenceDiagram.gif" - extensions="sequenceuml_diagram" - default="true" - class="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditor" - matchingStrategy="org.eclipse.papyrus.diagram.sequence.part.UMLMatchingStrategy" - contributorClass="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramActionBarContributor"> - </editor> - </extension> -<extension point="org.eclipse.ui.contexts"> - <?gmfgen generated="true"?> - <context - description="%context.description" - id="org.eclipse.papyrus.diagram.sequence.ui.diagramContext" - name="%context.name" - parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext"> - </context> - </extension> -<extension point="org.eclipse.ui.popupMenus"> - <?gmfgen generated="true"?> - <objectContribution - adaptable="false" - id="org.eclipse.papyrus.diagram.sequence.PackageEditPart.CreateShortcut" - objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart"> - <action - class="org.eclipse.papyrus.diagram.sequence.part.UMLCreateShortcutAction" - enablesFor="1" - id="org.eclipse.papyrus.diagram.sequence.CreateShortcutAction" - label="%createShortcutActionLabel" - menubarPath="additions"> - </action> - </objectContribution> - - <objectContribution - adaptable="false" - id="org.eclipse.papyrus.diagram.sequence.InteractionInteractionCompartmentEditPart.CreateShortcut" - objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart"> - <action - class="org.eclipse.papyrus.diagram.sequence.part.UMLCreateShortcutAction" - enablesFor="1" - id="org.eclipse.papyrus.diagram.sequence.CreateShortcutAction" - label="%createShortcutActionLabel" - menubarPath="additions"> - </action> - </objectContribution> - <objectContribution - adaptable="false" - id="org.eclipse.papyrus.diagram.sequence.InteractionInteractionCompartment2EditPart.CreateShortcut" - objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart"> - <action - class="org.eclipse.papyrus.diagram.sequence.part.UMLCreateShortcutAction" - enablesFor="1" - id="org.eclipse.papyrus.diagram.sequence.CreateShortcutAction" - label="%createShortcutActionLabel" - menubarPath="additions"> - </action> - </objectContribution> - <objectContribution - adaptable="false" - id="org.eclipse.papyrus.diagram.sequence.LoadResource" - objectClass="org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart"> - <action - class="org.eclipse.papyrus.diagram.sequence.part.UMLLoadResourceAction" - enablesFor="1" - id="org.eclipse.papyrus.diagram.sequence.LoadResourceAction" - label="%loadResourceActionLabel" - menubarPath="additions"> - </action> - </objectContribution> - </extension><extension point="org.eclipse.ui.preferencePages"> - <?gmfgen generated="true"?> - <page - name="%preferences.icons" - class="org.eclipse.papyrus.diagram.sequence.preferences.DiagramIconStylePreferencePage" - category="org.eclipse.uml2.uml.diagram.sequence.general" - id="org.eclipse.papyrus.diagram.sequence.icons"> - </page> - </extension><extension point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders"> - <?gmfgen generated="true"?> - <decoratorProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLShortcutsDecoratorProvider"> - <Priority name="Lowest"/> - </decoratorProvider> - </extension> -<extension point="org.eclipse.core.expressions.propertyTesters"> - <?gmfgen generated="true"?> - <propertyTester - id="org.eclipse.papyrus.diagram.sequence.DomainModelElementPropertyTester" - type="org.eclipse.emf.ecore.EObject" - namespace="org.eclipse.papyrus.diagram.sequence" - properties="isDomainModelElement" - class="org.eclipse.papyrus.diagram.sequence.part.UMLDomainModelElementTester"> - </propertyTester> - </extension><extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders"> - <?gmfgen generated="true"?> - <MarkerNavigationProvider class="org.eclipse.papyrus.diagram.sequence.providers.UMLMarkerNavigationProvider"> - <MarkerType name="org.eclipse.papyrus.diagram.sequence.diagnostic"/> - <Priority name="Lowest"/> - </MarkerNavigationProvider> - </extension> -<extension id="diagnostic" name="MOSKitt UML Sequence Diagram Editor problems" point="org.eclipse.core.resources.markers"> - <?gmfgen generated="true"?> - <super type="org.eclipse.core.resources.problemmarker"/> - <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/> - <persistent value="true"/> - </extension> -<extension point="org.eclipse.emf.validation.constraintProviders"> - <?gmfgen generated="true"?> - <category id="MOSKItt_Sequence_diagram_constraints" mandatory="false" name="MOSKitt Sequence diagram constraints"> - <![CDATA[UML2 sequence diagram constraints]]> - </category> - <category id="MOSKItt_Sequence_diagram_constraints/MOSKitt_Sequence_diagram_constraints_LIVE" mandatory="false" name="MOSKitt Sequence diagram constraints LIVE"> - <![CDATA[UML2 Sequence diagram constraints.]]> - </category> - <constraintProvider cache="true"> - <package namespaceUri="http://www.eclipse.org/uml2/2.1.0/UML"/> - <constraints categories="MOSKItt_Sequence_diagram_constraints"> - </constraints> - <constraints categories="MOSKItt_Sequence_diagram_constraints/MOSKitt_Sequence_diagram_constraints_LIVE"> - <constraint id="unique_name_in_model_container" - lang="Java" class="org.eclipse.papyrus.diagram.sequence.providers.UMLValidationProvider$Adapter1" - name="Unique name in model container" - mode="Live" - severity="ERROR" statusCode="200"> - - <description><![CDATA[Checks an element's name to be unique in its model container.]]></description> - <message><![CDATA[Another element exists qith that name.]]></message> - <target class="uml.NamedElement"/> - </constraint> - </constraints> - </constraintProvider> - </extension> -<extension point="org.eclipse.emf.validation.constraintBindings"> - <?gmfgen generated="true"?> - <clientContext default="false" id="org.eclipse.papyrus.diagram.sequenceDefaultCtx"> - <selector class="org.eclipse.papyrus.diagram.sequence.providers.UMLValidationProvider$DefaultCtx"/> - </clientContext> - <binding context="org.eclipse.papyrus.diagram.sequenceDefaultCtx"> - <constraint ref="org.eclipse.papyrus.diagram.sequence.unique_name_in_model_container"/> - </binding> - - </extension><extension point="org.eclipse.papyrus.diagram.common.viewInfo"> - <?gmfgen generated="true"?> - <RootViewInfo - editorID="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID" - modelTypes="es.cv.gvcase.mdt.common.provider.ModelTypesProviderFactory"> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Package_79" - label="%viewInfo.79" - type="Head" - visualID="79"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Interaction_1001" - label="%viewInfo.1001" - parent="79" - type="Node" - visualID="1001"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Comment_2005" - label="%viewInfo.2005" - parent="79" - type="Node" - visualID="2005"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Interaction_2001" - label="%viewInfo.2001" - parent="2001" - type="Node" - visualID="2001"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Interaction_2001" - label="%viewInfo.2001" - parent="1001" - type="Node" - visualID="2001"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Lifeline_2002" - label="%viewInfo.2002" - parent="2001" - type="Node" - visualID="2002"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Lifeline_2002" - label="%viewInfo.2002" - parent="1001" - type="Node" - visualID="2002"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.BehaviorExecutionSpecification_2003" - label="%viewInfo.2003" - parent="2002" - type="Node" - visualID="2003"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.CombinedFragment_2004" - label="%viewInfo.2004" - parent="2001" - type="Node" - visualID="2004"> - </BaseViewInfo> - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.CombinedFragment_2004" - label="%viewInfo.2004" - parent="1001" - type="Node" - visualID="2004"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3001" - label="%viewInfo.3001" - parent="79" - type="Edge" - visualID="3001"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3001" - label="%viewInfo.4005" - parent="3001" - type="Label" - visualID="4005"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3002" - label="%viewInfo.3002" - parent="79" - type="Edge" - visualID="3002"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3002" - label="%viewInfo.4006" - parent="3002" - type="Label" - visualID="4006"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3003" - label="%viewInfo.3003" - parent="79" - type="Edge" - visualID="3003"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3003" - label="%viewInfo.4007" - parent="3003" - type="Label" - visualID="4007"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3004" - label="%viewInfo.3004" - parent="79" - type="Edge" - visualID="3004"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3004" - label="%viewInfo.4008" - parent="3004" - type="Label" - visualID="4008"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3005" - label="%viewInfo.3005" - parent="79" - type="Edge" - visualID="3005"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3005" - label="%viewInfo.4009" - parent="3005" - type="Label" - visualID="4009"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3006" - label="%viewInfo.3006" - parent="79" - type="Edge" - visualID="3006"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.Message_3006" - label="%viewInfo.4010" - parent="3006" - type="Label" - visualID="4010"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.ElementOwnedComment_3007" - label="%viewInfo.3007" - parent="79" - type="Edge" - visualID="3007"> - </BaseViewInfo> - - <BaseViewInfo - elementType="org.eclipse.papyrus.diagram.sequence.CommentAnnotatedElement_3008" - label="%viewInfo.3008" - parent="79" - type="Edge" - visualID="3008"> - </BaseViewInfo> - </RootViewInfo> - </extension> - <extension - point="org.eclipse.papyrus.diagram.common.moskittEditorFactory"> - <MOSKittEditorFactory - diagramType="MOSKitt UMLSequence" - editorID="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID" - factory="org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorUtil"> - </MOSKittEditorFactory> - </extension> -</plugin> diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/Activator.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/Activator.java deleted file mode 100644 index aa266705618..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/Activator.java +++ /dev/null @@ -1,74 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -// TODO: Auto-generated Javadoc -/** - * The activator class controls the plug-in life cycle. - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - /** The Constant PLUGIN_ID. */ - public static final String PLUGIN_ID = "org.eclipse.papyrus.diagram.sequence.papyrus"; - - // The shared instance - /** The plugin. */ - private static Activator plugin; - - /** - * The constructor. - */ - public Activator() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - /** - * {@inheritDoc} - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - /** - * {@inheritDoc} - */ - @Override - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance. - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/CreateSequenceDiagramCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/CreateSequenceDiagramCommand.java deleted file mode 100644 index de777cc3326..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/CreateSequenceDiagramCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat - * de la Comunitat Valenciana. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * Obeo - *******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence; - -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.papyrus.core.adaptor.gmf.AbstractPapyrusGmfCreateDiagramCommandHandler; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * Define a command to create a new Sequence Diagram. This command is used by all UI (toolbar, outline, creation wizards) to create a new Sequence Diagram. - * - * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a> - * @author <a href="mailto:jerome.benois@obeo.fr">Jerome Benois</a> - */ -public class CreateSequenceDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler { - - /** - * {@inheritDoc} - */ - @Override - protected String getDiagramNotationID() { - return PackageEditPart.MODEL_ID; - } - - /** - * {@inheritDoc} - */ - @Override - protected PreferencesHint getPreferenceHint() { - return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT; - } - - @Override - protected String getDiagramName() { - return super.openDiagramNameDialog("SequenceDiagram"); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java deleted file mode 100644 index 9df13cb9862..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/BehaviorExecutionSpecificationCreateCommand.java +++ /dev/null @@ -1,144 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class BehaviorExecutionSpecificationCreateCommand extends - CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public BehaviorExecutionSpecificationCreateCommand( - CreateElementRequest req, EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static BehaviorExecutionSpecificationCreateCommand create( - CreateElementRequest req, EObject eObject) { - return new BehaviorExecutionSpecificationCreateCommand(req, eObject); - } - - /** - * @generated - */ - public BehaviorExecutionSpecificationCreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated NOT - */ - @Override - protected EObject getElementToEdit() { - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - - // Added to contain the BehaviourExecutionSpecification inside the - // Interaction, not in the Lifeline (where it is shown) - if (container instanceof Lifeline) - return ((Lifeline) container).getInteraction(); - - return container; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated - */ - @Override - protected EObject doDefaultElementCreation() { - BehaviorExecutionSpecification newElement = (BehaviorExecutionSpecification) super - .doDefaultElementCreation(); - if (newElement != null) { - Interaction owner = (Interaction) getElementToEdit(); - owner.getFragments().add(newElement); - - UMLElementTypes - .init_BehaviorExecutionSpecification_2003(newElement); - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java deleted file mode 100644 index 37eb557002d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CombinedFragmentCreateCommand.java +++ /dev/null @@ -1,139 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.CombinedFragment; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class CombinedFragmentCreateCommand extends CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public CombinedFragmentCreateCommand(CreateElementRequest req, - EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static CombinedFragmentCreateCommand create( - CreateElementRequest req, EObject eObject) { - return new CombinedFragmentCreateCommand(req, eObject); - } - - /** - * @generated - */ - public CombinedFragmentCreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated - */ - @Override - protected EObject getElementToEdit() { - - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - if (container != null) { - return container; - } - return eObject; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated - */ - @Override - protected EObject doDefaultElementCreation() { - CombinedFragment newElement = (CombinedFragment) super - .doDefaultElementCreation(); - if (newElement != null) { - Interaction owner = (Interaction) getElementToEdit(); - owner.getFragments().add(newElement); - - UMLElementTypes.init_CombinedFragment_2004(newElement); - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java deleted file mode 100644 index c9a9223b8cc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementCreateCommand.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; - -/** - * @generated - */ -public class CommentAnnotatedElementCreateCommand extends EditElementCommand { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - public CommentAnnotatedElementCreateCommand( - CreateRelationshipRequest request, EObject source, EObject target) { - super(request.getLabel(), null, request); - this.source = source; - this.target = target; - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && false == source instanceof Comment) { - return false; - } - if (target != null && false == target instanceof Element) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined yet - } - // target may be null here but it's possible to check constraint - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateCommentAnnotatedElement_3008(getSource(), getTarget()); - } - - /** - * @generated not - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - if (getSource() != null && getTarget() != null) { - getSource().getAnnotatedElements().add(getTarget()); - - // check the parent of the comment. If has not elements in - // annotatedElement relation, the parent will be this Element; if - // has more than one element, the parent will be the model - if (getSource().getAnnotatedElements().size() == 1) { - getTarget().getOwnedComments().add(getSource()); - } else if (getSource().getAnnotatedElements().size() > 1) { - Model root = (Model) getTarget().eResource().getContents().get( - 0); - root.getOwnedComments().add(getSource()); - } - } - return CommandResult.newOKCommandResult(); - } - - /** - * @generated - */ - protected Comment getSource() { - return (Comment) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java deleted file mode 100644 index d1916c57120..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentAnnotatedElementReorientCommand.java +++ /dev/null @@ -1,191 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; - -/** - * @generated - */ -public class CommentAnnotatedElementReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject referenceOwner; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - public CommentAnnotatedElementReorientCommand( - ReorientReferenceRelationshipRequest request) { - super(request.getLabel(), null, request); - reorientDirection = request.getDirection(); - referenceOwner = request.getReferenceOwner(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == referenceOwner instanceof Comment) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Comment)) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistCommentAnnotatedElement_3008(getNewSource(), - getOldTarget()); - } - - /** - * @generated - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistCommentAnnotatedElement_3008(getOldSource(), - getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated not - */ - protected CommandResult reorientSource() throws ExecutionException { - getOldSource().getAnnotatedElements().remove(getOldTarget()); - getNewSource().getAnnotatedElements().add(getOldTarget()); - - // modify the parent of the old Comment? - // if now it has only one annotated Element - if (getOldSource().getAnnotatedElements().size() == 1) { - getOldSource().getAnnotatedElements().get(0).getOwnedComments() - .add(getOldSource()); - } - // if now it has no annotated Elements - if (getOldSource().getAnnotatedElements().size() == 0) { - ((Model) getOldSource().eResource().getContents().get(0)) - .getOwnedComments().add(getOldSource()); - } - - // modify the parent of the new Comment? - // if now it has only one annotated Element - if (getNewSource().getAnnotatedElements().size() == 1) { - getNewSource().getAnnotatedElements().get(0).getOwnedComments() - .add(getNewSource()); - } - // if now it has more than one annotated Element - if (getNewSource().getAnnotatedElements().size() > 1) { - ((Model) getNewSource().eResource().getContents().get(0)) - .getOwnedComments().add(getNewSource()); - } - - return CommandResult.newOKCommandResult(referenceOwner); - } - - /** - * @generated not - */ - protected CommandResult reorientTarget() throws ExecutionException { - getOldSource().getAnnotatedElements().remove(getOldTarget()); - getOldSource().getAnnotatedElements().add(getNewTarget()); - - // if the number of annotatedElements of the Comment is 1, change the - // container of the Comment - if (getOldSource().getAnnotatedElements().size() == 1) { - getNewTarget().getOwnedComments().add(getOldSource()); - } - - return CommandResult.newOKCommandResult(referenceOwner); - } - - /** - * @generated - */ - protected Comment getOldSource() { - return (Comment) referenceOwner; - } - - /** - * @generated - */ - protected Comment getNewSource() { - return (Comment) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentCreateCommand.java deleted file mode 100644 index 910d6e685c9..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/CommentCreateCommand.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class CommentCreateCommand extends CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public CommentCreateCommand(CreateElementRequest req, EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static CommentCreateCommand create(CreateElementRequest req, - EObject eObject) { - return new CommentCreateCommand(req, eObject); - } - - /** - * @generated - */ - public CommentCreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated - */ - @Override - protected EObject getElementToEdit() { - - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - if (container != null) { - return container; - } - return eObject; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getElement(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - Comment newElement = (Comment) super.doDefaultElementCreation(); - if (newElement != null) { - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentCreateCommand.java deleted file mode 100644 index 9d7273d1795..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentCreateCommand.java +++ /dev/null @@ -1,104 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; - -/** - * @generated - */ -public class ElementOwnedCommentCreateCommand extends EditElementCommand { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - public ElementOwnedCommentCreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request.getLabel(), null, request); - this.source = source; - this.target = target; - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && false == source instanceof Element) { - return false; - } - if (target != null && false == target instanceof Comment) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined yet - } - // target may be null here but it's possible to check constraint - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateElementOwnedComment_3007(getSource(), getTarget()); - } - - /** - * @generated not - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - if (getSource() != null && getTarget() != null) { - getSource().getOwnedComments().add(getTarget()); - - // add the Element to the annotatedElement relation of the Comment - getTarget().getAnnotatedElements().add(getSource()); - - // check the parent of the comment. If has not elements in - // annotatedElement relation, the parent will be this Element; if - // has more than one element, the parent will be the model - if (getTarget().getAnnotatedElements().size() > 1) { - Model root = (Model) getSource().eResource().getContents().get( - 0); - root.getOwnedComments().add(getTarget()); - } - } - return CommandResult.newOKCommandResult(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Comment getTarget() { - return (Comment) target; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentReorientCommand.java deleted file mode 100644 index d5ead9836d5..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/ElementOwnedCommentReorientCommand.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; - -/** - * @generated - */ -public class ElementOwnedCommentReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject referenceOwner; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - public ElementOwnedCommentReorientCommand( - ReorientReferenceRelationshipRequest request) { - super(request.getLabel(), null, request); - reorientDirection = request.getDirection(); - referenceOwner = request.getReferenceOwner(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == referenceOwner instanceof Element) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Comment && newEnd instanceof Element)) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistElementOwnedComment_3007(getNewSource(), - getOldTarget()); - } - - /** - * @generated - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Comment && newEnd instanceof Comment)) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistElementOwnedComment_3007(getOldSource(), - getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated - */ - protected CommandResult reorientSource() throws ExecutionException { - getOldSource().getOwnedComments().remove(getOldTarget()); - getNewSource().getOwnedComments().add(getOldTarget()); - return CommandResult.newOKCommandResult(referenceOwner); - } - - /** - * @generated - */ - protected CommandResult reorientTarget() throws ExecutionException { - getOldSource().getOwnedComments().remove(getOldTarget()); - getOldSource().getOwnedComments().add(getNewTarget()); - return CommandResult.newOKCommandResult(referenceOwner); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) referenceOwner; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Comment getOldTarget() { - return (Comment) oldEnd; - } - - /** - * @generated - */ - protected Comment getNewTarget() { - return (Comment) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Interaction2CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Interaction2CreateCommand.java deleted file mode 100644 index 4ac629de2a6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Interaction2CreateCommand.java +++ /dev/null @@ -1,136 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class Interaction2CreateCommand extends CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public Interaction2CreateCommand(CreateElementRequest req, EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static Interaction2CreateCommand create(CreateElementRequest req, - EObject eObject) { - return new Interaction2CreateCommand(req, eObject); - } - - /** - * @generated - */ - public Interaction2CreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated - */ - @Override - protected EObject getElementToEdit() { - - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - if (container != null) { - return container; - } - return eObject; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated - */ - @Override - protected EObject doDefaultElementCreation() { - Interaction newElement = (Interaction) super.doDefaultElementCreation(); - if (newElement != null) { - Interaction owner = (Interaction) getElementToEdit(); - owner.getFragments().add(newElement); - - UMLElementTypes.init_Interaction_2001(newElement); - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/InteractionCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/InteractionCreateCommand.java deleted file mode 100644 index 743225546d7..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/InteractionCreateCommand.java +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionCreateCommand extends CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public InteractionCreateCommand(CreateElementRequest req, EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static InteractionCreateCommand create(CreateElementRequest req, - EObject eObject) { - return new InteractionCreateCommand(req, eObject); - } - - /** - * @generated - */ - public InteractionCreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated - */ - @Override - protected EObject getElementToEdit() { - - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - if (container != null) { - return container; - } - return eObject; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getPackage(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated - */ - @Override - protected EObject doDefaultElementCreation() { - Interaction newElement = (Interaction) super.doDefaultElementCreation(); - if (newElement != null) { - Package owner = (Package) getElementToEdit(); - owner.getPackagedElements().add(newElement); - - UMLElementTypes.init_Interaction_1001(newElement); - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/LifelineCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/LifelineCreateCommand.java deleted file mode 100644 index 0ff34ee2271..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/LifelineCreateCommand.java +++ /dev/null @@ -1,137 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class LifelineCreateCommand extends CreateElementCommand { - - /** - * @generated - */ - private EClass eClass = null; - /** - * @generated - */ - private EObject eObject = null; - - /** - * @generated - */ - public LifelineCreateCommand(CreateElementRequest req, EObject eObject) { - super(req); - this.eObject = eObject; - this.eClass = eObject != null ? eObject.eClass() : null; - } - - /** - * @generated - */ - public static LifelineCreateCommand create(CreateElementRequest req, - EObject eObject) { - return new LifelineCreateCommand(req, eObject); - } - - /** - * @generated - */ - public LifelineCreateCommand(CreateElementRequest req) { - super(req); - } - - /** - * @generated - */ - @Override - protected EObject getElementToEdit() { - - EObject container = ((CreateElementRequest) getRequest()) - .getContainer(); - if (container instanceof View) { - container = ((View) container).getElement(); - } - if (container != null) { - return container; - } - return eObject; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - - EObject eObject = getElementToEdit(); - if (eObject != null) { - return eObject.eClass(); - } - if (eClass != null) { - return eClass; - } - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - protected Diagram getDiagramFromRequest() { - - if (getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource) != null) { - Object parameter = getRequest().getParameters().get( - MultiDiagramUtil.BelongToDiagramSource); - if (parameter instanceof Diagram) { - return (Diagram) parameter; - } - } - return null; - } - - /** - * @generated - */ - @Override - protected EObject doDefaultElementCreation() { - Lifeline newElement = (Lifeline) super.doDefaultElementCreation(); - if (newElement != null) { - Interaction owner = (Interaction) getElementToEdit(); - owner.getLifelines().add(newElement); - - UMLElementTypes.init_Lifeline_2002(newElement); - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newElement); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newElement); - } - } - return newElement; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2CreateCommand.java deleted file mode 100644 index af07cb05736..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2CreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class Message2CreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public Message2CreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3002(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3002(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CallEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2ReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2ReorientCommand.java deleted file mode 100644 index ffbcb3a94c5..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message2ReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class Message2ReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public Message2ReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3002(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3002(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3CreateCommand.java deleted file mode 100644 index fe2fa751768..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3CreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class Message3CreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public Message3CreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3003(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3003(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CallEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3ReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3ReorientCommand.java deleted file mode 100644 index 13b5d27b37f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message3ReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class Message3ReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public Message3ReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3003(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3003(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4CreateCommand.java deleted file mode 100644 index 849ff02dcbc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4CreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class Message4CreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public Message4CreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3004(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3004(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CallEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4ReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4ReorientCommand.java deleted file mode 100644 index a6370804217..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message4ReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class Message4ReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public Message4ReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3004(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3004(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5CreateCommand.java deleted file mode 100644 index 5550d32cfe2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5CreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class Message5CreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public Message5CreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3005(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3005(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CreationEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5ReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5ReorientCommand.java deleted file mode 100644 index 0747d39a650..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message5ReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class Message5ReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public Message5ReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3005(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3005(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6CreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6CreateCommand.java deleted file mode 100644 index ffe239ed049..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6CreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class Message6CreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public Message6CreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3006(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3006(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CallEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6ReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6ReorientCommand.java deleted file mode 100644 index b98bd353be0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/Message6ReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class Message6ReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public Message6ReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3006(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3006(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageCreateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageCreateCommand.java deleted file mode 100644 index f07a29c56aa..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageCreateCommand.java +++ /dev/null @@ -1,201 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.ElementInitializers; - -/** - * @generated NOT - */ -public class MessageCreateCommand extends MessageTypeLinkCreateCommandCommon { - - /** - * @generated - */ - private final EObject source; - - /** - * @generated - */ - private final EObject target; - - /** - * @generated - */ - private Interaction container; - - /** - * @generated - */ - public MessageCreateCommand(CreateRelationshipRequest request, - EObject source, EObject target) { - super(request); - this.source = source; - this.target = target; - if (request.getContainmentFeature() == null) { - setContainmentFeature(UMLPackage.eINSTANCE.getInteraction_Message()); - } - - // Find container element for the new link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - super.setElementToEdit(container); - break; - } - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (source == null && target == null) { - return false; - } - if (source != null && !(source instanceof Element)) { - return false; - } - if (target != null && !(target instanceof Element)) { - return false; - } - if (getSource() == null) { - return true; // link creation is in progress; source is not defined - // yet - } - // target may be null here but it's possible to check constraint - if (getContainer() == null) { - return false; - } - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canCreateMessage_3001(getContainer(), getSource(), getTarget()); - } - - /** - * @generated NOT - */ - @Override - protected EObject doDefaultElementCreation() { - // org.eclipse.uml2.uml.Message newElement = - // (org.eclipse.uml2.uml.Message) super.doDefaultElementCreation(); - Message newMessage = UMLFactory.eINSTANCE.createMessage(); - getContainer().getMessages().add(newMessage); - - // newElement.setOwner(getSource()); - // newElement.getOwnedElements().add(getTarget()); - - ElementInitializers.init_Message_3001(newMessage); - - // Initialization of the message. This requires the creation of: - // 1. One CallEvent - // 2. Two MessageOccurrenceSpecifications - // 3. Initialization of all the elements (the above elements and the new - // message) - if ((source instanceof Element) && (target instanceof Element)) { - this.doDefaultMessageInitialize(container, (Element) source, - (Element) target, newMessage); - } - - Diagram diagram = getDiagramFromRequest(); - if (diagram != null) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - newMessage); - } else { - MultiDiagramUtil.addEAnnotationReferenceToDiagram( - UMLDiagramEditorPlugin.getInstance(), newMessage); - } - - return newMessage; - } - - /** - * @generated - */ - @Override - protected EClass getEClassToEdit() { - return UMLPackage.eINSTANCE.getInteraction(); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in create link command"); //$NON-NLS-1$ - } - return super.doExecuteWithResult(monitor, info); - } - - /** - * @generated - */ - @Override - protected ConfigureRequest createConfigureRequest() { - ConfigureRequest request = super.createConfigureRequest(); - request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); - request.setParameter(CreateRelationshipRequest.TARGET, getTarget()); - return request; - } - - /** - * @generated - */ - @Override - protected void setElementToEdit(EObject element) { - throw new UnsupportedOperationException(); - } - - /** - * @generated - */ - protected Element getSource() { - return (Element) source; - } - - /** - * @generated - */ - protected Element getTarget() { - return (Element) target; - } - - /** - * @generated - */ - public Interaction getContainer() { - return container; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageReorientCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageReorientCommand.java deleted file mode 100644 index fd39e73819c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/MessageReorientCommand.java +++ /dev/null @@ -1,262 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLBaseItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class MessageReorientCommand extends EditElementCommand { - - /** - * @generated - */ - private final int reorientDirection; - - /** - * @generated - */ - private final EObject oldEnd; - - /** - * @generated - */ - private final EObject newEnd; - - /** - * @generated - */ - private View node; - - /** - * @generated - */ - private View link; - - /** - * @generated - */ - public MessageReorientCommand(ReorientRelationshipRequest request) { - super(request.getLabel(), request.getRelationship(), request); - reorientDirection = request.getDirection(); - oldEnd = request.getOldRelationshipEnd(); - newEnd = request.getNewRelationshipEnd(); - - if (request.getParameter(ReorientLinkIDs.nodeEditPart) != null) { - node = (View) request.getParameter(ReorientLinkIDs.nodeEditPart); - } - if (request.getParameter(ReorientLinkIDs.linkEditPart) != null) { - link = (View) request.getParameter(ReorientLinkIDs.linkEditPart); - } - } - - /** - * @generated - */ - @Override - public boolean canExecute() { - if (false == getElementToEdit() instanceof Message) { - return false; - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return canReorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return canReorientTarget(); - } - return false; - } - - /** - * @generated NOT - */ - protected boolean canReorientSource() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // if (getLink().getOwnedElements().size() != 1) { - // return false; - // } - // Element target = (Element) getLink().getOwnedElements().get(0); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - // Get target element - Element target = MessageCommonUtil.getMessageDst(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3001(container, getNewSource(), target); - } - - /** - * @generated NOT - */ - protected boolean canReorientTarget() { - if (!(oldEnd instanceof Element && newEnd instanceof Element)) { - return false; - } - // Element source = getLink().getOwner(); - if (!(getLink().eContainer() instanceof Interaction)) { - return false; - } - - // Added code - if (!(getLink().getSendEvent() instanceof MessageOccurrenceSpecification)) { - return false; - } - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - // Get source element - Element source = MessageCommonUtil.getMessageSrc(getLink()); - - // End added code - - Interaction container = (Interaction) getLink().eContainer(); - return UMLBaseItemSemanticEditPolicy.LinkConstraints - .canExistMessage_3001(container, source, getNewTarget()); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - if (!canExecute()) { - throw new ExecutionException( - "Invalid arguments in reorient link command"); //$NON-NLS-1$ - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { - return reorientSource(); - } - if (reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) { - return reorientTarget(); - } - throw new IllegalStateException(); - } - - /** - * @generated NOT - */ - protected CommandResult reorientSource() throws ExecutionException { - // getLink().setOwner(getNewSource()); - - // Added code - if (getLink().getSendEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosSource = (MessageOccurrenceSpecification) getLink() - .getSendEvent(); - - mosSource.getCovereds().clear(); - - if (getNewSource() instanceof Lifeline) { - mosSource.getCovereds().add((Lifeline) getNewSource()); - } else if (getNewSource() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosSource.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated NOT - */ - protected CommandResult reorientTarget() throws ExecutionException { - // getLink().getOwnedElements().remove(getOldTarget()); - // getLink().getOwnedElements().add(getNewTarget()); - - // Added code - if (getLink().getReceiveEvent() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification mosTarget = (MessageOccurrenceSpecification) getLink() - .getReceiveEvent(); - - mosTarget.getCovereds().clear(); - - if (getNewTarget() instanceof Lifeline) { - mosTarget.getCovereds().add((Lifeline) getNewTarget()); - } else if (getNewTarget() instanceof BehaviorExecutionSpecification) { - BehaviorExecutionSpecification bes = (BehaviorExecutionSpecification) getNewSource(); - mosTarget.getCovereds().add(bes.getCovereds().get(0)); - } - } - // End added code - - return CommandResult.newOKCommandResult(getLink()); - } - - /** - * @generated - */ - protected Message getLink() { - return (Message) getElementToEdit(); - } - - /** - * @generated - */ - protected Element getOldSource() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewSource() { - return (Element) newEnd; - } - - /** - * @generated - */ - protected Element getOldTarget() { - return (Element) oldEnd; - } - - /** - * @generated - */ - protected Element getNewTarget() { - return (Element) newEnd; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLCreateShortcutDecorationsCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLCreateShortcutDecorationsCommand.java deleted file mode 100644 index 4f316340fe0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLCreateShortcutDecorationsCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLCreateShortcutDecorationsCommand extends - AbstractTransactionalCommand { - - /** - * @generated - */ - private List myDescriptors; - - /** - * @generated - */ - public UMLCreateShortcutDecorationsCommand( - TransactionalEditingDomain editingDomain, View parentView, - List viewDescriptors) { - super(editingDomain, "Create Shortcuts", getWorkspaceFiles(parentView)); //$NON-NLS-1$ - myDescriptors = viewDescriptors; - } - - /** - * @generated - */ - public UMLCreateShortcutDecorationsCommand( - TransactionalEditingDomain editingDomain, View parentView, - CreateViewRequest.ViewDescriptor viewDescriptor) { - this(editingDomain, parentView, Collections - .singletonList(viewDescriptor)); - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor monitor, - IAdaptable info) throws ExecutionException { - for (Iterator it = myDescriptors.iterator(); it.hasNext();) { - CreateViewRequest.ViewDescriptor nextDescriptor = (CreateViewRequest.ViewDescriptor) it - .next(); - View view = (View) nextDescriptor.getAdapter(View.class); - if (view != null && view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$ - EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE - .createEAnnotation(); - shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ - shortcutAnnotation.getDetails().put( - "modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$ - view.getEAnnotations().add(shortcutAnnotation); - } - } - return CommandResult.newOKCommandResult(); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java deleted file mode 100644 index d3e9b577721..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/commands/UMLReorientConnectionViewCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.commands; - -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class UMLReorientConnectionViewCommand extends - AbstractTransactionalCommand { - - /** - * @generated - */ - private IAdaptable edgeAdaptor; - - /** - * @generated - */ - public UMLReorientConnectionViewCommand( - TransactionalEditingDomain editingDomain, String label) { - super(editingDomain, label, null); - } - - /** - * @generated - */ - @Override - public List getAffectedFiles() { - View view = (View) edgeAdaptor.getAdapter(View.class); - if (view != null) { - return getWorkspaceFiles(view); - } - return super.getAffectedFiles(); - } - - /** - * @generated - */ - public IAdaptable getEdgeAdaptor() { - return edgeAdaptor; - } - - /** - * @generated - */ - public void setEdgeAdaptor(IAdaptable edgeAdaptor) { - this.edgeAdaptor = edgeAdaptor; - } - - /** - * @generated - */ - @Override - protected CommandResult doExecuteWithResult( - IProgressMonitor progressMonitor, IAdaptable info) { - assert null != edgeAdaptor : "Null child in UMLReorientConnectionViewCommand"; //$NON-NLS-1$ - Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class); - assert null != edge : "Null edge in UMLReorientConnectionViewCommand"; //$NON-NLS-1$ - View tempView = edge.getSource(); - edge.setSource(edge.getTarget()); - edge.setTarget(tempView); - return CommandResult.newOKCommandResult(); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java deleted file mode 100644 index 6d2e0148d41..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/BehaviorExecutionSpecificationEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class BehaviorExecutionSpecificationEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java deleted file mode 100644 index 2ccf0dd54ff..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CombinedFragmentEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class CombinedFragmentEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CommentEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CommentEditHelper.java deleted file mode 100644 index 101826affb2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/CommentEditHelper.java +++ /dev/null @@ -1,18 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class CommentEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/InteractionEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/InteractionEditHelper.java deleted file mode 100644 index d7a6f69a353..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/InteractionEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class InteractionEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/LifelineEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/LifelineEditHelper.java deleted file mode 100644 index 0abc7d167ce..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/LifelineEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class LifelineEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/MessageEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/MessageEditHelper.java deleted file mode 100644 index b2f81eecb27..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/MessageEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class MessageEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/PackageEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/PackageEditHelper.java deleted file mode 100644 index a7ea4f5a645..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/PackageEditHelper.java +++ /dev/null @@ -1,17 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -/** - * @generated - */ -public class PackageEditHelper extends UMLBaseEditHelper { -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/UMLBaseEditHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/UMLBaseEditHelper.java deleted file mode 100644 index 27eef223822..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/helpers/UMLBaseEditHelper.java +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.helpers; - -import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; - -/** - * @generated - */ -public class UMLBaseEditHelper extends AbstractEditHelper { - - /** - * @generated - */ - public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$ - - /** - * @generated - */ - @Override - protected ICommand getInsteadCommand(IEditCommandRequest req) { - ICommand epCommand = (ICommand) req.getParameter(EDIT_POLICY_COMMAND); - req.setParameter(EDIT_POLICY_COMMAND, null); - ICommand ehCommand = super.getInsteadCommand(req); - if (epCommand == null) { - return ehCommand; - } - if (ehCommand == null) { - return epCommand; - } - CompositeCommand command = new CompositeCommand(null); - command.add(epCommand); - command.add(ehCommand); - return command; - } - - /** - * @generated - */ - @Override - protected ICommand getCreateCommand(CreateElementRequest req) { - return null; - } - - /** - * @generated - */ - @Override - protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) { - return null; - } - - /** - * @generated - */ - @Override - protected ICommand getDestroyElementCommand(DestroyElementRequest req) { - return null; - } - - /** - * @generated - */ - @Override - protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) { - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java deleted file mode 100644 index 9c7ac6da951..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/BehaviorExecutionSpecificationEditPart.java +++ /dev/null @@ -1,559 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.PrecisionPoint; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.graphics.Color; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.commands.PreserveAnchorsPositionCommand; -import org.eclipse.papyrus.diagram.common.commands.ReconnectToIntersectionPoints; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageOrderCommand; -import org.eclipse.papyrus.diagram.sequence.edit.policies.BehaviorExecutionSpecificationItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class BehaviorExecutionSpecificationEditPart extends ShapeNodeEditPart - implements PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 2003; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public BehaviorExecutionSpecificationEditPart(View view) { - super(view); - } - - /** - * This is to modify the feedback if anchors are going to be preserved - * - * @author gmerin - * @NOT-generated - */ - @Override - public void showSourceFeedback(Request request) { - super.showSourceFeedback(PreserveAnchorsPositionCommand - .getNewSourceFeedbackRequest(request, this)); - } - - /** - * /** - * - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new BehaviorExecutionSpecificationItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // XXX need an SCR to runtime to have another abstract superclass that - // would let children add reasonable editpolicies - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies. - // EditPolicyRoles.CONNECTION_HANDLES_ROLE); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - BehaviourExecutionFigure figure = new BehaviourExecutionFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public BehaviourExecutionFigure getPrimaryShape() { - return (BehaviourExecutionFigure) primaryShape; - } - - /** - * @generated NOT - */ - protected NodeFigure createNodePlate() { - BESNodeFigure result = new BESNodeFigure(getMapMode().DPtoLP(16), - getMapMode().DPtoLP(60)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model so - * you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. - * - * @param nodeShape - * instance of generated figure class - * @generated - */ - protected IFigure setupContentPane(IFigure nodeShape) { - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - if (event.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(event); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) event.getFeature(), event - .getNewValue()); - ep.refresh(); - } - } - - } else { - super.handleNotificationEvent(event); - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - DiagramEditPartsUtil - .handleNotificationForDiagram(this, event, features); - } - - /** - * @NOT-generated - */ - @Override - public Command getCommand(Request _request) { - // can create comments by clicking into the compartment - if (_request instanceof CreateUnspecifiedTypeRequest) { - CreateUnspecifiedTypeRequest cutr = (CreateUnspecifiedTypeRequest) _request; - String type = (String) cutr.getType(); - IHintedType iet = (IHintedType) cutr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - if (RequestConstants.REQ_CREATE.equals(type) - && (String.valueOf(CommentEditPart.VISUAL_ID).equals(id))) { - return org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil - .getDiagramEditPart(this).getCommand(_request); - } - }// end - - if (_request instanceof CreateConnectionViewAndElementRequest) { - - CreateConnectionViewAndElementRequest createViewAndElemReq = (CreateConnectionViewAndElementRequest) _request; - - // Only order Message connections - if (!MessageCommonUtil.isMessageEditPart(createViewAndElemReq - .getConnectionViewDescriptor().getSemanticHint())) - return super.getCommand(_request); - - CompoundCommand ccommand = new CompoundCommand(); - - // Needed to add the start command to the request - ccommand.add(super.getCommand(_request)); - - // Check if there is another element at the same point - if (!MessageCommonUtil.checkFreeConnectionEnds(_request)) { - return null; - } - - // Add a command to swap between created anchors (points where the - // user clicked and dropped the connection) with the real - // intersection points - ccommand - .add(new ReconnectToIntersectionPoints(createViewAndElemReq)); - - // Creation of the ordering command - MessageOrderCommand msgOrderCmd = new MessageOrderCommand( - createViewAndElemReq); - ccommand.add(msgOrderCmd); - - return ccommand; - } - - if (_request instanceof ReconnectRequest) { - - ReconnectRequest reconnReq = (ReconnectRequest) _request; - - // Only order Message connections - if (!MessageCommonUtil.isMessageEditPart(reconnReq - .getConnectionEditPart())) - return super.getCommand(_request); - - CompoundCommand ccommand = new CompoundCommand(); - - // Check if there is another element at the same point - if (!MessageCommonUtil.checkFreeConnectionEnds(_request)) { - return null; - } - - // Modify the request with the real target anchoring point instead - // of target mouse reference point - ReconnectToIntersectionPoints.modifyLocation(reconnReq); - - // Create the commands with the real target anchoring point - ccommand.add(super.getCommand(_request)); - - // Creation of the re-orientation/re-anchoring command - MessageOrderCommand msgOrderCmd = new MessageOrderCommand(reconnReq); - ccommand.add(msgOrderCmd); - - return ccommand; - } - - return super.getCommand(_request); - } - - /** - * @NOT-generated - */ - public class BESNodeFigure extends DefaultSizeNodeFigure { - - public BESNodeFigure(Dimension defSize) { - super(defSize.width, defSize.height); - } - - public BESNodeFigure(int width, int height) { - super(width, height); - } - - @Override - protected boolean isDefaultAnchorArea(PrecisionPoint p) { - // We don't want a default anchor area for the BES Node Figure. - return false; - } - - } - - /** - * @generated - */ - public class BehaviourExecutionFigure extends RectangleFigure { - - /** - * @generated - */ - public BehaviourExecutionFigure() { - this.setForegroundColor(ColorConstants.black); - this.setBackgroundColor(THIS_BACK); - this.setMaximumSize(new Dimension(getMapMode().DPtoLP(16), - getMapMode().DPtoLP(1000))); - this.setMinimumSize(new Dimension(getMapMode().DPtoLP(16), - getMapMode().DPtoLP(25))); - } - - /** - * @generated - */ - private boolean myUseLocalCoordinates = false; - - /** - * @generated - */ - @Override - protected boolean useLocalCoordinates() { - return myUseLocalCoordinates; - } - - /** - * @generated - */ - protected void setUseLocalCoordinates(boolean useLocalCoordinates) { - myUseLocalCoordinates = useLocalCoordinates; - } - - } - - /** - * @generated - */ - static final Color THIS_BACK = new Color(null, 255, 215, 174); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentEditPart.java deleted file mode 100644 index 214e4eae79d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentEditPart.java +++ /dev/null @@ -1,561 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.BorderLayout; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.draw2d.InteractionFigure; -import org.eclipse.papyrus.diagram.common.draw2d.LeftToolbarLayout; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.CombinedFragmentItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class CombinedFragmentEditPart extends ShapeNodeEditPart implements - PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 2004; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public CombinedFragmentEditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new CombinedFragmentItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - CombinedFragmentFigure figure = new CombinedFragmentFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public CombinedFragmentFigure getPrimaryShape() { - return (CombinedFragmentFigure) primaryShape; - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof CombinedFragmentInteractionOperatorEditPart) { - ((CombinedFragmentInteractionOperatorEditPart) childEditPart) - .setLabel(getPrimaryShape() - .getFigureCombinedFragmentLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean removeFixedChild(EditPart childEditPart) { - - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * @generated - */ - @Override - protected void removeChildVisual(EditPart childEditPart) { - if (removeFixedChild(childEditPart)) { - return; - } - super.removeChildVisual(childEditPart); - } - - /** - * @generated - */ - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - - return super.getContentPaneFor(editPart); - } - - /** - * @generated - */ - protected NodeFigure createNodePlate() { - DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode() - .DPtoLP(200), getMapMode().DPtoLP(200)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model so - * you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. - * - * @param nodeShape - * instance of generated figure class - * @generated - */ - protected IFigure setupContentPane(IFigure nodeShape) { - if (nodeShape.getLayoutManager() == null) { - ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); - layout.setSpacing(getMapMode().DPtoLP(5)); - nodeShape.setLayoutManager(layout); - } - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - public EditPart getPrimaryChildEditPart() { - return getChildBySemanticHint(UMLVisualIDRegistry - .getType(CombinedFragmentInteractionOperatorEditPart.VISUAL_ID)); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - if (event.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(event); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) event.getFeature(), event - .getNewValue()); - ep.refresh(); - } - } - - } else { - super.handleNotificationEvent(event); - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - DiagramEditPartsUtil - .handleNotificationForDiagram(this, event, features); - } - - /** - * @generated - */ - public class CombinedFragmentFigure extends RectangleFigure { - - /** - * @generated - */ - private WrappingLabel fFigureCombinedFragmentLabelFigure; - - /** - * @generated - */ - public CombinedFragmentFigure() { - - BorderLayout layoutThis = new BorderLayout(); - this.setLayoutManager(layoutThis); - - this.setFill(false); - this.setForegroundColor(ColorConstants.black); - this.setBorder(new MarginBorder(getMapMode().DPtoLP(-2), - getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3))); - createContents(); - } - - /** - * @generated - */ - private void createContents() { - - RectangleFigure combinedFragmentLabel0 = new RectangleFigure(); - combinedFragmentLabel0.setFill(false); - combinedFragmentLabel0.setOutline(false); - - this.add(combinedFragmentLabel0, BorderLayout.TOP); - - BorderLayout layoutCombinedFragmentLabel0 = new BorderLayout(); - combinedFragmentLabel0 - .setLayoutManager(layoutCombinedFragmentLabel0); - - InteractionFigure combinedFragmentLabelContainer1 = new InteractionFigure(); - - combinedFragmentLabelContainer1.setBorder(new MarginBorder( - getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3), getMapMode().DPtoLP(3))); - - combinedFragmentLabel0.add(combinedFragmentLabelContainer1, - BorderLayout.LEFT); - - LeftToolbarLayout layoutCombinedFragmentLabelContainer1 = new LeftToolbarLayout(); - - combinedFragmentLabelContainer1 - .setLayoutManager(layoutCombinedFragmentLabelContainer1); - - fFigureCombinedFragmentLabelFigure = new WrappingLabel(); - fFigureCombinedFragmentLabelFigure.setText(""); - - fFigureCombinedFragmentLabelFigure - .setFont(FFIGURECOMBINEDFRAGMENTLABELFIGURE_FONT); - - combinedFragmentLabelContainer1 - .add(fFigureCombinedFragmentLabelFigure); - - } - - /** - * @generated - */ - private boolean myUseLocalCoordinates = false; - - /** - * @generated - */ - @Override - protected boolean useLocalCoordinates() { - return myUseLocalCoordinates; - } - - /** - * @generated - */ - protected void setUseLocalCoordinates(boolean useLocalCoordinates) { - myUseLocalCoordinates = useLocalCoordinates; - } - - /** - * @generated - */ - public WrappingLabel getFigureCombinedFragmentLabelFigure() { - return fFigureCombinedFragmentLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGURECOMBINEDFRAGMENTLABELFIGURE_FONT = new Font( - Display.getCurrent(), "SANS", 10, SWT.BOLD); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -}
\ No newline at end of file diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentInteractionOperatorEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentInteractionOperatorEditPart.java deleted file mode 100644 index b288fa8d167..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CombinedFragmentInteractionOperatorEditPart.java +++ /dev/null @@ -1,609 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.handles.NonResizableHandleKit; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class CombinedFragmentInteractionOperatorEditPart extends - CompartmentEditPart implements ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4002; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - public CombinedFragmentInteractionOperatorEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, - new NonResizableEditPolicy() { - - protected List createSelectionHandles() { - List handles = new ArrayList(); - NonResizableHandleKit.addMoveHandle( - (GraphicalEditPart) getHost(), handles); - return handles; - } - - public Command getCommand(Request request) { - return null; - } - - public boolean understandsRequest(Request request) { - return false; - } - }); - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.CombinedFragment_2004, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void addNotationalListeners() { - super.addNotationalListeners(); - addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void removeNotationalListeners() { - super.removeNotationalListeners(); - removeListenerFilter("PrimaryView"); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java deleted file mode 100644 index 34f5a13a598..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentAnnotatedElementEditPart.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; - -import java.util.List; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.Graphics; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.CommentAnnotatedElementItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class CommentAnnotatedElementEditPart extends ConnectionNodeEditPart - implements ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3008; - - /** - * @generated - */ - public CommentAnnotatedElementEditPart(View view) { - super(view); - } - - /** - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new CommentAnnotatedElementItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - CommentAnnotatedElementEditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new CommentLinkFigure(); - } - - /** - * @generated - */ - public CommentLinkFigure getPrimaryShape() { - return (CommentLinkFigure) getFigure(); - } - - /** - * @generated - */ - public class CommentLinkFigure extends PolylineConnectionEx { - - /** - * @generated - */ - public CommentLinkFigure() { - this.setLineStyle(Graphics.LINE_DASHDOT); - this.setForegroundColor(ColorConstants.lightGray); - - } - - } - - /** - * @generated - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - // no target or source features found - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - - /** - * @generated not - */ - @Override - public Command getCommand(Request _request) { - if (_request instanceof GroupRequest - && RequestConstants.REQ_DELETE.equals(_request.getType())) { - return getEditPolicy(EditPolicyRoles.SEMANTIC_ROLE).getCommand( - _request); - } - - return super.getCommand(_request); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentBodyEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentBodyEditPart.java deleted file mode 100644 index 878d2d7ca0f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentBodyEditPart.java +++ /dev/null @@ -1,612 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.handles.NonResizableHandleKit; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class CommentBodyEditPart extends CompartmentEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 5003; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - public CommentBodyEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, - new NonResizableEditPolicy() { - - protected List createSelectionHandles() { - List handles = new ArrayList(); - NonResizableHandleKit.addMoveHandle( - (GraphicalEditPart) getHost(), handles); - return handles; - } - - public Command getCommand(Request request) { - return null; - } - - public boolean understandsRequest(Request request) { - return false; - } - }); - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated not - */ - public void setLabel(WrapLabel figure) { - unregisterVisuals(); - setFigure(figure); - figure.setTextWrap(true); - defaultText = getLabelTextHelper(figure); - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return getParser() != null; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Comment_2005, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void addNotationalListeners() { - super.addNotationalListeners(); - addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void removeNotationalListeners() { - super.removeNotationalListeners(); - removeListenerFilter("PrimaryView"); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentEditPart.java deleted file mode 100644 index 0018a00b264..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/CommentEditPart.java +++ /dev/null @@ -1,607 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.Shape; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.CommentItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class CommentEditPart extends ShapeNodeEditPart implements - PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 2005; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public CommentEditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new CommentItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - CommentFigure figure = new CommentFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public CommentFigure getPrimaryShape() { - return (CommentFigure) primaryShape; - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof CommentBodyEditPart) { - ((CommentBodyEditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureCommentBody_label()); - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean removeFixedChild(EditPart childEditPart) { - - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * @generated - */ - @Override - protected void removeChildVisual(EditPart childEditPart) { - if (removeFixedChild(childEditPart)) { - return; - } - super.removeChildVisual(childEditPart); - } - - /** - * @generated - */ - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - - return super.getContentPaneFor(editPart); - } - - /** - * @generated - */ - protected NodeFigure createNodePlate() { - DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode() - .DPtoLP(160), getMapMode().DPtoLP(75)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. - * Respects layout one may have set for generated figure. - * @param nodeShape instance of generated figure class - * @generated - */ - protected IFigure setupContentPane(IFigure nodeShape) { - if (nodeShape.getLayoutManager() == null) { - ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); - layout.setSpacing(getMapMode().DPtoLP(5)); - nodeShape.setLayoutManager(layout); - } - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - public EditPart getPrimaryChildEditPart() { - return getChildBySemanticHint(UMLVisualIDRegistry - .getType(CommentBodyEditPart.VISUAL_ID)); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - - if (event.getNotifier() == getModel() - && EcorePackage.eINSTANCE.getEModelElement_EAnnotations() - .equals(event.getFeature())) { - handleMajorSemanticChange(); - } else if (event.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(event); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) event.getFeature(), event - .getNewValue()); - ep.refresh(); - } - } - - } - - else { - super.handleNotificationEvent(event); - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - features.add(UMLPackage.eINSTANCE.getComment_AnnotatedElement()); - DiagramEditPartsUtil - .handleNotificationForDiagram(this, event, features); - } - - /** - * @generated - */ - public class CommentFigure extends Shape { - - /** - * @generated - */ - private WrappingLabel fFigureCommentBody_label; - - /** - * @generated - */ - public CommentFigure() { - this.addPoint(new Point(getMapMode().DPtoLP(90), getMapMode() - .DPtoLP(0))); - this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode() - .DPtoLP(0))); - this.addPoint(new Point(getMapMode().DPtoLP(0), getMapMode() - .DPtoLP(60))); - this.addPoint(new Point(getMapMode().DPtoLP(100), getMapMode() - .DPtoLP(60))); - this.addPoint(new Point(getMapMode().DPtoLP(100), getMapMode() - .DPtoLP(10))); - this.addPoint(new Point(getMapMode().DPtoLP(90), getMapMode() - .DPtoLP(0))); - this.addPoint(new Point(getMapMode().DPtoLP(90), getMapMode() - .DPtoLP(10))); - this.addPoint(new Point(getMapMode().DPtoLP(100), getMapMode() - .DPtoLP(10))); - this.addPoint(new Point(getMapMode().DPtoLP(90), getMapMode() - .DPtoLP(0))); - this.setFill(true); - this.setForegroundColor(ColorConstants.black); - this.setBackgroundColor(ColorConstants.white); - createContents(); - } - - /** - * @generated - */ - private void createContents() { - - fFigureCommentBody_label = new WrappingLabel(); - fFigureCommentBody_label.setText(""); - - fFigureCommentBody_label.setFont(FFIGURECOMMENTBODY_LABEL_FONT); - - fFigureCommentBody_label.setBorder(new MarginBorder(getMapMode() - .DPtoLP(2), getMapMode().DPtoLP(2), getMapMode().DPtoLP(2), - getMapMode().DPtoLP(15))); - - this.add(fFigureCommentBody_label); - - } - - /** - * @generated - */ - private final PointList myTemplate = new PointList(); - /** - * @generated - */ - private Rectangle myTemplateBounds; - - /** - * @generated - */ - public void addPoint(Point point) { - myTemplate.addPoint(point); - myTemplateBounds = null; - } - - /** - * @generated - */ - @Override - protected void fillShape(Graphics graphics) { - Rectangle bounds = getBounds(); - graphics.pushState(); - graphics.translate(bounds.x, bounds.y); - graphics.fillPolygon(scalePointList()); - graphics.popState(); - } - - /** - * @generated - */ - @Override - protected void outlineShape(Graphics graphics) { - Rectangle bounds = getBounds(); - graphics.pushState(); - graphics.translate(bounds.x, bounds.y); - graphics.drawPolygon(scalePointList()); - graphics.popState(); - } - - /** - * @generated - */ - private Rectangle getTemplateBounds() { - if (myTemplateBounds == null) { - myTemplateBounds = myTemplate.getBounds().getCopy().union(0, 0); - //just safety -- we are going to use this as divider - if (myTemplateBounds.width < 1) { - myTemplateBounds.width = 1; - } - if (myTemplateBounds.height < 1) { - myTemplateBounds.height = 1; - } - } - return myTemplateBounds; - } - - /** - * @generated - */ - private int[] scalePointList() { - Rectangle pointsBounds = getTemplateBounds(); - Rectangle actualBounds = getBounds(); - - float xScale = ((float) actualBounds.width) / pointsBounds.width; - float yScale = ((float) actualBounds.height) / pointsBounds.height; - - if (xScale == 1 && yScale == 1) { - return myTemplate.toIntArray(); - } - int[] scaled = (int[]) myTemplate.toIntArray().clone(); - for (int i = 0; i < scaled.length; i += 2) { - scaled[i] = (int) Math.floor(scaled[i] * xScale); - scaled[i + 1] = (int) Math.floor(scaled[i + 1] * yScale); - } - return scaled; - } - - /** - * @generated - */ - public WrappingLabel getFigureCommentBody_label() { - return fFigureCommentBody_label; - } - - } - - /** - * @generated - */ - static final Font FFIGURECOMMENTBODY_LABEL_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/ElementOwnedCommentEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/ElementOwnedCommentEditPart.java deleted file mode 100644 index 37c6965e993..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/ElementOwnedCommentEditPart.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; - -import java.util.List; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.Graphics; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.ElementOwnedCommentItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class ElementOwnedCommentEditPart extends ConnectionNodeEditPart - implements ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3007; - - /** - * @generated - */ - public ElementOwnedCommentEditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new ElementOwnedCommentItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - ElementOwnedCommentEditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new CommentLinkFigure(); - } - - /** - * @generated - */ - public CommentLinkFigure getPrimaryShape() { - return (CommentLinkFigure) getFigure(); - } - - /** - * @generated - */ - public class CommentLinkFigure extends PolylineConnectionEx { - - /** - * @generated - */ - public CommentLinkFigure() { - this.setLineStyle(Graphics.LINE_DASHDOT); - this.setForegroundColor(ColorConstants.lightGray); - - } - - } - - /** - * @generated - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - // no target or source features found - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - - /** - * @generated not - */ - @Override - public Command getCommand(Request _request) { - if (_request instanceof GroupRequest - && RequestConstants.REQ_DELETE.equals(_request.getType())) { - return getEditPolicy(EditPolicyRoles.SEMANTIC_ROLE).getCommand( - _request); - } - - return super.getCommand(_request); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Interaction2EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Interaction2EditPart.java deleted file mode 100644 index 4840252de3f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Interaction2EditPart.java +++ /dev/null @@ -1,603 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.BorderLayout; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; - -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.draw2d.InteractionFigure; -import org.eclipse.papyrus.diagram.common.draw2d.LeftToolbarLayout; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Interaction2ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Interaction2EditPart extends ShapeNodeEditPart implements - PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 2001; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public Interaction2EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Interaction2ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - InteractionRectangleFigure figure = new InteractionRectangleFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public InteractionRectangleFigure getPrimaryShape() { - return (InteractionRectangleFigure) primaryShape; - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof InteractionName2EditPart) { - ((InteractionName2EditPart) childEditPart) - .setLabel(getPrimaryShape() - .getFigureInteractionLabelFigure()); - return true; - } - if (childEditPart instanceof InteractionInteractionCompartment2EditPart) { - IFigure pane = getPrimaryShape() - .getFigureInteractionCompartmentFigure(); - setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way - pane - .add(((InteractionInteractionCompartment2EditPart) childEditPart) - .getFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean removeFixedChild(EditPart childEditPart) { - - if (childEditPart instanceof InteractionInteractionCompartment2EditPart) { - IFigure pane = getPrimaryShape() - .getFigureInteractionCompartmentFigure(); - pane - .remove(((InteractionInteractionCompartment2EditPart) childEditPart) - .getFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * @generated - */ - @Override - protected void removeChildVisual(EditPart childEditPart) { - if (removeFixedChild(childEditPart)) { - return; - } - super.removeChildVisual(childEditPart); - } - - /** - * @generated - */ - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - - if (editPart instanceof InteractionInteractionCompartment2EditPart) { - return getPrimaryShape().getFigureInteractionCompartmentFigure(); - } - return super.getContentPaneFor(editPart); - } - - /** - * @generated - */ - protected NodeFigure createNodePlate() { - DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode() - .DPtoLP(600), getMapMode().DPtoLP(400)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. - * Respects layout one may have set for generated figure. - * @param nodeShape instance of generated figure class - * @generated - */ - protected IFigure setupContentPane(IFigure nodeShape) { - if (nodeShape.getLayoutManager() == null) { - ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); - layout.setSpacing(getMapMode().DPtoLP(5)); - nodeShape.setLayoutManager(layout); - } - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - public EditPart getPrimaryChildEditPart() { - return getChildBySemanticHint(UMLVisualIDRegistry - .getType(InteractionName2EditPart.VISUAL_ID)); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - if (event.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(event); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) event.getFeature(), event - .getNewValue()); - ep.refresh(); - } - } - - } else { - super.handleNotificationEvent(event); - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - DiagramEditPartsUtil - .handleNotificationForDiagram(this, event, features); - } - - /** - * @generated - */ - public class InteractionRectangleFigure extends RectangleFigure { - - /** - * @generated - */ - private WrappingLabel fFigureInteractionLabelFigure; - /** - * @generated - */ - private RectangleFigure fFigureInteractionCompartmentFigure; - - /** - * @generated - */ - public InteractionRectangleFigure() { - - BorderLayout layoutThis = new BorderLayout(); - this.setLayoutManager(layoutThis); - - this.setFill(false); - this.setForegroundColor(ColorConstants.black); - this.setBorder(new MarginBorder(getMapMode().DPtoLP(-2), - getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3))); - createContents(); - } - - /** - * @generated - */ - private void createContents() { - - RectangleFigure interactionLabel0 = new RectangleFigure(); - interactionLabel0.setFill(false); - interactionLabel0.setOutline(false); - - this.add(interactionLabel0, BorderLayout.TOP); - - BorderLayout layoutInteractionLabel0 = new BorderLayout(); - interactionLabel0.setLayoutManager(layoutInteractionLabel0); - - InteractionFigure interactionLabelContainer1 = new InteractionFigure(); - - interactionLabelContainer1.setBorder(new MarginBorder(getMapMode() - .DPtoLP(3), getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3))); - - interactionLabel0 - .add(interactionLabelContainer1, BorderLayout.LEFT); - - LeftToolbarLayout layoutInteractionLabelContainer1 = new LeftToolbarLayout(); - - interactionLabelContainer1 - .setLayoutManager(layoutInteractionLabelContainer1); - - fFigureInteractionLabelFigure = new WrappingLabel(); - fFigureInteractionLabelFigure.setText(""); - - fFigureInteractionLabelFigure - .setFont(FFIGUREINTERACTIONLABELFIGURE_FONT); - - interactionLabelContainer1.add(fFigureInteractionLabelFigure); - - fFigureInteractionCompartmentFigure = new RectangleFigure(); - fFigureInteractionCompartmentFigure.setFill(false); - fFigureInteractionCompartmentFigure.setOutline(false); - fFigureInteractionCompartmentFigure.setLineWidth(0); - fFigureInteractionCompartmentFigure - .setForegroundColor(ColorConstants.white); - - this.add(fFigureInteractionCompartmentFigure, BorderLayout.CENTER); - - } - - /** - * @generated - */ - private boolean myUseLocalCoordinates = false; - - /** - * @generated - */ - @Override - protected boolean useLocalCoordinates() { - return myUseLocalCoordinates; - } - - /** - * @generated - */ - protected void setUseLocalCoordinates(boolean useLocalCoordinates) { - myUseLocalCoordinates = useLocalCoordinates; - } - - /** - * @generated - */ - public WrappingLabel getFigureInteractionLabelFigure() { - return fFigureInteractionLabelFigure; - } - - /** - * @generated - */ - public RectangleFigure getFigureInteractionCompartmentFigure() { - return fFigureInteractionCompartmentFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREINTERACTIONLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 10, SWT.BOLD); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionEditPart.java deleted file mode 100644 index 60d3e2f9182..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionEditPart.java +++ /dev/null @@ -1,611 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.BorderLayout; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.draw2d.InteractionFigure; -import org.eclipse.papyrus.diagram.common.draw2d.LeftToolbarLayout; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionEditPart extends ShapeNodeEditPart implements - PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 1001; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public InteractionEditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new InteractionItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - InteractionRectangleFigure figure = new InteractionRectangleFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public InteractionRectangleFigure getPrimaryShape() { - return (InteractionRectangleFigure) primaryShape; - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof InteractionNameEditPart) { - ((InteractionNameEditPart) childEditPart) - .setLabel(getPrimaryShape() - .getFigureInteractionLabelFigure()); - return true; - } - if (childEditPart instanceof InteractionInteractionCompartmentEditPart) { - IFigure pane = getPrimaryShape() - .getFigureInteractionCompartmentFigure(); - setupContentPane(pane); // FIXME each comparment should handle his content pane in his own way - pane - .add(((InteractionInteractionCompartmentEditPart) childEditPart) - .getFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean removeFixedChild(EditPart childEditPart) { - - if (childEditPart instanceof InteractionInteractionCompartmentEditPart) { - IFigure pane = getPrimaryShape() - .getFigureInteractionCompartmentFigure(); - pane - .remove(((InteractionInteractionCompartmentEditPart) childEditPart) - .getFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * @generated - */ - @Override - protected void removeChildVisual(EditPart childEditPart) { - if (removeFixedChild(childEditPart)) { - return; - } - super.removeChildVisual(childEditPart); - } - - /** - * @generated - */ - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - - if (editPart instanceof InteractionInteractionCompartmentEditPart) { - return getPrimaryShape().getFigureInteractionCompartmentFigure(); - } - return super.getContentPaneFor(editPart); - } - - /** - * @generated - */ - protected NodeFigure createNodePlate() { - DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(getMapMode() - .DPtoLP(600), getMapMode().DPtoLP(400)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. - * Respects layout one may have set for generated figure. - * @param nodeShape instance of generated figure class - * @generated - */ - protected IFigure setupContentPane(IFigure nodeShape) { - if (nodeShape.getLayoutManager() == null) { - ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); - layout.setSpacing(getMapMode().DPtoLP(5)); - nodeShape.setLayoutManager(layout); - } - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - public EditPart getPrimaryChildEditPart() { - return getChildBySemanticHint(UMLVisualIDRegistry - .getType(InteractionNameEditPart.VISUAL_ID)); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - - if (event.getNotifier() == getModel() - && EcorePackage.eINSTANCE.getEModelElement_EAnnotations() - .equals(event.getFeature())) { - handleMajorSemanticChange(); - } else if (event.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(event); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) event.getFeature(), event - .getNewValue()); - ep.refresh(); - } - } - - } - - else { - super.handleNotificationEvent(event); - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getInteraction_Message()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - DiagramEditPartsUtil - .handleNotificationForDiagram(this, event, features); - } - - /** - * @generated - */ - public class InteractionRectangleFigure extends RectangleFigure { - - /** - * @generated - */ - private WrappingLabel fFigureInteractionLabelFigure; - /** - * @generated - */ - private RectangleFigure fFigureInteractionCompartmentFigure; - - /** - * @generated - */ - public InteractionRectangleFigure() { - - BorderLayout layoutThis = new BorderLayout(); - this.setLayoutManager(layoutThis); - - this.setFill(false); - this.setForegroundColor(ColorConstants.black); - this.setBorder(new MarginBorder(getMapMode().DPtoLP(-2), - getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3))); - createContents(); - } - - /** - * @generated - */ - private void createContents() { - - RectangleFigure interactionLabel0 = new RectangleFigure(); - interactionLabel0.setFill(false); - interactionLabel0.setOutline(false); - - this.add(interactionLabel0, BorderLayout.TOP); - - BorderLayout layoutInteractionLabel0 = new BorderLayout(); - interactionLabel0.setLayoutManager(layoutInteractionLabel0); - - InteractionFigure interactionLabelContainer1 = new InteractionFigure(); - - interactionLabelContainer1.setBorder(new MarginBorder(getMapMode() - .DPtoLP(3), getMapMode().DPtoLP(3), getMapMode().DPtoLP(3), - getMapMode().DPtoLP(3))); - - interactionLabel0 - .add(interactionLabelContainer1, BorderLayout.LEFT); - - LeftToolbarLayout layoutInteractionLabelContainer1 = new LeftToolbarLayout(); - - interactionLabelContainer1 - .setLayoutManager(layoutInteractionLabelContainer1); - - fFigureInteractionLabelFigure = new WrappingLabel(); - fFigureInteractionLabelFigure.setText(""); - - fFigureInteractionLabelFigure - .setFont(FFIGUREINTERACTIONLABELFIGURE_FONT); - - interactionLabelContainer1.add(fFigureInteractionLabelFigure); - - fFigureInteractionCompartmentFigure = new RectangleFigure(); - fFigureInteractionCompartmentFigure.setFill(false); - fFigureInteractionCompartmentFigure.setOutline(false); - fFigureInteractionCompartmentFigure.setLineWidth(0); - fFigureInteractionCompartmentFigure - .setForegroundColor(ColorConstants.white); - - this.add(fFigureInteractionCompartmentFigure, BorderLayout.CENTER); - - } - - /** - * @generated - */ - private boolean myUseLocalCoordinates = false; - - /** - * @generated - */ - @Override - protected boolean useLocalCoordinates() { - return myUseLocalCoordinates; - } - - /** - * @generated - */ - protected void setUseLocalCoordinates(boolean useLocalCoordinates) { - myUseLocalCoordinates = useLocalCoordinates; - } - - /** - * @generated - */ - public WrappingLabel getFigureInteractionLabelFigure() { - return fFigureInteractionLabelFigure; - } - - /** - * @generated - */ - public RectangleFigure getFigureInteractionCompartmentFigure() { - return fFigureInteractionCompartmentFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREINTERACTIONLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 10, SWT.BOLD); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartment2EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartment2EditPart.java deleted file mode 100644 index de945fdb5a6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartment2EditPart.java +++ /dev/null @@ -1,311 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.diagram.ui.requests.ZOrderRequest; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.ChangeZOrderOfCreatedEP; -import org.eclipse.papyrus.diagram.common.editpolicies.DragDropEditPolicy; -import org.eclipse.papyrus.diagram.common.editpolicies.ViewAndFeatureResolver; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CreateLifelineAndBESCommand; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionCompartmentXYLayoutEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionInteractionCompartment2CanonicalEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionInteractionCompartment2ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDiagramDragAndDropEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionInteractionCompartment2EditPart extends - ShapeCompartmentEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 5002; - - /** - * @generated NOT - */ - private final ViewAndFeatureResolver resolver = new ViewAndFeatureResolver() { - - /** - * generated NOT - */ - public boolean isEObjectNode(EObject element) { - if (element instanceof Interaction) { - // Check if is children - if (resolveSemanticElement().eContents().contains(element)) { - // check if there is no existing view of the children - if (DiagramEditPartsUtil.getEObjectViews(element).size() == 0) - return true; - } - } - return false; - } - - public boolean isEObjectLink(EObject element) { - return false; - } - - public int getEObjectSemanticHint(EObject element) { - if (element instanceof Interaction) { - return UMLVisualIDRegistry.getNodeVisualID(getNotationView(), - element); - } - return -1; - } - - public EStructuralFeature getEStructuralFeatureForEClass(EClass class1) { - return null; - } - }; - - /** - * @generated - */ - public InteractionInteractionCompartment2EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - public String getCompartmentName() { - return Messages.InteractionInteractionCompartment2EditPart_title; - } - - /** - * @generated - */ - @Override - public IFigure createFigure() { - ResizableCompartmentFigure result = (ResizableCompartmentFigure) super - .createFigure(); - result.setTitleVisibility(false); - return result; - } - - /** - * Modified to install custom Drag&Drop policy. - * - * @author Gabriel Merin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new InteractionInteractionCompartment2ItemSemanticEditPolicy()); - installEditPolicy(EditPolicyRoles.CREATION_ROLE, - new CreationEditPolicy()); - DragDropEditPolicy dragAndDropEditPolicy = null; - dragAndDropEditPolicy = new DragDropEditPolicy(resolver); - // fjcano: modified to add custom Drag&Drop policy - installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, - new SequenceDiagramDragAndDropEditPolicy(resolver)); - - installEditPolicy(EditPolicy.LAYOUT_ROLE, - new InteractionCompartmentXYLayoutEditPolicy()); - - installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, - new InteractionInteractionCompartment2CanonicalEditPolicy()); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - - if (notification.getNotifier() instanceof ShapeStyle) { - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) notification.getFeature(), - notification.getNewValue()); - ep.refresh(); - } - } - - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getInteraction_Fragment()); - features.add(UMLPackage.eINSTANCE.getInteraction_Lifeline()); - features.add(UMLPackage.eINSTANCE.getInteraction_Fragment()); - DiagramEditPartsUtil.handleNotificationForView(this, notification, - features); - } - - /** - * @generated - */ - @Override - protected void setRatio(Double ratio) { - if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { - super.setRatio(ratio); - } - } - - /** - * When creating of a Lifeline a BES will be created too - * - * @generated-NOT - */ - @Override - public Command getCommand(Request _request) { - - // lets to create a CommentLink for an Activity by clicking in the - // Subvertices Compartment - if (_request instanceof CreateUnspecifiedTypeConnectionRequest) { - CreateUnspecifiedTypeConnectionRequest cutcr = (CreateUnspecifiedTypeConnectionRequest) _request; - String type = (String) cutcr.getType(); - IHintedType iet = (IHintedType) cutcr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_START - .equals(type) - && String.valueOf(ElementOwnedCommentEditPart.VISUAL_ID) - .equals(id)) { - if (cutcr.getTargetEditPart() instanceof InteractionInteractionCompartment2EditPart) - cutcr.setTargetEditPart(getParent()); - return getParent().getCommand(cutcr); - } else if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_END - .equals(type) - && String.valueOf(ElementOwnedCommentEditPart.VISUAL_ID) - .equals(id)) { - if (cutcr.getSourceEditPart() instanceof InteractionInteractionCompartment2EditPart) - cutcr.setSourceEditPart(getParent()); - return getParent().getCommand(cutcr); - } - } - - // can create comments by clicking into the compartment - if (_request instanceof CreateUnspecifiedTypeRequest) { - CreateUnspecifiedTypeRequest cutr = (CreateUnspecifiedTypeRequest) _request; - String type = (String) cutr.getType(); - IHintedType iet = (IHintedType) cutr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - if (org.eclipse.gef.RequestConstants.REQ_CREATE.equals(type) - && (String.valueOf(CommentEditPart.VISUAL_ID).equals(id))) { - return org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil - .getDiagramEditPart(this).getCommand(_request); - } - } - // don't let to move a comment into a compartment - if (_request instanceof EditCommandRequestWrapper) { - EditCommandRequestWrapper ecrw = (EditCommandRequestWrapper) _request; - if (ecrw.getEditCommandRequest() instanceof MoveRequest) { - MoveRequest mr = (MoveRequest) ecrw.getEditCommandRequest(); - for (Object o : mr.getElementsToMove().keySet()) { - if (o instanceof Comment) { - return UnexecutableCommand.INSTANCE; - } - } - } - }// end - - if (_request instanceof CreateViewAndElementRequest) { - CreateViewAndElementRequest request = (CreateViewAndElementRequest) _request; - IElementType type = (IElementType) request - .getViewAndElementDescriptor() - .getCreateElementRequestAdapter().getAdapter( - IElementType.class); - if (type.equals(UMLElementTypes.Lifeline_2002)) { - CompoundCommand compoundCommand = new CompoundCommand( - "Create Lifeline and BES"); - compoundCommand.add(super.getCommand(request)); - compoundCommand.add(new ICommandProxy( - new CreateLifelineAndBESCommand(getEditingDomain(), - request.getViewAndElementDescriptor(), - getViewer()))); - return compoundCommand; - } - if (type.equals(UMLElementTypes.CombinedFragment_2004)) { - CompoundCommand compoundCommand = new CompoundCommand( - "Create Combined Fragment and send it to the back"); - compoundCommand.add(super.getCommand(request)); - compoundCommand.add(new ICommandProxy( - new ChangeZOrderOfCreatedEP(getEditingDomain(), request - .getViewAndElementDescriptor(), getViewer(), - ZOrderRequest.REQ_SEND_TO_BACK))); - return compoundCommand; - } - return super.getCommand(request); - } - - return super.getCommand(_request); - } - - /** - * @generated - */ - @Override - public Object getAdapter(Class adapter) { - if (adapter != null && adapter.equals(ViewAndFeatureResolver.class)) { - return this.resolver; - } - return super.getAdapter(adapter); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java deleted file mode 100644 index 4ed83125544..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionInteractionCompartmentEditPart.java +++ /dev/null @@ -1,311 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.diagram.ui.requests.ZOrderRequest; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.ChangeZOrderOfCreatedEP; -import org.eclipse.papyrus.diagram.common.editpolicies.DragDropEditPolicy; -import org.eclipse.papyrus.diagram.common.editpolicies.ViewAndFeatureResolver; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CreateLifelineAndBESCommand; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionCompartmentXYLayoutEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionInteractionCompartmentCanonicalEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.InteractionInteractionCompartmentItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDiagramDragAndDropEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionInteractionCompartmentEditPart extends - ShapeCompartmentEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 5001; - - /** - * @generated NOT - */ - private final ViewAndFeatureResolver resolver = new ViewAndFeatureResolver() { - - /** - * generated NOT - */ - public boolean isEObjectNode(EObject element) { - if (element instanceof Interaction) { - // Check if is children - if (resolveSemanticElement().eContents().contains(element)) { - // check if there is no existing view of the children - if (DiagramEditPartsUtil.getEObjectViews(element).size() == 0) - return true; - } - } - return false; - } - - public boolean isEObjectLink(EObject element) { - return false; - } - - public int getEObjectSemanticHint(EObject element) { - if (element instanceof Interaction) { - return UMLVisualIDRegistry.getNodeVisualID(getNotationView(), - element); - } - return -1; - } - - public EStructuralFeature getEStructuralFeatureForEClass(EClass class1) { - return null; - } - }; - - /** - * @generated - */ - public InteractionInteractionCompartmentEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - public String getCompartmentName() { - return Messages.InteractionInteractionCompartmentEditPart_title; - } - - /** - * @generated - */ - @Override - public IFigure createFigure() { - ResizableCompartmentFigure result = (ResizableCompartmentFigure) super - .createFigure(); - result.setTitleVisibility(false); - return result; - } - - /** - * Modified to install custom Drag&Drop policy. - * - * @author Gabriel Merin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new InteractionInteractionCompartmentItemSemanticEditPolicy()); - installEditPolicy(EditPolicyRoles.CREATION_ROLE, - new CreationEditPolicy()); - DragDropEditPolicy dragAndDropEditPolicy = null; - dragAndDropEditPolicy = new DragDropEditPolicy(resolver); - // modified to install custom Drag&Drop policy. - installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, - new SequenceDiagramDragAndDropEditPolicy(resolver)); - - installEditPolicy(EditPolicy.LAYOUT_ROLE, - new InteractionCompartmentXYLayoutEditPolicy()); - - installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, - new InteractionInteractionCompartmentCanonicalEditPolicy()); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - - if (notification.getNotifier() instanceof ShapeStyle) { - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) notification.getFeature(), - notification.getNewValue()); - ep.refresh(); - } - } - - } - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getInteraction_Fragment()); - features.add(UMLPackage.eINSTANCE.getInteraction_Lifeline()); - features.add(UMLPackage.eINSTANCE.getInteraction_Fragment()); - DiagramEditPartsUtil.handleNotificationForView(this, notification, - features); - } - - /** - * @generated - */ - @Override - protected void setRatio(Double ratio) { - if (getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) { - super.setRatio(ratio); - } - } - - /** - * When creating of a Lifeline a BES will be created too - * - * @generated-NOT - */ - @Override - public Command getCommand(Request _request) { - - // lets to create a CommentLink for an Activity by clicking in the - // Subvertices Compartment - if (_request instanceof CreateUnspecifiedTypeConnectionRequest) { - CreateUnspecifiedTypeConnectionRequest cutcr = (CreateUnspecifiedTypeConnectionRequest) _request; - String type = (String) cutcr.getType(); - IHintedType iet = (IHintedType) cutcr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_START - .equals(type) - && String.valueOf(ElementOwnedCommentEditPart.VISUAL_ID) - .equals(id)) { - if (cutcr.getTargetEditPart() instanceof InteractionInteractionCompartmentEditPart) - cutcr.setTargetEditPart(getParent()); - return getParent().getCommand(cutcr); - } else if (org.eclipse.gef.RequestConstants.REQ_CONNECTION_END - .equals(type) - && String.valueOf(ElementOwnedCommentEditPart.VISUAL_ID) - .equals(id)) { - if (cutcr.getSourceEditPart() instanceof InteractionInteractionCompartmentEditPart) - cutcr.setSourceEditPart(getParent()); - return getParent().getCommand(cutcr); - } - } - - // can create comments by clicking into the compartment - if (_request instanceof CreateUnspecifiedTypeRequest) { - CreateUnspecifiedTypeRequest cutr = (CreateUnspecifiedTypeRequest) _request; - String type = (String) cutr.getType(); - IHintedType iet = (IHintedType) cutr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - if (org.eclipse.gef.RequestConstants.REQ_CREATE.equals(type) - && (String.valueOf(CommentEditPart.VISUAL_ID).equals(id))) { - return org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil - .getDiagramEditPart(this).getCommand(_request); - } - } - // don't let to move a comment into a compartment - if (_request instanceof EditCommandRequestWrapper) { - EditCommandRequestWrapper ecrw = (EditCommandRequestWrapper) _request; - if (ecrw.getEditCommandRequest() instanceof MoveRequest) { - MoveRequest mr = (MoveRequest) ecrw.getEditCommandRequest(); - for (Object o : mr.getElementsToMove().keySet()) { - if (o instanceof Comment) { - return UnexecutableCommand.INSTANCE; - } - } - } - }// end - - if (_request instanceof CreateViewAndElementRequest) { - CreateViewAndElementRequest request = (CreateViewAndElementRequest) _request; - IElementType type = (IElementType) request - .getViewAndElementDescriptor() - .getCreateElementRequestAdapter().getAdapter( - IElementType.class); - if (type.equals(UMLElementTypes.Lifeline_2002)) { - CompoundCommand compoundCommand = new CompoundCommand( - "Create Lifeline and BES"); - compoundCommand.add(super.getCommand(request)); - compoundCommand.add(new ICommandProxy( - new CreateLifelineAndBESCommand(getEditingDomain(), - request.getViewAndElementDescriptor(), - getViewer()))); - return compoundCommand; - } - if (type.equals(UMLElementTypes.CombinedFragment_2004)) { - CompoundCommand compoundCommand = new CompoundCommand( - "Create Combined Fragment and send it to the back"); - compoundCommand.add(super.getCommand(request)); - compoundCommand.add(new ICommandProxy( - new ChangeZOrderOfCreatedEP(getEditingDomain(), request - .getViewAndElementDescriptor(), getViewer(), - ZOrderRequest.REQ_SEND_TO_BACK))); - return compoundCommand; - } - return super.getCommand(request); - } - - return super.getCommand(_request); - } - - /** - * @generated - */ - @Override - public Object getAdapter(Class adapter) { - if (adapter != null && adapter.equals(ViewAndFeatureResolver.class)) { - return this.resolver; - } - return super.getAdapter(adapter); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionName2EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionName2EditPart.java deleted file mode 100644 index 7aa062598a0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionName2EditPart.java +++ /dev/null @@ -1,631 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007-2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * Javier Muñoz (Prodevelop) – Label italized when classifier is abstract - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.handles.NonResizableHandleKit; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class InteractionName2EditPart extends CompartmentEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4003; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - public InteractionName2EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, - new NonResizableEditPolicy() { - - protected List createSelectionHandles() { - List handles = new ArrayList(); - NonResizableHandleKit.addMoveHandle( - (GraphicalEditPart) getHost(), handles); - return handles; - } - - public Command getCommand(Request request) { - return null; - } - - public boolean understandsRequest(Request request) { - return false; - } - }); - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return getParser() != null; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Interaction_2001, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated not - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - - fontData.setStyle(isAbstract() ? SWT.ITALIC | fontData.getStyle() - : (~SWT.ITALIC) & fontData.getStyle()); - setFont(fontData); - } else if (this.getFigure() != null - && this.getFigure().getFont() != null - && this.getFigure().getFont().getFontData().length > 0) { - FontData fontData = this.getFigure().getFont().getFontData()[0]; - fontData.setStyle(isAbstract() ? SWT.ITALIC | fontData.getStyle() - : (~SWT.ITALIC) & fontData.getStyle()); - setFont(fontData); - } - } - - private boolean isAbstract() { - if (this.resolveSemanticElement() instanceof Classifier) { - return ((Classifier) this.resolveSemanticElement()).isAbstract(); - } - return false; - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void addNotationalListeners() { - super.addNotationalListeners(); - addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void removeNotationalListeners() { - super.removeNotationalListeners(); - removeListenerFilter("PrimaryView"); //$NON-NLS-1$ - } - - /** - * @generated not - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else if (feature == UMLPackage.eINSTANCE.getClassifier_IsAbstract()) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionNameEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionNameEditPart.java deleted file mode 100644 index 561abfd4184..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/InteractionNameEditPart.java +++ /dev/null @@ -1,630 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007-2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * Javier Muñoz (Prodevelop) – Label italized when classifier is abstract - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.handles.NonResizableHandleKit; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; -import org.eclipse.uml2.uml.Classifier; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class InteractionNameEditPart extends CompartmentEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4004; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - public InteractionNameEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, - new NonResizableEditPolicy() { - - protected List createSelectionHandles() { - List handles = new ArrayList(); - NonResizableHandleKit.addMoveHandle( - (GraphicalEditPart) getHost(), handles); - return handles; - } - - public Command getCommand(Request request) { - return null; - } - - public boolean understandsRequest(Request request) { - return false; - } - }); - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return getParser() != null; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Interaction_1001, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated not - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - fontData.setStyle(isAbstract() ? SWT.ITALIC | fontData.getStyle() - : (~SWT.ITALIC) & fontData.getStyle()); - setFont(fontData); - } else if (this.getFigure() != null - && this.getFigure().getFont() != null - && this.getFigure().getFont().getFontData().length > 0) { - FontData fontData = this.getFigure().getFont().getFontData()[0]; - fontData.setStyle(isAbstract() ? SWT.ITALIC | fontData.getStyle() - : (~SWT.ITALIC) & fontData.getStyle()); - setFont(fontData); - } - } - - private boolean isAbstract() { - if (this.resolveSemanticElement() instanceof Classifier) { - return ((Classifier) this.resolveSemanticElement()).isAbstract(); - } - return false; - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void addNotationalListeners() { - super.addNotationalListeners(); - addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void removeNotationalListeners() { - super.removeNotationalListeners(); - removeListenerFilter("PrimaryView"); //$NON-NLS-1$ - } - - /** - * @generated not - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else if (feature == UMLPackage.eINSTANCE.getClassifier_IsAbstract()) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineEditPart.java deleted file mode 100644 index 309b0ef6354..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineEditPart.java +++ /dev/null @@ -1,878 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.BorderLayout; -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.MarginBorder; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.StackLayout; -import org.eclipse.draw2d.XYLayout; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.draw2d.geometry.PrecisionPoint; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.EcorePackage; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.editparts.AbstractGraphicalEditPart; -import org.eclipse.gef.editpolicies.LayoutEditPolicy; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.PopupBarEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest; -import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout; -import org.eclipse.gmf.runtime.draw2d.ui.figures.IPolygonAnchorableFigure; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure; -import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.ShapeStyle; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.DestructionEvent; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.MessageOccurrenceSpecification; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.AnnotateNodeStyleCommand; -import org.eclipse.papyrus.diagram.common.commands.PreserveAnchorsPositionCommand; -import org.eclipse.papyrus.diagram.common.commands.ReconnectToIntersectionPoints; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.draw2d.LifelineDotLineFigure; -import org.eclipse.papyrus.diagram.common.editparts.PrimaryShapeEditPart; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageOrderCommand; -import org.eclipse.papyrus.diagram.sequence.edit.policies.LifelineCanonicalEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.LifelineItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.LifelineXYLayoutEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class LifelineEditPart extends ShapeNodeEditPart implements - PrimaryShapeEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 2002; - - /** - * @generated - */ - protected IFigure contentPane; - - /** - * @generated - */ - protected IFigure primaryShape; - - /** - * @generated - */ - public LifelineEditPart(View view) { - super(view); - } - - /** - * This is to modify the feedback if anchors are going to be preserved - * - * @author gmerin - * @NOT-generated - */ - @Override - public void showSourceFeedback(Request request) { - super.showSourceFeedback(PreserveAnchorsPositionCommand - .getNewSourceFeedbackRequest(request, this)); - } - - /** - * This operation returns the BES EditParts contained in the Lifeline - * EditPart - * - * @author gmerin - * @NOT-generated - * @return the list of BES EditParts - */ - public List<BehaviorExecutionSpecificationEditPart> getBESList() { - List<BehaviorExecutionSpecificationEditPart> besList = new ArrayList<BehaviorExecutionSpecificationEditPart>(); - for (Object obj : getChildren()) { - if (obj instanceof BehaviorExecutionSpecificationEditPart) { - besList.add((BehaviorExecutionSpecificationEditPart) obj); - } - - } - return besList; - } - - /** - * @generated NOT - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - - // Check if exists any MessageOccurrenceSpecification covered by this - // Lifeline and with a DestructionEvent - Lifeline lifeline = (Lifeline) this.resolveSemanticElement(); - if (lifeline == null) { - return; - } - EList<InteractionFragment> list = lifeline.getCoveredBys(); - boolean drawCrossAtEnd = false; - for (InteractionFragment fragment : list) { - if (fragment instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification msg = (MessageOccurrenceSpecification) fragment; - if ((msg.getEvent() != null) - && (msg.getEvent() instanceof DestructionEvent)) - drawCrossAtEnd = true; - } - } - this.getPrimaryShape().getFigureDotLineFigure().setCrossAtEnd( - drawCrossAtEnd); - } - - /** - * @author Gabriel Merin - * @generated NOT - */ - @Override - protected void handleNotificationEvent(Notification notification) { - if (notification.getNotifier() == getModel() - && EcorePackage.eINSTANCE.getEModelElement_EAnnotations() - .equals(notification.getFeature())) { - handleMajorSemanticChange(); - } else if (notification.getNotifier() instanceof ShapeStyle) { - super.handleNotificationEvent(notification); - - // Propagate style - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (!(obj instanceof GraphicalEditPart)) - continue; - GraphicalEditPart ep = (GraphicalEditPart) obj; - - if (ep.resolveSemanticElement() != resolveSemanticElement()) - continue; - - ShapeStyle style = (ShapeStyle) ((View) ep.getModel()) - .getStyle(NotationPackage.eINSTANCE.getShapeStyle()); - if (style != null) { - style.eSet((EStructuralFeature) notification.getFeature(), - notification.getNewValue()); - ep.refresh(); - } - } - - } - - else { - super.handleNotificationEvent(notification); - } - - // Added code - if (notification.getNewValue() instanceof MessageOccurrenceSpecification) { - MessageOccurrenceSpecification msgNew = (MessageOccurrenceSpecification) notification - .getNewValue(); - if (msgNew.getEvent() instanceof DestructionEvent) { - // If the MessageOccurrenceSpecification is covered by this - // Lifeline, set the cross at the end of the Lifeline - if (msgNew.getCovereds() - .contains(this.resolveSemanticElement())) { - refreshVisuals(); - } - } - } - - if (notification.getOldValue() instanceof MessageOccurrenceSpecification) { - refreshVisuals(); - } - // end added code - - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - features.add(UMLPackage.eINSTANCE.getElement_OwnedComment()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - - /** - * @author Gabriel Merin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - installEditPolicy(EditPolicyRoles.CREATION_ROLE, - new CreationEditPolicy()); - - // super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, - new GraphicalNodeEditPolicy()); - - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new LifelineItemSemanticEditPolicy()); - // installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies. - // EditPolicyRoles.DRAG_DROP_ROLE, - // new - //org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, - new LifelineCanonicalEditPolicy()); - // installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy()); - // Changed policy - installEditPolicy(EditPolicy.LAYOUT_ROLE, - new LifelineXYLayoutEditPolicy()); - - // Added by gmerin to have a BES shortcut on Lifelines - installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, - new PopupBarEditPolicy()); - } - - /** - * @generated - */ - protected LayoutEditPolicy createLayoutEditPolicy() { - LayoutEditPolicy lep = new LayoutEditPolicy() { - - protected EditPolicy createChildEditPolicy(EditPart child) { - EditPolicy result = child - .getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (result == null) { - result = new NonResizableEditPolicy(); - } - return result; - } - - protected Command getMoveChildrenCommand(Request request) { - return null; - } - - protected Command getCreateCommand(CreateRequest request) { - return null; - } - }; - return lep; - } - - /** - * @generated - */ - protected IFigure createNodeShape() { - LifelineFigure figure = new LifelineFigure(); - return primaryShape = figure; - } - - /** - * @generated - */ - public LifelineFigure getPrimaryShape() { - return (LifelineFigure) primaryShape; - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof LifelineNameEditPart) { - ((LifelineNameEditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureLifelineLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean removeFixedChild(EditPart childEditPart) { - - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * @generated - */ - @Override - protected void removeChildVisual(EditPart childEditPart) { - if (removeFixedChild(childEditPart)) { - return; - } - super.removeChildVisual(childEditPart); - } - - /** - * @generated NOT - */ - @Override - protected IFigure getContentPaneFor(IGraphicalEditPart editPart) { - - if (editPart instanceof BehaviorExecutionSpecificationEditPart) { - return getPrimaryShape().getFigureDotLineFigure(); - } - - return super.getContentPaneFor(editPart); - } - - /** - * @generated NOT - */ - protected NodeFigure createNodePlate() { - LifelineNodeFigure result = new LifelineNodeFigure(getMapMode().DPtoLP( - 100), getMapMode().DPtoLP(250)); - return result; - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model so - * you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - @Override - protected NodeFigure createNodeFigure() { - NodeFigure figure = createNodePlate(); - figure.setLayoutManager(new StackLayout()); - IFigure shape = createNodeShape(); - figure.add(shape); - contentPane = setupContentPane(shape); - return figure; - } - - /** - * Default implementation treats passed figure as content pane. Respects - * layout one may have set for generated figure. - * - * @param nodeShape - * instance of generated figure class - * @generated NOT - */ - protected IFigure setupContentPane(IFigure nodeShape) { - if (nodeShape.getLayoutManager() == null) { - ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(); - layout.setSpacing(getMapMode().DPtoLP(5)); - nodeShape.setLayoutManager(layout); - } - - if (nodeShape instanceof LifelineFigure) { - LifelineFigure lFigure = (LifelineFigure) nodeShape; - return lFigure.getFigureDotLineFigure(); - } - - return nodeShape; // use nodeShape itself as contentPane - } - - /** - * @generated - */ - @Override - public IFigure getContentPane() { - if (contentPane != null) { - return contentPane; - } - return super.getContentPane(); - } - - /** - * @generated - */ - @Override - public EditPart getPrimaryChildEditPart() { - return getChildBySemanticHint(UMLVisualIDRegistry - .getType(LifelineNameEditPart.VISUAL_ID)); - } - - /** - * @NOT-generated - */ - @Override - public Command getCommand(Request _request) { - // can create comments by clicking into the compartment - if (_request instanceof CreateUnspecifiedTypeRequest) { - CreateUnspecifiedTypeRequest cutr = (CreateUnspecifiedTypeRequest) _request; - String type = (String) cutr.getType(); - IHintedType iet = (IHintedType) cutr.getElementTypes().get(0); - String id = iet.getSemanticHint(); - - // To allow creation of Comments over a Lifeline - if (RequestConstants.REQ_CREATE.equals(type) - && (String.valueOf(CommentEditPart.VISUAL_ID).equals(id))) { - return org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil - .getDiagramEditPart(this).getCommand(_request); - } - - // To allow creation of CombinedFragments over a Lifeline - if (RequestConstants.REQ_CREATE.equals(type) - && (String.valueOf(CombinedFragmentEditPart.VISUAL_ID) - .equals(id))) { - return this.getParent().getCommand(_request); - } - }// end - - if (_request instanceof CreateConnectionViewAndElementRequest) { - - CreateConnectionViewAndElementRequest createViewAndElemReq = (CreateConnectionViewAndElementRequest) _request; - - // Only order Message connections - if (!MessageCommonUtil.isMessageEditPart(createViewAndElemReq - .getConnectionViewDescriptor().getSemanticHint())) - return super.getCommand(_request); - - CompoundCommand ccommand = new CompoundCommand(); - - // Needed to add the start command to the request - ccommand.add(super.getCommand(_request)); - - // Check if there is another element at the same point - if (!MessageCommonUtil.checkFreeConnectionEnds(_request)) { - return null; - } - - // Add a command to swap between created anchors (points where the - // user clicked and dropped the connection) with the real - // intersection points - ccommand - .add(new ReconnectToIntersectionPoints(createViewAndElemReq)); - - // Creation of the ordering command - MessageOrderCommand msgOrderCmd = new MessageOrderCommand( - createViewAndElemReq); - ccommand.add(msgOrderCmd); - - return ccommand; - } - - if (_request instanceof ReconnectRequest) { - - ReconnectRequest reconnReq = (ReconnectRequest) _request; - - // Only order Message connections - if (!MessageCommonUtil.isMessageEditPart(reconnReq - .getConnectionEditPart())) - return super.getCommand(_request); - - CompoundCommand ccommand = new CompoundCommand(); - - // Check if there is another element at the same point and - if (!MessageCommonUtil.checkFreeConnectionEnds(_request)) { - return null; - } - - // Modify the request with the real target anchoring point instead - // of target mouse reference point - ReconnectToIntersectionPoints.modifyLocation(reconnReq); - - // Create the commands with the real target anchoring point - ccommand.add(super.getCommand(_request)); - - // Creation of the ordering command - MessageOrderCommand msgOrderCmd = new MessageOrderCommand(reconnReq); - ccommand.add(msgOrderCmd); - - return ccommand; - } - - return super.getCommand(_request); - } - - /** - * @NOT-generated - */ - public class LifelineNodeFigure extends DefaultSizeNodeFigure implements - IPolygonAnchorableFigure { - - public LifelineNodeFigure(Dimension defSize) { - super(defSize.width, defSize.height); - } - - public LifelineNodeFigure(int width, int height) { - super(width, height); - } - - @Override - public PointList getPolygonPoints() { - PointList polygonList = new PointList(); - - Rectangle r = getBounds(); - - Point pStart = new Point(); - Point pEnd = new Point(); - - pStart.x = r.x + r.width / 2; - pStart.y = r.y + 1; - - pEnd.x = pStart.x; - pEnd.y = pStart.y + r.height - 1; - - polygonList.addPoint(pStart); - polygonList.addPoint(pEnd); - - return polygonList; - } - - @Override - protected boolean isDefaultAnchorArea(PrecisionPoint p) { - // We don't want a default anchor area for the Lifeline Node Figure. - return false; - } - - } - - /** - * @generated - */ - public class LifelineFigure extends RectangleFigure { - - /** - * @generated - */ - private WrappingLabel fFigureLifelineLabelFigure; - /** - * @generated - */ - private RectangleFigure fFigureExecutionsContainerFigure; - - /** - * @generated - */ - public LifelineFigure() { - - BorderLayout layoutThis = new BorderLayout(); - this.setLayoutManager(layoutThis); - - this.setFill(false); - this.setOutline(false); - this.setPreferredSize(new Dimension(getMapMode().DPtoLP(100), - getMapMode().DPtoLP(200))); - createContents(); - } - - /** - * @generated NOT - */ - private void createContents() { - - RectangleFigure lifelineNameContainerFigure0 = new RectangleFigure(); - lifelineNameContainerFigure0 - .setForegroundColor(ColorConstants.black); - lifelineNameContainerFigure0 - .setBackgroundColor(LIFELINENAMECONTAINERFIGURE0_BACK); - - this.add(lifelineNameContainerFigure0, BorderLayout.TOP); - - lifelineNameContainerFigure0.setLayoutManager(new StackLayout()); - - fFigureLifelineLabelFigure = new WrapLabel(); - fFigureLifelineLabelFigure.setText("Lifeline"); - - fFigureLifelineLabelFigure.setBorder(new MarginBorder(getMapMode() - .DPtoLP(7), getMapMode().DPtoLP(7), getMapMode().DPtoLP(7), - getMapMode().DPtoLP(7))); - - fFigureLifelineLabelFigure.setFont(FFIGURELIFELINELABELFIGURE_FONT); - - lifelineNameContainerFigure0.add(fFigureLifelineLabelFigure); - - fFigureExecutionsContainerFigure = new RectangleFigure(); - fFigureExecutionsContainerFigure.setOutline(false); - fFigureExecutionsContainerFigure.setFill(false); - - this.add(fFigureExecutionsContainerFigure, BorderLayout.CENTER); - - fFigureExecutionsContainerFigure - .setLayoutManager(new StackLayout()); - - LifelineDotLineFigure lifelineLineFigure1 = new LifelineDotLineFigure(); - // test - lifelineLineFigure1.setLayoutManager(new XYLayout()); - - fFigureExecutionsContainerFigure.add(lifelineLineFigure1); - - // added - // lifelineLineFigure1.setLayoutManager(new XYLayout()); - setFigureDotLineFigure(lifelineLineFigure1); - - fFigureExecutionsContainerFigure.add(lifelineLineFigure1); - - } - - /** - * @generated NOT - */ - private LifelineDotLineFigure fLifelinDotLineFigure; - - /** - * @generated NOT - */ - public void setFigureDotLineFigure(LifelineDotLineFigure dlFigure) { - fLifelinDotLineFigure = dlFigure; - } - - /** - * @generated NOT - */ - public LifelineDotLineFigure getFigureDotLineFigure() { - return fLifelinDotLineFigure; - } - - /** - * @generated - */ - private boolean myUseLocalCoordinates = false; - - /** - * @generated - */ - @Override - protected boolean useLocalCoordinates() { - return myUseLocalCoordinates; - } - - /** - * @generated - */ - protected void setUseLocalCoordinates(boolean useLocalCoordinates) { - myUseLocalCoordinates = useLocalCoordinates; - } - - /** - * @generated - */ - public WrappingLabel getFigureLifelineLabelFigure() { - return fFigureLifelineLabelFigure; - } - - /** - * @generated - */ - public RectangleFigure getFigureExecutionsContainerFigure() { - return fFigureExecutionsContainerFigure; - } - - } - - /** - * @generated - */ - static final Color LIFELINENAMECONTAINERFIGURE0_BACK = new Color(null, 253, - 253, 221); - - /** - * @generated - */ - static final Font FFIGURELIFELINELABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 10, SWT.BOLD); - - /** - * @generated - */ - protected EAnnotation getAppearenceEAnnotation() { - EAnnotation eAnn = getPrimaryView().getEAnnotation( - AnnotateNodeStyleCommand.APPEARANCE_EANNOTATION_NAME); - return eAnn; - } - - /** - * @generated - */ - private List<EObject> changesFromDefaultStyle() { - EAnnotation eAnn = getAppearenceEAnnotation(); - if (eAnn == null) - return new ArrayList<EObject>(); - else - return eAnn.getReferences(); - } - - /** - * @generated - */ - public static boolean isLabel(IFigure figure) { - if (figure instanceof Label) { - return true; - } - if (figure instanceof WrappingLabel) { - return true; - } - return false; - } - - /** - * @generated - */ - protected boolean isFigureFromChildEditPart(IFigure figure) { - for (Iterator i = getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof AbstractGraphicalEditPart) { - AbstractGraphicalEditPart gEP = (AbstractGraphicalEditPart) obj; - if (gEP.getFigure() == figure) { - // Check if semantic elements are different - if (gEP instanceof GraphicalEditPart - && ((GraphicalEditPart) gEP) - .resolveSemanticElement() == resolveSemanticElement()) { - return false; - } - return true; - } else { - // Check if it is a child figure of the editpart - for (java.lang.Object child : gEP.getChildren()) { - if (child instanceof GraphicalEditPart) { - GraphicalEditPart childEP = (GraphicalEditPart) child; - if (childEP.getFigure() == figure) { - if (childEP.resolveSemanticElement() != resolveSemanticElement()) - return true; - else - return false; - } - } - } - } // end else - } - } - return false; - } - - /** - * @generated - */ - @Override - protected void setBackgroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.FILL_STYLE__FILL_COLOR)) { - setOwnedFiguresBackgroundColor(getFigure(), color); - } else - super.setBackgroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresBackgroundColor(IFigure parent, Color color) { - parent.setBackgroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresBackgroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - @Override - protected void setForegroundColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresForegroundColor(getFigure(), color); - } else - super.setForegroundColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresForegroundColor(IFigure parent, Color color) { - if (!isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof IFigure && !isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresForegroundColor((IFigure) obj, color); - } - } - } - - /** - * @generated - */ - - @Override - protected void setFontColor(Color color) { - // Only update if the Node doesn't have the default style - if (changesFromDefaultStyle().contains( - NotationPackage.Literals.LINE_STYLE__LINE_COLOR)) { - setOwnedFiguresFontColor(getFigure(), color); - } else - super.setFontColor(color); - - } - - /** - * @generated - */ - public void setOwnedFiguresFontColor(IFigure parent, Color color) { - if (isLabel(parent)) - parent.setForegroundColor(color); - for (Iterator i = parent.getChildren().iterator(); i.hasNext();) { - Object obj = i.next(); - if (obj instanceof IFigure && isLabel((IFigure) obj) - && !isFigureFromChildEditPart((IFigure) obj)) { - setOwnedFiguresFontColor((IFigure) obj, color); - } - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineNameEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineNameEditPart.java deleted file mode 100644 index 27d87b6eac6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/LifelineNameEditPart.java +++ /dev/null @@ -1,638 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.editpolicies.NonResizableEditPolicy; -import org.eclipse.gef.handles.NonResizableHandleKit; -import org.eclipse.gef.requests.ChangeBoundsRequest; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class LifelineNameEditPart extends CompartmentEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4001; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - public LifelineNameEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, - new NonResizableEditPolicy() { - - protected List createSelectionHandles() { - List handles = new ArrayList(); - NonResizableHandleKit.addMoveHandle( - (GraphicalEditPart) getHost(), handles); - return handles; - } - - public Command getCommand(Request request) { - return null; - } - - public boolean understandsRequest(Request request) { - return false; - } - }); - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return getParser() != null; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Lifeline_2002, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void addNotationalListeners() { - super.addNotationalListeners(); - addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$ - } - - /** - * @generated - */ - @Override - protected void removeNotationalListeners() { - super.removeNotationalListeners(); - removeListenerFilter("PrimaryView"); //$NON-NLS-1$ - } - - /** - * @author Javier Muñoz - * @generated NOT - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - refreshParentLifelineBounds(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - - // Lined added - refreshParentLifelineBounds(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @author Javier Muñoz - * @NOT-generated - */ - private void refreshParentLifelineBounds() { - Dimension labelPreferedDimension = this.getFigure().getPreferredSize(); - Dimension labelDimension = this.getFigure().getSize(); - - int widthDelta = labelPreferedDimension.width - labelDimension.width; - - ChangeBoundsRequest request = new ChangeBoundsRequest( - org.eclipse.gef.RequestConstants.REQ_RESIZE); - request.setResizeDirection(PositionConstants.EAST); - request.setSizeDelta(new Dimension(widthDelta, 0)); - request.setMoveDelta(new Point(0, 0)); - request.setEditParts(this.getParent()); - - Command command = ((IGraphicalEditPart) this.getParent()) - .getCommand(request); - super.executeCommand(command); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message2EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message2EditPart.java deleted file mode 100644 index 5039538cf4b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message2EditPart.java +++ /dev/null @@ -1,228 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.PolylineDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Message2ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class Message2EditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3002; - - /** - * @generated - */ - public Message2EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Message2ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - Message2EditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageName2EditPart) { - ((MessageName2EditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageAsyncLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new CallAsync(); - } - - /** - * @generated - */ - public CallAsync getPrimaryShape() { - return (CallAsync) getFigure(); - } - - /** - * @generated - */ - public class CallAsync extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageAsyncLabelFigure; - - /** - * @generated - */ - public CallAsync() { - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageAsyncLabelFigure = new WrappingLabel(); - fFigureMessageAsyncLabelFigure.setText(""); - - fFigureMessageAsyncLabelFigure - .setFont(FFIGUREMESSAGEASYNCLABELFIGURE_FONT); - - this.add(fFigureMessageAsyncLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolylineDecoration df = new PolylineDecoration(); - df.setForegroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageAsyncLabelFigure() { - return fFigureMessageAsyncLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGEASYNCLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message3EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message3EditPart.java deleted file mode 100644 index 8ba3e65df5e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message3EditPart.java +++ /dev/null @@ -1,245 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.PolylineDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Message3ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class Message3EditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3003; - - /** - * @generated - */ - public Message3EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Message3ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - Message3EditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageName3EditPart) { - ((MessageName3EditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageReplyLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new Reply(); - } - - /** - * @generated - */ - public Reply getPrimaryShape() { - return (Reply) getFigure(); - } - - /** - * @generated - */ - public class Reply extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageReplyLabelFigure; - - /** - * @generated - */ - public Reply() { - this.setLineStyle(Graphics.LINE_DASH); - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @NOT-generated - */ - @Override - protected void outlineShape(Graphics g) { - int[] dashes = new int[1]; - dashes[0] = 6; - - g.setLineStyle(Graphics.LINE_DASH); - g.setLineDash(dashes); - g.setForegroundColor(ColorConstants.black); - - super.outlineShape(g); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageReplyLabelFigure = new WrappingLabel(); - fFigureMessageReplyLabelFigure.setText(""); - - fFigureMessageReplyLabelFigure - .setFont(FFIGUREMESSAGEREPLYLABELFIGURE_FONT); - - this.add(fFigureMessageReplyLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolylineDecoration df = new PolylineDecoration(); - df.setForegroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageReplyLabelFigure() { - return fFigureMessageReplyLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGEREPLYLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message4EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message4EditPart.java deleted file mode 100644 index 4828c408951..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message4EditPart.java +++ /dev/null @@ -1,228 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.PolylineDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Message4ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class Message4EditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3004; - - /** - * @generated - */ - public Message4EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Message4ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - Message4EditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageName4EditPart) { - ((MessageName4EditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageSignalLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new Signal(); - } - - /** - * @generated - */ - public Signal getPrimaryShape() { - return (Signal) getFigure(); - } - - /** - * @generated - */ - public class Signal extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageSignalLabelFigure; - - /** - * @generated - */ - public Signal() { - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageSignalLabelFigure = new WrappingLabel(); - fFigureMessageSignalLabelFigure.setText(""); - - fFigureMessageSignalLabelFigure - .setFont(FFIGUREMESSAGESIGNALLABELFIGURE_FONT); - - this.add(fFigureMessageSignalLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolylineDecoration df = new PolylineDecoration(); - df.setForegroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageSignalLabelFigure() { - return fFigureMessageSignalLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGESIGNALLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message5EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message5EditPart.java deleted file mode 100644 index 100e4208b43..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message5EditPart.java +++ /dev/null @@ -1,228 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.PolylineDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Message5ItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class Message5EditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3005; - - /** - * @generated - */ - public Message5EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Message5ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - Message5EditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageName5EditPart) { - ((MessageName5EditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageCreationLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new Creation(); - } - - /** - * @generated - */ - public Creation getPrimaryShape() { - return (Creation) getFigure(); - } - - /** - * @generated - */ - public class Creation extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageCreationLabelFigure; - - /** - * @generated - */ - public Creation() { - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageCreationLabelFigure = new WrappingLabel(); - fFigureMessageCreationLabelFigure.setText(""); - - fFigureMessageCreationLabelFigure - .setFont(FFIGUREMESSAGECREATIONLABELFIGURE_FONT); - - this.add(fFigureMessageCreationLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolylineDecoration df = new PolylineDecoration(); - df.setForegroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageCreationLabelFigure() { - return fFigureMessageCreationLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGECREATIONLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message6EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message6EditPart.java deleted file mode 100644 index ecca4058eca..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/Message6EditPart.java +++ /dev/null @@ -1,226 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.PolylineDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.Message6ItemSemanticEditPolicy; - -/** - * @generated - */ -public class Message6EditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3006; - - /** - * @generated - */ - public Message6EditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new Message6ItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new DeleteOnlyViewComponentEditPolicy()); - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - Message6EditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageName6EditPart) { - ((MessageName6EditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageDestructionLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new Destruction(); - } - - /** - * @generated - */ - public Destruction getPrimaryShape() { - return (Destruction) getFigure(); - } - - /** - * @generated - */ - public class Destruction extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageDestructionLabelFigure; - - /** - * @generated - */ - public Destruction() { - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageDestructionLabelFigure = new WrappingLabel(); - fFigureMessageDestructionLabelFigure.setText(""); - - fFigureMessageDestructionLabelFigure - .setFont(FFIGUREMESSAGEDESTRUCTIONLABELFIGURE_FONT); - - this.add(fFigureMessageDestructionLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolylineDecoration df = new PolylineDecoration(); - df.setForegroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageDestructionLabelFigure() { - return fFigureMessageDestructionLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGEDESTRUCTIONLABELFIGURE_FONT = new Font( - Display.getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageEditPart.java deleted file mode 100644 index a6fc8658755..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageEditPart.java +++ /dev/null @@ -1,238 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Connection; -import org.eclipse.draw2d.PolygonDecoration; -import org.eclipse.draw2d.RotatableDecoration; -import org.eclipse.draw2d.geometry.PointList; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITreeBranchEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.ConnectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.widgets.Display; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.commands.RemoveEObjectReferencesFromDiagram; -import org.eclipse.papyrus.diagram.common.editpolicies.DeleteOnlyViewComponentEditPolicy; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.policies.MessageItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDeleteOnlyViewComponentEditPolicy; - -/** - * @generated - */ -public class MessageEditPart extends ConnectionNodeEditPart implements - ITreeBranchEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 3001; - - /** - * @generated - */ - public MessageEditPart(View view) { - super(view); - } - - /** - * @author gmerin - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new MessageItemSemanticEditPolicy()); - // ** install new ComponentEditPolicy - installEditPolicy(EditPolicy.COMPONENT_ROLE, - new SequenceDeleteOnlyViewComponentEditPolicy()); // changed by - // gmerin - // ** install new ConnectionEditPolicy - installEditPolicy(EditPolicy.CONNECTION_ROLE, - new ConnectionEditPolicy() { - @Override - protected boolean shouldDeleteSemantic() { - return false; - } - - @Override - protected Command createDeleteViewCommand( - GroupRequest deleteRequest) { - Command command = super - .createDeleteViewCommand(deleteRequest); - command = command - .chain(new ICommandProxy( - new RemoveEObjectReferencesFromDiagram( - getEditingDomain(), - MessageEditPart.this - .getDiagramView(), - Collections - .singletonList(resolveSemanticElement())))); - return command; - } - }); - } - - /** - * @generated - */ - protected boolean addFixedChild(EditPart childEditPart) { - if (childEditPart instanceof MessageNameEditPart) { - ((MessageNameEditPart) childEditPart).setLabel(getPrimaryShape() - .getFigureMessageSyncLabelFigure()); - return true; - } - return false; - } - - /** - * @generated - */ - @Override - protected void addChildVisual(EditPart childEditPart, int index) { - if (addFixedChild(childEditPart)) { - return; - } - super.addChildVisual(childEditPart, -1); - } - - /** - * Creates figure for this edit part. - * - * Body of this method does not depend on settings in generation model - * so you may safely remove <i>generated</i> tag and modify it. - * - * @generated - */ - - @Override - protected Connection createConnectionFigure() { - return new CallSync(); - } - - /** - * @generated - */ - public CallSync getPrimaryShape() { - return (CallSync) getFigure(); - } - - @Override - public Command getCommand(Request _request) { - // TODO Auto-generated method stub - return super.getCommand(_request); - } - - /** - * @generated - */ - public class CallSync extends PolylineConnectionEx { - - /** - * @generated - */ - private WrappingLabel fFigureMessageSyncLabelFigure; - - /** - * @generated - */ - public CallSync() { - this.setForegroundColor(ColorConstants.black); - - createContents(); - setTargetDecoration(createTargetDecoration()); - } - - /** - * @generated - */ - private void createContents() { - - fFigureMessageSyncLabelFigure = new WrappingLabel(); - fFigureMessageSyncLabelFigure.setText(""); - - fFigureMessageSyncLabelFigure - .setFont(FFIGUREMESSAGESYNCLABELFIGURE_FONT); - - this.add(fFigureMessageSyncLabelFigure); - - } - - /** - * @generated - */ - private RotatableDecoration createTargetDecoration() { - PolygonDecoration df = new PolygonDecoration(); - df.setFill(true); - df.setForegroundColor(ColorConstants.black); - df.setBackgroundColor(ColorConstants.black); - PointList pl = new PointList(); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2)); - pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2)); - df.setTemplate(pl); - df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3)); - return df; - } - - /** - * @generated - */ - public WrappingLabel getFigureMessageSyncLabelFigure() { - return fFigureMessageSyncLabelFigure; - } - - } - - /** - * @generated - */ - static final Font FFIGUREMESSAGESYNCLABELFIGURE_FONT = new Font(Display - .getCurrent(), "SANS", 9, SWT.NORMAL); - - /** - * @author jmunoz - * @generated NOT - */ - protected void handleNotificationEvent(Notification notification) { - super.handleNotificationEvent(notification); - List<EStructuralFeature> features = new ArrayList<EStructuralFeature>(); - - features.add(UMLPackage.eINSTANCE.getElement_Owner()); - features.add(UMLPackage.eINSTANCE.getElement_OwnedElement()); - features.add(UMLPackage.eINSTANCE.getMessage_MessageSort()); - DiagramEditPartsUtil.handleNotificationForDiagram(this, notification, - features); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName2EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName2EditPart.java deleted file mode 100644 index ef315b01432..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName2EditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageName2EditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4006; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageName2EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3002, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName3EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName3EditPart.java deleted file mode 100644 index 6e5805dadf7..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName3EditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageName3EditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4007; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageName3EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3003, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName4EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName4EditPart.java deleted file mode 100644 index 89560ea9a1e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName4EditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageName4EditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4008; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageName4EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3004, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName5EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName5EditPart.java deleted file mode 100644 index 33c04ad5e38..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName5EditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageName5EditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4009; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageName5EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3005, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName6EditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName6EditPart.java deleted file mode 100644 index 5cff41cd592..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageName6EditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageName6EditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4010; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageName6EditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3006, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageNameEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageNameEditPart.java deleted file mode 100644 index 126dfe0c129..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/MessageNameEditPart.java +++ /dev/null @@ -1,588 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.draw2d.ConnectionLocator; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.PositionConstants; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.RunnableWithResult; -import org.eclipse.gef.AccessibleEditPart; -import org.eclipse.gef.EditPolicy; -import org.eclipse.gef.Request; -import org.eclipse.gef.requests.DirectEditRequest; -import org.eclipse.gef.tools.DirectEditManager; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser; -import org.eclipse.gmf.runtime.notation.FontStyle; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.viewers.ICellEditorValidator; -import org.eclipse.swt.SWT; -import org.eclipse.swt.accessibility.AccessibleEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.edit.policies.UMLTextSelectionEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class MessageNameEditPart extends LabelEditPart implements - ITextAwareEditPart { - - /** - * @generated - */ - public static final int VISUAL_ID = 4005; - - /** - * @generated - */ - private DirectEditManager manager; - - /** - * @generated - */ - private IParser parser; - - /** - * @generated - */ - private List parserElements; - - /** - * @generated - */ - private String defaultText; - - /** - * @generated - */ - static { - registerSnapBackPosition( - UMLVisualIDRegistry - .getType(org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart.VISUAL_ID), - new Point(1, -13)); - } - - /** - * @generated - */ - public MessageNameEditPart(View view) { - super(view); - } - - /** - * @generated - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, - new LabelDirectEditPolicy()); - } - - /** - * @generated - */ - @Override - public int getKeyPoint() { - return ConnectionLocator.MIDDLE; - } - - /** - * @generated - */ - protected String getLabelTextHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getText(); - } else { - return ((Label) figure).getText(); - } - } - - /** - * @generated - */ - protected void setLabelTextHelper(IFigure figure, String text) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setText(text); - } else { - ((Label) figure).setText(text); - } - } - - /** - * @generated - */ - protected Image getLabelIconHelper(IFigure figure) { - if (figure instanceof WrappingLabel) { - return ((WrappingLabel) figure).getIcon(); - } else { - return ((Label) figure).getIcon(); - } - } - - /** - * @generated - */ - protected void setLabelIconHelper(IFigure figure, Image icon) { - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setIcon(icon); - } else { - ((Label) figure).setIcon(icon); - } - } - - /** - * @generated - */ - public void setLabel(WrappingLabel figure) { - unregisterVisuals(); - setFigure(figure); - defaultText = getLabelTextHelper(figure); - if (figure instanceof WrappingLabel) { - ((WrappingLabel) figure).setAlignment(PositionConstants.CENTER); - } - registerVisuals(); - refreshVisuals(); - } - - /** - * @generated - */ - @Override - protected List getModelChildren() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public IGraphicalEditPart getChildBySemanticHint(String semanticHint) { - return null; - } - - /** - * @generated - */ - protected EObject getParserElement() { - return resolveSemanticElement(); - } - - /** - * @generated - */ - protected Image getLabelIcon() { - return null; - } - - /** - * @generated - */ - protected String getLabelText() { - String text = null; - EObject parserElement = getParserElement(); - if (parserElement != null && getParser() != null) { - text = getParser().getPrintString( - new EObjectAdapter(parserElement), - getParserOptions().intValue()); - } - if (text == null || text.length() == 0) { - text = defaultText; - } - return text; - } - - /** - * @generated - */ - public void setLabelText(String text) { - setLabelTextHelper(getFigure(), text); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - public String getEditText() { - if (getParserElement() == null || getParser() == null) { - return ""; //$NON-NLS-1$ - } - return getParser().getEditString( - new EObjectAdapter(getParserElement()), - getParserOptions().intValue()); - } - - /** - * @generated - */ - protected boolean isEditable() { - return false; - } - - /** - * @generated - */ - public ICellEditorValidator getEditTextValidator() { - return new ICellEditorValidator() { - - public String isValid(final Object value) { - if (value instanceof String) { - final EObject element = getParserElement(); - final IParser parser = getParser(); - try { - IParserEditStatus valid = (IParserEditStatus) getEditingDomain() - .runExclusive(new RunnableWithResult.Impl() { - - public void run() { - setResult(parser.isValidEditString( - new EObjectAdapter(element), - (String) value)); - } - }); - return valid.getCode() == ParserEditStatus.EDITABLE ? null - : valid.getMessage(); - } catch (InterruptedException ie) { - ie.printStackTrace(); - } - } - - // shouldn't get here - return null; - } - }; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor() { - if (getParserElement() == null || getParser() == null) { - return null; - } - return getParser().getCompletionProcessor( - new EObjectAdapter(getParserElement())); - } - - /** - * @generated - */ - public ParserOptions getParserOptions() { - return ParserOptions.NONE; - } - - /** - * @generated - */ - public IParser getParser() { - if (parser == null) { - String parserHint = ((View) getModel()).getType(); - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3001, getParserElement(), - parserHint); - parser = ParserService.getInstance().getParser(hintAdapter); - - } - return parser; - } - - /** - * @generated - */ - protected DirectEditManager getManager() { - if (manager == null) { - setManager(new TextDirectEditManager(this, TextDirectEditManager - .getTextCellEditorClass(this), UMLEditPartFactory - .getTextCellEditorLocator(this))); - } - return manager; - } - - /** - * @generated - */ - protected void setManager(DirectEditManager manager) { - this.manager = manager; - } - - /** - * @generated - */ - protected void performDirectEdit() { - getManager().show(); - } - - /** - * @generated - */ - protected void performDirectEdit(Point eventLocation) { - if (getManager().getClass() == TextDirectEditManager.class) { - ((TextDirectEditManager) getManager()).show(eventLocation - .getSWTPoint()); - } - } - - /** - * @generated - */ - private void performDirectEdit(char initialCharacter) { - if (getManager() instanceof TextDirectEditManager) { - ((TextDirectEditManager) getManager()).show(initialCharacter); - } else { - performDirectEdit(); - } - } - - /** - * @generated - */ - @Override - protected void performDirectEditRequest(Request request) { - final Request theRequest = request; - try { - getEditingDomain().runExclusive(new Runnable() { - - public void run() { - if (isActive() && isEditable()) { - if (theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) { - Character initialChar = (Character) theRequest - .getExtendedData() - .get( - RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR); - performDirectEdit(initialChar.charValue()); - } else if ((theRequest instanceof DirectEditRequest) - && (getEditText().equals(getLabelText()))) { - DirectEditRequest editRequest = (DirectEditRequest) theRequest; - performDirectEdit(editRequest.getLocation()); - } else { - performDirectEdit(); - } - } - } - }); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - /** - * @generated - */ - @Override - protected void refreshVisuals() { - super.refreshVisuals(); - refreshLabel(); - refreshFont(); - refreshFontColor(); - refreshUnderline(); - refreshStrikeThrough(); - } - - /** - * @generated - */ - protected void refreshLabel() { - setLabelTextHelper(getFigure(), getLabelText()); - setLabelIconHelper(getFigure(), getLabelIcon()); - Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE); - if (pdEditPolicy instanceof UMLTextSelectionEditPolicy) { - ((UMLTextSelectionEditPolicy) pdEditPolicy).refreshFeedback(); - } - } - - /** - * @generated - */ - protected void refreshUnderline() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextUnderline(style.isUnderline()); - } - } - - /** - * @generated - */ - protected void refreshStrikeThrough() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null && getFigure() instanceof WrappingLabel) { - ((WrappingLabel) getFigure()).setTextStrikeThrough(style - .isStrikeThrough()); - } - } - - /** - * @generated - */ - @Override - protected void refreshFont() { - FontStyle style = (FontStyle) getFontStyleOwnerView().getStyle( - NotationPackage.eINSTANCE.getFontStyle()); - if (style != null) { - FontData fontData = new FontData(style.getFontName(), style - .getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) - | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL)); - setFont(fontData); - } - } - - /** - * @generated - */ - @Override - protected void setFontColor(Color color) { - getFigure().setForegroundColor(color); - } - - /** - * @generated - */ - @Override - protected void addSemanticListeners() { - if (getParser() instanceof ISemanticParser) { - EObject element = resolveSemanticElement(); - parserElements = ((ISemanticParser) getParser()) - .getSemanticElementsBeingParsed(element); - for (int i = 0; i < parserElements.size(); i++) { - addListenerFilter( - "SemanticModel" + i, this, (EObject) parserElements.get(i)); //$NON-NLS-1$ - } - } else { - super.addSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected void removeSemanticListeners() { - if (parserElements != null) { - for (int i = 0; i < parserElements.size(); i++) { - removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$ - } - } else { - super.removeSemanticListeners(); - } - } - - /** - * @generated - */ - @Override - protected AccessibleEditPart getAccessibleEditPart() { - if (accessibleEP == null) { - accessibleEP = new AccessibleGraphicalEditPart() { - - public void getName(AccessibleEvent e) { - e.result = getLabelTextHelper(getFigure()); - } - }; - } - return accessibleEP; - } - - /** - * @generated - */ - private View getFontStyleOwnerView() { - return (View) getModel(); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - Object feature = event.getFeature(); - if (NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) { - Integer c = (Integer) event.getNewValue(); - setFontColor(DiagramColorRegistry.getInstance().getColor(c)); - } else if (NotationPackage.eINSTANCE.getFontStyle_Underline().equals( - feature)) { - refreshUnderline(); - } else if (NotationPackage.eINSTANCE.getFontStyle_StrikeThrough() - .equals(feature)) { - refreshStrikeThrough(); - } else if (NotationPackage.eINSTANCE.getFontStyle_FontHeight().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_FontName().equals( - feature) - || NotationPackage.eINSTANCE.getFontStyle_Bold() - .equals(feature) - || NotationPackage.eINSTANCE.getFontStyle_Italic().equals( - feature)) { - refreshFont(); - } else { - if (getParser() != null - && getParser().isAffectingEvent(event, - getParserOptions().intValue())) { - refreshLabel(); - } - if (getParser() instanceof ISemanticParser) { - ISemanticParser modelParser = (ISemanticParser) getParser(); - if (modelParser.areSemanticElementsAffected(null, event)) { - removeSemanticListeners(); - if (resolveSemanticElement() != null) { - addSemanticListeners(); - } - refreshLabel(); - } - } - } - super.handleNotificationEvent(event); - } - - /** - * @generated - */ - @Override - protected IFigure createFigure() { - // Parent should assign one using setLabel() method - return null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/PackageEditPart.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/PackageEditPart.java deleted file mode 100644 index 68ad01b86a6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/PackageEditPart.java +++ /dev/null @@ -1,157 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.editpolicies.DiagramDragDropEditPolicy; -import org.eclipse.papyrus.diagram.common.editpolicies.ViewAndFeatureResolver; -import org.eclipse.papyrus.diagram.common.providers.ViewInfo; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.ids.UMLDiagramEditorIDs; -import org.eclipse.papyrus.diagram.sequence.edit.policies.PackageCanonicalEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.PackageItemSemanticEditPolicy; -import org.eclipse.papyrus.diagram.sequence.edit.policies.SequenceDiagramDragAndDropEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class PackageEditPart extends DiagramEditPart { - - /** - * @generated NOT - */ - // public final static String MODEL_ID = "UMLSequence"; //$NON-NLS-1$ - // all model IDs are grouped in org.eclipse.papyrus.diagram.common.ids - public final static String MODEL_ID = UMLDiagramEditorIDs.SequenceModelID; - - /** - * @generated - */ - public static final int VISUAL_ID = 79; - - /** - * Modified to perform correct Drag&Drop of an <Interaction>. - * - * @generated NOT - */ - private final ViewAndFeatureResolver resolver = new ViewAndFeatureResolver() { - /** - * generated NOT - */ - public boolean isEObjectNode(EObject element) { - if (element instanceof Interaction) { - // an Interaction's View can now be correctly initialized. - // Check if is children - if (resolveSemanticElement().eContents().contains(element)) { - // check if there is no existing view of the children - if (DiagramEditPartsUtil.getEObjectViews(element).size() == 0) - return true; - } - } - if (element instanceof Comment) { - return true; - } - return false; - } - - public boolean isEObjectLink(EObject element) { - return false; - } - - public int getEObjectSemanticHint(EObject element) { - // we will only allow Interaction Drag and Drop - if (element instanceof Interaction) { - return UMLVisualIDRegistry.getNodeVisualID(getNotationView(), - element); - } - return -1; - } - - public EStructuralFeature getEStructuralFeatureForEClass(EClass class1) { - if (UMLPackage.eINSTANCE.getComment().equals(class1)) { - return UMLPackage.eINSTANCE.getElement_OwnedComment(); - } - return null; - } - }; - - /** - * @generated - */ - public PackageEditPart(View view) { - super(view); - } - - /** - * Modified to install custom Drag&Drop policy. - * - * @generated NOT - */ - @Override - protected void createDefaultEditPolicies() { - super.createDefaultEditPolicies(); - installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, - new PackageItemSemanticEditPolicy()); - installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, - new PackageCanonicalEditPolicy()); - // fjcano: modified to install custom Drag&Drop policy. - installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, - new SequenceDiagramDragAndDropEditPolicy(resolver)); - - // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies. - // EditPolicyRoles.POPUPBAR_ROLE); - } - - /** - * @generated - */ - @Override - protected void handleNotificationEvent(Notification event) { - - super.handleNotificationEvent(event); - if (event.getNotifier() instanceof EAnnotation) { - EAnnotation eAnnotation = (EAnnotation) event.getNotifier(); - if (eAnnotation.getSource() != null - && eAnnotation.getSource().equals( - MDTUtil.FilterViewAndLabelsSource)) { - DiagramEditPartsUtil.updateDiagram(this); - } - } - } - - /** - * @generated - */ - @Override - public Object getAdapter(Class adapter) { - if (adapter != null && adapter.equals(ViewAndFeatureResolver.class)) { - return this.resolver; - } - - if (adapter != null && adapter.equals(ViewInfo.class)) { - return UMLVisualIDRegistry.getDiagramViewInfo(); - } - return super.getAdapter(adapter); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/UMLEditPartFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/UMLEditPartFactory.java deleted file mode 100644 index 33b39f091fd..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/parts/UMLEditPartFactory.java +++ /dev/null @@ -1,274 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.parts; - -import org.eclipse.draw2d.FigureUtilities; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartFactory; -import org.eclipse.gef.tools.CellEditorLocator; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Text; - -import org.eclipse.papyrus.diagram.common.editpolicies.ShowViewEditPolicy; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLEditPartFactory implements EditPartFactory { - - /** - * @generated - */ - public EditPart createEditPart(EditPart context, Object model) { - if (model instanceof View) { - View view = (View) model; - EditPart ep = null; - switch (UMLVisualIDRegistry.getVisualID(view)) { - - case PackageEditPart.VISUAL_ID: - ep = new PackageEditPart(view); - break; - - case InteractionEditPart.VISUAL_ID: - ep = new InteractionEditPart(view); - break; - - case InteractionNameEditPart.VISUAL_ID: - ep = new InteractionNameEditPart(view); - break; - - case CommentEditPart.VISUAL_ID: - ep = new CommentEditPart(view); - break; - - case CommentBodyEditPart.VISUAL_ID: - ep = new CommentBodyEditPart(view); - break; - - case Interaction2EditPart.VISUAL_ID: - ep = new Interaction2EditPart(view); - break; - - case InteractionName2EditPart.VISUAL_ID: - ep = new InteractionName2EditPart(view); - break; - - case LifelineEditPart.VISUAL_ID: - ep = new LifelineEditPart(view); - break; - - case LifelineNameEditPart.VISUAL_ID: - ep = new LifelineNameEditPart(view); - break; - - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - ep = new BehaviorExecutionSpecificationEditPart(view); - break; - - case CombinedFragmentEditPart.VISUAL_ID: - ep = new CombinedFragmentEditPart(view); - break; - - case CombinedFragmentInteractionOperatorEditPart.VISUAL_ID: - ep = new CombinedFragmentInteractionOperatorEditPart(view); - break; - - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - ep = new InteractionInteractionCompartmentEditPart(view); - break; - - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - ep = new InteractionInteractionCompartment2EditPart(view); - break; - - case MessageEditPart.VISUAL_ID: - ep = new MessageEditPart(view); - break; - - case MessageNameEditPart.VISUAL_ID: - ep = new MessageNameEditPart(view); - break; - - case Message2EditPart.VISUAL_ID: - ep = new Message2EditPart(view); - break; - - case MessageName2EditPart.VISUAL_ID: - ep = new MessageName2EditPart(view); - break; - - case Message3EditPart.VISUAL_ID: - ep = new Message3EditPart(view); - break; - - case MessageName3EditPart.VISUAL_ID: - ep = new MessageName3EditPart(view); - break; - - case Message4EditPart.VISUAL_ID: - ep = new Message4EditPart(view); - break; - - case MessageName4EditPart.VISUAL_ID: - ep = new MessageName4EditPart(view); - break; - - case Message5EditPart.VISUAL_ID: - ep = new Message5EditPart(view); - break; - - case MessageName5EditPart.VISUAL_ID: - ep = new MessageName5EditPart(view); - break; - - case Message6EditPart.VISUAL_ID: - ep = new Message6EditPart(view); - break; - - case MessageName6EditPart.VISUAL_ID: - ep = new MessageName6EditPart(view); - break; - - case ElementOwnedCommentEditPart.VISUAL_ID: - ep = new ElementOwnedCommentEditPart(view); - break; - - case CommentAnnotatedElementEditPart.VISUAL_ID: - ep = new CommentAnnotatedElementEditPart(view); - break; - } - if (ep != null) { - ep.installEditPolicy(EditPolicyRoles.OPEN_ROLE, - ShowViewEditPolicy.createOpenEditPolicy()); - return ep; - } - } - return createUnrecognizedEditPart(context, model); - } - - /** - * @generated - */ - private EditPart createUnrecognizedEditPart(EditPart context, Object model) { - // Handle creation of unrecognized child node EditParts here - return null; - } - - /** - * @generated - */ - public static CellEditorLocator getTextCellEditorLocator( - ITextAwareEditPart source) { - if (source.getFigure() instanceof WrappingLabel) - return new TextCellEditorLocator((WrappingLabel) source.getFigure()); - else { - return new LabelCellEditorLocator((Label) source.getFigure()); - } - } - - /** - * @generated - */ - static private class TextCellEditorLocator implements CellEditorLocator { - - /** - * @generated - */ - private WrappingLabel wrapLabel; - - /** - * @generated - */ - public TextCellEditorLocator(WrappingLabel wrapLabel) { - this.wrapLabel = wrapLabel; - } - - /** - * @generated - */ - public WrappingLabel getWrapLabel() { - return wrapLabel; - } - - /** - * @generated - */ - public void relocate(CellEditor celleditor) { - Text text = (Text) celleditor.getControl(); - Rectangle rect = getWrapLabel().getTextBounds().getCopy(); - getWrapLabel().translateToAbsolute(rect); - if (getWrapLabel().isTextWrapOn() - && getWrapLabel().getText().length() > 0) { - rect.setSize(new Dimension(text.computeSize(rect.width, - SWT.DEFAULT))); - } else { - int avr = FigureUtilities.getFontMetrics(text.getFont()) - .getAverageCharWidth(); - rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, - SWT.DEFAULT)).expand(avr * 2, 0)); - } - if (!rect.equals(new Rectangle(text.getBounds()))) { - text.setBounds(rect.x, rect.y, rect.width, rect.height); - } - } - - } - - /** - * @generated - */ - private static class LabelCellEditorLocator implements CellEditorLocator { - - /** - * @generated - */ - private Label label; - - /** - * @generated - */ - public LabelCellEditorLocator(Label label) { - this.label = label; - } - - /** - * @generated - */ - public Label getLabel() { - return label; - } - - /** - * @generated - */ - public void relocate(CellEditor celleditor) { - Text text = (Text) celleditor.getControl(); - Rectangle rect = getLabel().getTextBounds().getCopy(); - getLabel().translateToAbsolute(rect); - int avr = FigureUtilities.getFontMetrics(text.getFont()) - .getAverageCharWidth(); - rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, - SWT.DEFAULT)).expand(avr * 2, 0)); - if (!rect.equals(new Rectangle(text.getBounds()))) { - text.setBounds(rect.x, rect.y, rect.width, rect.height); - } - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java deleted file mode 100644 index fca2eb4f691..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/BehaviorExecutionSpecificationItemSemanticEditPolicy.java +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.List; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class BehaviorExecutionSpecificationItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - CompoundCommand cc = getDestroyEdgesCommand(); - addDestroyShortcutsCommand(cc); - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return null; - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return null; - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java deleted file mode 100644 index 7cfa9a6c0df..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CombinedFragmentItemSemanticEditPolicy.java +++ /dev/null @@ -1,223 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.List; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class CombinedFragmentItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - CompoundCommand cc = getDestroyEdgesCommand(); - addDestroyShortcutsCommand(cc); - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return null; - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return null; - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java deleted file mode 100644 index 2bbca8fa41b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentAnnotatedElementItemSemanticEditPolicy.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Iterator; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand; -import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; - -/** - * @generated - */ -public class CommentAnnotatedElementItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - public Command getCommand(Request request) { - if (request instanceof GroupRequest - && RequestConstants.REQ_DELETE.equals(request.getType())) { - CommentAnnotatedElementEditPart ep = (CommentAnnotatedElementEditPart) getHost(); - DestroyReferenceRequest drr = new DestroyReferenceRequest( - ((View) ep.getSource().getModel()).getElement(), - UMLPackage.eINSTANCE.getComment_AnnotatedElement(), - ((View) ep.getTarget().getModel()).getElement(), false); - return getDestroyReferenceCommand(drr); - } - return super.getCommand(request); - } - - /** - * @generated NOT - */ - @Override - protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) { - CompoundCommand cc = new CompoundCommand(); - Comment c = (Comment) req.getContainer(); - - cc.add(getGEFWrapper(new DestroyReferenceCommand(req))); - - if (c.getAnnotatedElements().size() < 2 - || c.getAnnotatedElements().size() > 2) { - Model m = (Model) c.eResource().getContents().get(0); - SetRequest sr = new SetRequest(m, UMLPackage.eINSTANCE - .getElement_OwnedComment(), c); - cc.add(new ICommandProxy(new SetValueCommand(sr))); - } else { - Element e = findNewParent((Element) req.getReferencedObject(), c - .getAnnotatedElements()); - SetRequest sr = new SetRequest(e, UMLPackage.eINSTANCE - .getElement_OwnedComment(), c); - cc.add(new ICommandProxy(new SetValueCommand(sr))); - } - - return cc; - } - - /** - * @not generated - */ - private Element findNewParent(Element oldValue, EList<Element> elements) { - for (Iterator<Element> it = elements.iterator(); it.hasNext();) { - Element e = it.next(); - if (e != oldValue) - return e; - } - - return null; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java deleted file mode 100644 index 26ea9a43543..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/CommentItemSemanticEditPolicy.java +++ /dev/null @@ -1,220 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.List; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class CommentItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - CompoundCommand cc = getDestroyEdgesCommand(); - addDestroyShortcutsCommand(cc); - View view = (View) getHost().getModel(); - if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ - req.setElementToDestroy(view); - } - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/ElementOwnedCommentItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/ElementOwnedCommentItemSemanticEditPolicy.java deleted file mode 100644 index 1d4de3b2ecd..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/ElementOwnedCommentItemSemanticEditPolicy.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.GroupRequest; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand; -import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; - -/** - * @generated - */ -public class ElementOwnedCommentItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - public Command getCommand(Request request) { - if (request instanceof GroupRequest - && RequestConstants.REQ_DELETE.equals(request.getType())) { - ElementOwnedCommentEditPart ep = (ElementOwnedCommentEditPart) getHost(); - DestroyReferenceRequest drr = new DestroyReferenceRequest( - ((View) ep.getSource().getModel()).getElement(), - UMLPackage.eINSTANCE.getElement_OwnedComment(), ((View) ep - .getTarget().getModel()).getElement(), false); - return getDestroyReferenceCommand(drr); - } - return super.getCommand(request); - } - - /** - * @generated NOT - */ - @Override - protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) { - EObject eObject = org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil - .getDiagramEditPart( - ((ElementOwnedCommentEditPart) this.getHost()) - .getTarget()).resolveSemanticElement(); - - SetRequest sr = new SetRequest(eObject, UMLPackage.eINSTANCE - .getElement_OwnedComment(), req.getReferencedObject()); - return new ICommandProxy(new SetValueCommand(sr)); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Interaction2ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Interaction2ItemSemanticEditPolicy.java deleted file mode 100644 index 58ad0242edf..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Interaction2ItemSemanticEditPolicy.java +++ /dev/null @@ -1,348 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.Lifeline; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class Interaction2ItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - // This line is also GMF generated code - CompoundCommand cc = getDestroyEdgesCommand(); - - // First destroy all the Lifelines/Interactions within the Interaction - if (req.getElementToDestroy() instanceof Interaction) { - Interaction interaction = (Interaction) req.getElementToDestroy(); - - // Lifelines - for (Iterator it = interaction.getLifelines().iterator(); it - .hasNext();) { - Lifeline lifeline = (Lifeline) it.next(); - - // Search for its EditPart - EditPart lifelineEditPart = null; - for (Iterator epIt = getHost().getViewer() - .getEditPartRegistry().keySet().iterator(); epIt - .hasNext();) { - Object epObj = epIt.next(); - if (epObj instanceof Node) { - Node node = (Node) epObj; - if (node.getElement() == lifeline) { - lifelineEditPart = (EditPart) getHost().getViewer() - .getEditPartRegistry().get(node); - break; - } - } - } - if (lifelineEditPart != null) { - EditCommandRequestWrapper editCommandRequest = new EditCommandRequestWrapper( - new DestroyElementRequest( - ((Interaction2EditPart) getHost()) - .getEditingDomain(), req - .isConfirmationRequired()), - Collections.EMPTY_MAP); - cc.add(lifelineEditPart.getCommand(editCommandRequest)); - } - } - - // Interactions - for (Iterator it = interaction.getFragments().iterator(); it - .hasNext();) { - InteractionFragment fragment = (InteractionFragment) it.next(); - if (fragment instanceof Interaction) { - EditPart interaction2EditPart = null; - for (Iterator epIt = getHost().getViewer() - .getEditPartRegistry().keySet().iterator(); epIt - .hasNext();) { - Object epObj = epIt.next(); - if (epObj instanceof Node) { - Node node = (Node) epObj; - if (node.getElement() == fragment) { - interaction2EditPart = (EditPart) getHost() - .getViewer().getEditPartRegistry().get( - node); - break; - } - } - } - if (interaction2EditPart != null) { - if (interaction2EditPart instanceof InteractionInteractionCompartment2EditPart) { - interaction2EditPart = interaction2EditPart - .getParent(); - } - EditCommandRequestWrapper editCommandRequest = new EditCommandRequestWrapper( - new DestroyElementRequest( - ((Interaction2EditPart) getHost()) - .getEditingDomain(), req - .isConfirmationRequired()), - Collections.EMPTY_MAP); - cc.add(interaction2EditPart - .getCommand(editCommandRequest)); - } - } - } - } - - // What comes next is GMF generated code - addDestroyChildNodesCommand(cc); - addDestroyShortcutsCommand(cc); - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - protected void addDestroyChildNodesCommand(CompoundCommand cmd) { - View view = (View) getHost().getModel(); - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - return; - } - for (Iterator it = view.getChildren().iterator(); it.hasNext();) { - Node node = (Node) it.next(); - switch (UMLVisualIDRegistry.getVisualID(node)) { - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - for (Iterator cit = node.getChildren().iterator(); cit - .hasNext();) { - Node cnode = (Node) cit.next(); - switch (UMLVisualIDRegistry.getVisualID(cnode)) { - case Interaction2EditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - case LifelineEditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - case CombinedFragmentEditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - } - } - break; - } - } - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return null; - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return null; - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2CanonicalEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2CanonicalEditPolicy.java deleted file mode 100644 index 91822cdef98..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2CanonicalEditPolicy.java +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewType; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramUpdater; -import org.eclipse.papyrus.diagram.sequence.part.UMLNodeDescriptor; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionInteractionCompartment2CanonicalEditPolicy extends - CanonicalEditPolicy { - - /** - * @generated - */ - Set myFeaturesToSynchronize; - - /** - * @generated - */ - @Override - protected List getSemanticChildrenList() { - View viewObject = (View) getHost().getModel(); - List result = new LinkedList(); - for (Iterator it = UMLDiagramUpdater - .getInteractionInteractionCompartment_5002SemanticChildren( - viewObject).iterator(); it.hasNext();) { - EObject nextValue = ((UMLNodeDescriptor) it.next()) - .getModelElement(); - if (MultiDiagramUtil.findEObjectReferencedInEAnnotation(getHost(), - nextValue)) { - result.add(nextValue); - } - } - return result; - } - - /** - * @generated - */ - @Override - protected boolean isOrphaned(Collection semanticChildren, final View view) { - if (view.getType() == ViewType.NOTE || view.getType() == ViewType.TEXT) { - return false; - } - if (view.getElement() != null) { - int actualID = UMLVisualIDRegistry.getVisualID(view); - int suggestedID = UMLVisualIDRegistry.getNodeVisualID( - (View) getHost().getModel(), view.getElement()); - switch (actualID) { - case Interaction2EditPart.VISUAL_ID: - case LifelineEditPart.VISUAL_ID: - case CombinedFragmentEditPart.VISUAL_ID: - return actualID != suggestedID; - } - return false; - } - return true; - } - - /** - * @generated - */ - @Override - protected String getDefaultFactoryHint() { - return null; - } - - /** - * @generated - */ - @Override - protected Set getFeaturesToSynchronize() { - if (myFeaturesToSynchronize == null) { - myFeaturesToSynchronize = new HashSet(); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getInteraction_Lifeline()); - } - return myFeaturesToSynchronize; - } - - /** - * @generated - */ - @Override - protected void refreshSemantic() { - super.refreshSemantic(); - // this will take care of the filtering of views - Diagram diagram = MDTUtil.getHostDiagram(this); - if (diagram != null) { - MDTUtil.filterDiagramViews(diagram); - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2ItemSemanticEditPolicy.java deleted file mode 100644 index 044d58e4f70..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartment2ItemSemanticEditPolicy.java +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CombinedFragmentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Interaction2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.LifelineCreateCommand; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionInteractionCompartment2ItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated - */ - @Override - protected Command getCreateCommand(CreateElementRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Interaction_2001 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - return getGEFWrapper(new Interaction2CreateCommand(req)); - } - if (UMLElementTypes.Lifeline_2002 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Lifeline()); - } - return getGEFWrapper(new LifelineCreateCommand(req)); - } - if (UMLElementTypes.CombinedFragment_2004 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - return getGEFWrapper(new CombinedFragmentCreateCommand(req)); - } - return super.getCreateCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return getHost().getParent().getCommand( - new EditCommandRequestWrapper(req)); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java deleted file mode 100644 index 4b3ee0327bb..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentCanonicalEditPolicy.java +++ /dev/null @@ -1,126 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewType; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramUpdater; -import org.eclipse.papyrus.diagram.sequence.part.UMLNodeDescriptor; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionInteractionCompartmentCanonicalEditPolicy extends - CanonicalEditPolicy { - - /** - * @generated - */ - Set myFeaturesToSynchronize; - - /** - * @generated - */ - @Override - protected List getSemanticChildrenList() { - View viewObject = (View) getHost().getModel(); - List result = new LinkedList(); - for (Iterator it = UMLDiagramUpdater - .getInteractionInteractionCompartment_5001SemanticChildren( - viewObject).iterator(); it.hasNext();) { - EObject nextValue = ((UMLNodeDescriptor) it.next()) - .getModelElement(); - if (MultiDiagramUtil.findEObjectReferencedInEAnnotation(getHost(), - nextValue)) { - result.add(nextValue); - } - } - return result; - } - - /** - * @generated - */ - @Override - protected boolean isOrphaned(Collection semanticChildren, final View view) { - if (view.getType() == ViewType.NOTE || view.getType() == ViewType.TEXT) { - return false; - } - if (view.getElement() != null) { - int actualID = UMLVisualIDRegistry.getVisualID(view); - int suggestedID = UMLVisualIDRegistry.getNodeVisualID( - (View) getHost().getModel(), view.getElement()); - switch (actualID) { - case Interaction2EditPart.VISUAL_ID: - case LifelineEditPart.VISUAL_ID: - case CombinedFragmentEditPart.VISUAL_ID: - return actualID != suggestedID; - } - return false; - } - return true; - } - - /** - * @generated - */ - @Override - protected String getDefaultFactoryHint() { - return null; - } - - /** - * @generated - */ - @Override - protected Set getFeaturesToSynchronize() { - if (myFeaturesToSynchronize == null) { - myFeaturesToSynchronize = new HashSet(); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getInteraction_Lifeline()); - } - return myFeaturesToSynchronize; - } - - /** - * @generated - */ - @Override - protected void refreshSemantic() { - super.refreshSemantic(); - // this will take care of the filtering of views - Diagram diagram = MDTUtil.getHostDiagram(this); - if (diagram != null) { - MDTUtil.filterDiagramViews(diagram); - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java deleted file mode 100644 index ccb3375a339..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionInteractionCompartmentItemSemanticEditPolicy.java +++ /dev/null @@ -1,78 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CombinedFragmentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Interaction2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.LifelineCreateCommand; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionInteractionCompartmentItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated - */ - @Override - protected Command getCreateCommand(CreateElementRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Interaction_2001 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - return getGEFWrapper(new Interaction2CreateCommand(req)); - } - if (UMLElementTypes.Lifeline_2002 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Lifeline()); - } - return getGEFWrapper(new LifelineCreateCommand(req)); - } - if (UMLElementTypes.CombinedFragment_2004 == req.getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - return getGEFWrapper(new CombinedFragmentCreateCommand(req)); - } - return super.getCreateCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return getHost().getParent().getCommand( - new EditCommandRequestWrapper(req)); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java deleted file mode 100644 index 62ac3cda7f6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/InteractionItemSemanticEditPolicy.java +++ /dev/null @@ -1,355 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.Lifeline; - -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class InteractionItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - // This line is also GMF generated code - CompoundCommand cc = getDestroyEdgesCommand(); - - // First destroy all the Lifelines/Interactions within the Interaction - if (req.getElementToDestroy() instanceof Interaction) { - Interaction interaction = (Interaction) req.getElementToDestroy(); - - // Lifelines - for (Iterator it = interaction.getLifelines().iterator(); it - .hasNext();) { - Lifeline lifeline = (Lifeline) it.next(); - - // Search for its EditPart - EditPart lifelineEditPart = null; - for (Iterator epIt = getHost().getViewer() - .getEditPartRegistry().keySet().iterator(); epIt - .hasNext();) { - Object epObj = epIt.next(); - if (epObj instanceof Node) { - Node node = (Node) epObj; - if (node.getElement() == lifeline) { - lifelineEditPart = (EditPart) getHost().getViewer() - .getEditPartRegistry().get(node); - break; - } - } - } - if (lifelineEditPart != null) { - EditCommandRequestWrapper editCommandRequest = new EditCommandRequestWrapper( - new DestroyElementRequest( - ((InteractionEditPart) getHost()) - .getEditingDomain(), req - .isConfirmationRequired()), - Collections.EMPTY_MAP); - cc.add(lifelineEditPart.getCommand(editCommandRequest)); - } - } - - // Interactions - for (Iterator it = interaction.getFragments().iterator(); it - .hasNext();) { - InteractionFragment fragment = (InteractionFragment) it.next(); - if (fragment instanceof Interaction) { - EditPart interaction2EditPart = null; - for (Iterator epIt = getHost().getViewer() - .getEditPartRegistry().keySet().iterator(); epIt - .hasNext();) { - Object epObj = epIt.next(); - if (epObj instanceof Node) { - Node node = (Node) epObj; - if (node.getElement() == fragment) { - interaction2EditPart = (EditPart) getHost() - .getViewer().getEditPartRegistry().get( - node); - break; - } - } - } - if (interaction2EditPart != null) { - if (interaction2EditPart instanceof InteractionInteractionCompartment2EditPart) { - interaction2EditPart = interaction2EditPart - .getParent(); - } - EditCommandRequestWrapper editCommandRequest = new EditCommandRequestWrapper( - new DestroyElementRequest( - ((InteractionEditPart) getHost()) - .getEditingDomain(), req - .isConfirmationRequired()), - Collections.EMPTY_MAP); - cc.add(interaction2EditPart - .getCommand(editCommandRequest)); - } - } - } - } - - // What comes next is GMF generated code - // Do not destroy child nodes as we have already done it before - // addDestroyChildNodesCommand(cc); - addDestroyShortcutsCommand(cc); - View view = (View) getHost().getModel(); - if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ - req.setElementToDestroy(view); - } - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - protected void addDestroyChildNodesCommand(CompoundCommand cmd) { - View view = (View) getHost().getModel(); - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - return; - } - for (Iterator it = view.getChildren().iterator(); it.hasNext();) { - Node node = (Node) it.next(); - switch (UMLVisualIDRegistry.getVisualID(node)) { - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - for (Iterator cit = node.getChildren().iterator(); cit - .hasNext();) { - Node cnode = (Node) cit.next(); - switch (UMLVisualIDRegistry.getVisualID(cnode)) { - case Interaction2EditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - case LifelineEditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - case CombinedFragmentEditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(cnode)); - break; - } - } - break; - } - } - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return null; - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return null; - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java deleted file mode 100644 index c23c8ed3711..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineCanonicalEditPolicy.java +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewType; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramUpdater; -import org.eclipse.papyrus.diagram.sequence.part.UMLNodeDescriptor; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class LifelineCanonicalEditPolicy extends CanonicalEditPolicy { - - /** - * @generated - */ - Set myFeaturesToSynchronize; - - /** - * @generated - */ - @Override - protected List getSemanticChildrenList() { - View viewObject = (View) getHost().getModel(); - List result = new LinkedList(); - for (Iterator it = UMLDiagramUpdater.getLifeline_2002SemanticChildren( - viewObject).iterator(); it.hasNext();) { - EObject nextValue = ((UMLNodeDescriptor) it.next()) - .getModelElement(); - if (MultiDiagramUtil.findEObjectReferencedInEAnnotation(getHost(), - nextValue)) { - result.add(nextValue); - } - } - return result; - } - - /** - * @generated - */ - @Override - protected boolean isOrphaned(Collection semanticChildren, final View view) { - if (view.getType() == ViewType.NOTE || view.getType() == ViewType.TEXT) { - return false; - } - if (view.getElement() != null) { - int actualID = UMLVisualIDRegistry.getVisualID(view); - int suggestedID = UMLVisualIDRegistry.getNodeVisualID( - (View) getHost().getModel(), view.getElement()); - switch (actualID) { - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return actualID != suggestedID; - } - return false; - } - return true; - } - - /** - * @generated - */ - @Override - protected String getDefaultFactoryHint() { - return null; - } - - /** - * @generated - */ - @Override - protected Set getFeaturesToSynchronize() { - if (myFeaturesToSynchronize == null) { - myFeaturesToSynchronize = new HashSet(); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - return myFeaturesToSynchronize; - } - - /** - * @generated - */ - @Override - protected void refreshSemantic() { - super.refreshSemantic(); - // this will take care of the filtering of views - Diagram diagram = MDTUtil.getHostDiagram(this); - if (diagram != null) { - MDTUtil.filterDiagramViews(diagram); - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java deleted file mode 100644 index fd73a808cd3..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/LifelineItemSemanticEditPolicy.java +++ /dev/null @@ -1,341 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.command.wrappers.EMFtoGEFCommandWrapper; -import org.eclipse.papyrus.diagram.common.ids.ReorientLinkIDs; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.common.commands.CreateElementAndInitializeFeatureCommand; -import org.eclipse.papyrus.diagram.common.commands.UpdateLifelineRepresentsCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.BehaviorExecutionSpecificationCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentAnnotatedElementReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6CreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class LifelineItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getCreateCommand(CreateElementRequest req) { - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.BehaviorExecutionSpecification_2003 == req - .getElementType()) { - if (req.getContainmentFeature() == null) { - req.setContainmentFeature(UMLPackage.eINSTANCE - .getInteraction_Fragment()); - } - - // Added to initialize the property "Covered" of the new - // BehaviourExecutionSpecification - CreateElementCommand behaviourCmd = new BehaviorExecutionSpecificationCreateCommand( - req); - EReference feature = UMLPackage.eINSTANCE - .getInteractionFragment_Covered(); - Object value = req.getContainer(); - return new CreateElementAndInitializeFeatureCommand(behaviourCmd, - feature, value); - - } - return super.getCreateCommand(req); - } - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - // This line is also GMF generated code - CompoundCommand cc = getDestroyEdgesCommand(); - - // First destroy all the BehaviourExecutionSpecifications within the - // Lifeline - if (req.getElementToDestroy() instanceof Lifeline) { - Lifeline lifeline = (Lifeline) req.getElementToDestroy(); - for (Iterator it = lifeline.getCoveredBys().iterator(); it - .hasNext();) { - Object obj = it.next(); - - if (obj instanceof BehaviorExecutionSpecification) { - // Search for its EditPart - EditPart besEditPart = null; - for (Iterator epIt = getHost().getViewer() - .getEditPartRegistry().keySet().iterator(); epIt - .hasNext();) { - Object epObj = epIt.next(); - if (epObj instanceof Node) { - Node node = (Node) epObj; - if (node.getElement() == obj) { - besEditPart = (EditPart) getHost().getViewer() - .getEditPartRegistry().get(node); - break; - } - } - } - if (besEditPart != null) { - EditCommandRequestWrapper editCommandRequest = new EditCommandRequestWrapper( - new DestroyElementRequest( - ((LifelineEditPart) getHost()) - .getEditingDomain(), req - .isConfirmationRequired()), - Collections.EMPTY_MAP); - cc.add(besEditPart.getCommand(editCommandRequest)); - } - } - } - - UpdateLifelineRepresentsCommand lifeLineCommand = new UpdateLifelineRepresentsCommand( - lifeline, null, this.getEditingDomain()); - - cc.add(new EMFtoGEFCommandWrapper(lifeLineCommand)); - - } - - // What comes next is GMF generated code - addDestroyChildNodesCommand(cc); - addDestroyShortcutsCommand(cc); - cc.add(getGEFWrapper(new DestroyElementCommand(req))); - return cc.unwrap(); - } - - /** - * @generated - */ - protected void addDestroyChildNodesCommand(CompoundCommand cmd) { - View view = (View) getHost().getModel(); - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - return; - } - for (Iterator it = view.getChildren().iterator(); it.hasNext();) { - Node node = (Node) it.next(); - switch (UMLVisualIDRegistry.getVisualID(node)) { - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - cmd.add(getDestroyElementCommand(node)); - break; - } - } - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return null; - } - return null; - } - - /** - * @generated - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - if (UMLElementTypes.Message_3001 == req.getElementType()) { - return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - req.getTarget())); - } - if (UMLElementTypes.Message_3002 == req.getElementType()) { - return getGEFWrapper(new Message2CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3003 == req.getElementType()) { - return getGEFWrapper(new Message3CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3004 == req.getElementType()) { - return getGEFWrapper(new Message4CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3005 == req.getElementType()) { - return getGEFWrapper(new Message5CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.Message_3006 == req.getElementType()) { - return getGEFWrapper(new Message6CreateCommand(req, - req.getSource(), req.getTarget())); - } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return null; - } - if (UMLElementTypes.CommentAnnotatedElement_3008 == req - .getElementType()) { - return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, - req.getSource(), req.getTarget())); - } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - - // add the view element - req.setParameter(ReorientLinkIDs.nodeEditPart, - ((IGraphicalEditPart) this.getHost()).getNotationView()); - // add the view link - List list = DiagramEditPartsUtil.getEObjectViews(req.getRelationship()); - if (list.size() > 0) { - req.setParameter(ReorientLinkIDs.linkEditPart, list.get(0)); - } - - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - - /** - * Returns command to reorient EReference based link. New link target or - * source should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - switch (getVisualID(req)) { - case ElementOwnedCommentEditPart.VISUAL_ID: - return getGEFWrapper(new ElementOwnedCommentReorientCommand(req)); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req)); - } - return super.getReorientReferenceRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java deleted file mode 100644 index 4222817aa97..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message2ItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class Message2ItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java deleted file mode 100644 index de9d6441805..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message3ItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class Message3ItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java deleted file mode 100644 index d85eb38c56c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message4ItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class Message4ItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java deleted file mode 100644 index 28cc9176e52..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message5ItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class Message5ItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java deleted file mode 100644 index 06b784a72d1..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/Message6ItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class Message6ItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java deleted file mode 100644 index 3adc653e4ba..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/MessageItemSemanticEditPolicy.java +++ /dev/null @@ -1,160 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; - -import org.eclipse.papyrus.diagram.sequence.edit.commands.ElementOwnedCommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message2ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message3ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message4ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message5ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.Message6ReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.MessageReorientCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated NOT - */ -public class MessageItemSemanticEditPolicy extends - MessageDestroySemanticEditPolicy { - - /** - * @generated NOT - */ - @Override - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return super.getDestroyElementCommand(req); - } - - /** - * @generated - */ - @Override - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req) - : getCompleteCreateRelationshipCommand(req); - return command != null ? command : super - .getCreateRelationshipCommand(req); - } - - /** - * @generated not - * @author mgil - */ - protected Command getStartCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - if (UMLElementTypes.ElementOwnedComment_3007 == req.getElementType()) { - return getGEFWrapper(new ElementOwnedCommentCreateCommand(req, req - .getSource(), req.getTarget())); - } - return null; - } - - /** - * @generated not - * @author mgil - */ - protected Command getCompleteCreateRelationshipCommand( - CreateRelationshipRequest req) { - /** - * Commented to avoid trying to link a Message from another Message - */ - // if (UMLElementTypes.Message_3001 == req.getElementType()) { - // return getGEFWrapper(new MessageCreateCommand(req, req.getSource(), - // req.getTarget())); - // } - // if (UMLElementTypes.Message_3002 == req.getElementType()) { - // return getGEFWrapper(new Message2CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3003 == req.getElementType()) { - // return getGEFWrapper(new Message3CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3004 == req.getElementType()) { - // return getGEFWrapper(new Message4CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3005 == req.getElementType()) { - // return getGEFWrapper(new Message5CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - // if (UMLElementTypes.Message_3006 == req.getElementType()) { - // return getGEFWrapper(new Message6CreateCommand(req, - // req.getSource(), req.getTarget())); - // } - return null; - } - - /** - * Returns command to reorient EClass based link. New link target or source - * should be the domain model element associated with this node. - * - * @generated - */ - @Override - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - switch (getVisualID(req)) { - case MessageEditPart.VISUAL_ID: - return getGEFWrapper(new MessageReorientCommand(req)); - case Message2EditPart.VISUAL_ID: - return getGEFWrapper(new Message2ReorientCommand(req)); - case Message3EditPart.VISUAL_ID: - return getGEFWrapper(new Message3ReorientCommand(req)); - case Message4EditPart.VISUAL_ID: - return getGEFWrapper(new Message4ReorientCommand(req)); - case Message5EditPart.VISUAL_ID: - return getGEFWrapper(new Message5ReorientCommand(req)); - case Message6EditPart.VISUAL_ID: - return getGEFWrapper(new Message6ReorientCommand(req)); - } - return super.getReorientRelationshipCommand(req); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java deleted file mode 100644 index 10d803567c2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageCanonicalEditPolicy.java +++ /dev/null @@ -1,788 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.requests.CreateRequest; -import org.eclipse.gmf.runtime.common.core.command.CompositeCommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewType; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction; -import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalConnectionEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Event; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.InitializeInteractionViewCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramUpdater; -import org.eclipse.papyrus.diagram.sequence.part.UMLLinkDescriptor; -import org.eclipse.papyrus.diagram.sequence.part.UMLNodeDescriptor; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class PackageCanonicalEditPolicy extends CanonicalConnectionEditPolicy { - - /** - * @generated - */ - Set myFeaturesToSynchronize; - - /** - * @generated - */ - @Override - protected List getSemanticChildrenList() { - View viewObject = (View) getHost().getModel(); - List result = new LinkedList(); - for (Iterator it = UMLDiagramUpdater.getPackage_79SemanticChildren( - viewObject).iterator(); it.hasNext();) { - EObject nextValue = ((UMLNodeDescriptor) it.next()) - .getModelElement(); - if (MultiDiagramUtil.findEObjectReferencedInEAnnotation(getHost(), - nextValue)) { - result.add(nextValue); - } - } - return result; - } - - /** - * @generated - */ - @Override - protected boolean shouldDeleteView(View view) { - return true; - } - - /** - * @generated - */ - @Override - protected boolean isOrphaned(Collection semanticChildren, final View view) { - if (view.getType() == ViewType.NOTE || view.getType() == ViewType.TEXT) { - return false; - } - if (view.getElement() != null) { - int actualID = UMLVisualIDRegistry.getVisualID(view); - int suggestedID = UMLVisualIDRegistry.getNodeVisualID( - (View) getHost().getModel(), view.getElement()); - switch (actualID) { - case InteractionEditPart.VISUAL_ID: - case CommentEditPart.VISUAL_ID: - return actualID != suggestedID; - } - return false; - } - return true; - } - - /** - * @generated - */ - @Override - protected String getDefaultFactoryHint() { - return null; - } - - /** - * @generated - */ - @Override - protected Set getFeaturesToSynchronize() { - if (myFeaturesToSynchronize == null) { - myFeaturesToSynchronize = new HashSet(); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getPackage_PackagedElement()); - myFeaturesToSynchronize.add(UMLPackage.eINSTANCE - .getElement_OwnedComment()); - } - return myFeaturesToSynchronize; - } - - /** - * @generated - */ - @Override - protected List getSemanticConnectionsList() { - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - protected EObject getSourceElement(EObject relationship) { - return null; - } - - /** - * @generated - */ - @Override - protected EObject getTargetElement(EObject relationship) { - return null; - } - - /** - * @generated - */ - @Override - protected boolean shouldIncludeConnection(Edge connector, - Collection children) { - return false; - } - - /** - * @generated - */ - @Override - protected void refreshSemantic() { - List createdViews = new LinkedList(); - createdViews.addAll(refreshSemanticChildren()); - List createdConnectionViews = new LinkedList(); - createdConnectionViews.addAll(refreshSemanticConnections()); - createdConnectionViews.addAll(refreshConnections()); - if (createdViews.size() > 1) { - // perform a layout of the container - DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host() - .getEditingDomain(), createdViews, host()); - executeCommand(new ICommandProxy(layoutCmd)); - } - createdViews.addAll(createdConnectionViews); - makeViewsImmutable(createdViews); - Diagram diagram = MDTUtil.getHostDiagram(this); - - if (diagram != null) { - MDTUtil.filterDiagramViews(diagram); - } - } - - @Override - protected Command getCreateViewCommand(CreateRequest request) { - IGraphicalEditPart host = getHost() instanceof IGraphicalEditPart ? (IGraphicalEditPart) getHost() - : null; - CompositeCommand cc = null; - if (request instanceof CreateViewRequest && host != null - && host.getEditingDomain() != null) { - cc = new CompositeCommand("Initialize Interactions"); - List<Interaction> interactions = extractInteractionsFromRequest((CreateViewRequest) request); - for (Interaction interaction : interactions) { - InitializeInteractionViewCommand command = new InitializeInteractionViewCommand( - host.getEditingDomain(), "Initialize interaction view", - null); - command.setInteraction(interaction); - command.setParentEditPart(host); - cc.add(command); - } - } - if (cc != null && cc.canExecute()) { - Command command = super.getCreateViewCommand(request); - if (command != null && command.canExecute()) { - return command.chain(new ICommandProxy(cc)); - } else { - return new ICommandProxy(cc); - } - } else { - return super.getCommand(request); - } - } - - protected List<Interaction> extractInteractionsFromRequest( - CreateViewRequest request) { - List<Interaction> interactions = new ArrayList<Interaction>(); - List<ViewDescriptor> toRemove = new ArrayList<ViewDescriptor>(); - for (Object object : request.getViewDescriptors()) { - if (object instanceof ViewDescriptor) { - ViewDescriptor descriptor = (ViewDescriptor) object; - Object adapted = descriptor.getElementAdapter().getAdapter( - Interaction.class); - if (adapted instanceof Interaction) { - interactions.add((Interaction) adapted); - toRemove.add(descriptor); - } - } - } - for (ViewDescriptor descriptor : toRemove) { - request.getViewDescriptors().remove(descriptor); - } - return interactions; - } - - /** - * @generated - */ - private Diagram getDiagram() { - return ((View) getHost().getModel()).getDiagram(); - } - - /** - * @generated - */ - private Collection refreshConnections() { - Domain2Notation domain2NotationMap = new Domain2Notation(); - Collection linkDescriptors = collectAllLinks(getDiagram(), - domain2NotationMap); - Collection existingLinks = new LinkedList(getDiagram().getEdges()); - for (Iterator linksIterator = existingLinks.iterator(); linksIterator - .hasNext();) { - Edge nextDiagramLink = (Edge) linksIterator.next(); - int diagramLinkVisualID = UMLVisualIDRegistry - .getVisualID(nextDiagramLink); - if (diagramLinkVisualID == -1) { - if (nextDiagramLink.getSource() != null - && nextDiagramLink.getTarget() != null) { - linksIterator.remove(); - } - continue; - } - //don't remove notation-only links - if (isNotationOnlyEdge(nextDiagramLink)) { - linksIterator.remove(); - continue; - } - EObject diagramLinkObject = nextDiagramLink.getElement(); - EObject diagramLinkSrc = nextDiagramLink.getSource().getElement(); - EObject diagramLinkDst = nextDiagramLink.getTarget().getElement(); - for (Iterator LinkDescriptorsIterator = linkDescriptors.iterator(); LinkDescriptorsIterator - .hasNext();) { - UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor) LinkDescriptorsIterator - .next(); - if (diagramLinkObject == nextLinkDescriptor.getModelElement() - && diagramLinkSrc == nextLinkDescriptor.getSource() - && diagramLinkDst == nextLinkDescriptor - .getDestination() - && diagramLinkVisualID == nextLinkDescriptor - .getVisualID()) { - linksIterator.remove(); - LinkDescriptorsIterator.remove(); - } - } - } - deleteViews(existingLinks.iterator()); - return createConnections(linkDescriptors, domain2NotationMap); - } - - /** - * @generated - */ - private Collection collectAllLinks(View view, - Domain2Notation domain2NotationMap) { - if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(view))) { - return Collections.EMPTY_LIST; - } - List result = new LinkedList(); - switch (UMLVisualIDRegistry.getVisualID(view)) { - case PackageEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getPackage_79ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case InteractionEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getInteraction_1001ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case CommentEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getComment_2005ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Interaction2EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getInteraction_2001ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case LifelineEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getLifeline_2002ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result - .addAll(UMLDiagramUpdater - .getBehaviorExecutionSpecification_2003ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case CombinedFragmentEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getCombinedFragment_2004ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case MessageEditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3001ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Message2EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3002ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Message3EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3003ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Message4EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3004ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Message5EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3005ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - case Message6EditPart.VISUAL_ID: { - if (!domain2NotationMap.containsKey(view.getElement())) { - result.addAll(UMLDiagramUpdater - .getMessage_3006ContainedLinks(view)); - } - domain2NotationMap.put(view.getElement(), view); - break; - } - } - for (Iterator children = view.getChildren().iterator(); children - .hasNext();) { - View childView = (View) children.next(); - result.addAll(collectAllLinks(childView, domain2NotationMap)); - } - for (Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) { - View childView = (View) edges.next(); - result.addAll(collectAllLinks(childView, domain2NotationMap)); - } - - if (view instanceof Diagram) { - result.addAll(getReferencesLinkDescriptors((Diagram) view)); - } - removeDuplicatedLinks(result); - purgeCollection(view.getDiagram(), result); - return result; - } - - /** - * @generated - */ - private void removeDuplicatedLinks(List linkDescriptors) { - List toDelete = new ArrayList(); - for (int i = 0; i < linkDescriptors.size(); i++) { - java.lang.Object object1 = linkDescriptors.get(i); - if (object1 instanceof UMLLinkDescriptor) { - UMLLinkDescriptor linkDescriptor1 = (UMLLinkDescriptor) object1; - for (int j = i + 1; j < linkDescriptors.size(); j++) { - java.lang.Object object2 = linkDescriptors.get(j); - if (object2 instanceof UMLLinkDescriptor) { - UMLLinkDescriptor linkDescriptor2 = (UMLLinkDescriptor) object2; - if (checkSameLinkDescriptor(linkDescriptor1, - linkDescriptor2)) { - if (toDelete.contains(linkDescriptor2) == false) { - toDelete.add(linkDescriptor2); - } - } - } - } - } - } - for (java.lang.Object object : toDelete) { - linkDescriptors.remove(object); - } - } - - /** - * @generated - */ - private void purgeCollection(Diagram diagram, Collection list) { - for (Iterator i = list.iterator(); i.hasNext();) { - java.lang.Object obj = i.next(); - if (obj instanceof Collection) { - purgeCollection(diagram, (Collection) obj); - } else { - if (obj instanceof UMLLinkDescriptor) { - UMLLinkDescriptor lDes = (UMLLinkDescriptor) obj; - if (lDes.getModelElement() != null - && !MultiDiagramUtil - .findEObjectReferencedInEAnnotation( - diagram, lDes.getModelElement())) { - i.remove(); - } - } - } - } - } - - /** - * @generated - */ - private boolean checkSameLinkDescriptor(UMLLinkDescriptor link1, - UMLLinkDescriptor link2) { - EObject model1 = link1.getModelElement(); - EObject model2 = link2.getModelElement(); - if (model1 == null && model2 != null) { - return false; - } - if (model1 != null && model2 == null) { - return false; - } - if (model1 != null && model1.equals(model2) == false) { - return false; - } - - EObject source1 = link1.getSource(); - EObject source2 = link2.getSource(); - if (source1 == null && source2 != null) { - return false; - } - if (source1 != null && source2 == null) { - return false; - } - if (source1 != null && source1.equals(source2) == false) { - return false; - } - - EObject destination1 = link1.getDestination(); - EObject destination2 = link2.getDestination(); - if (destination1 == null && destination2 != null) { - return false; - } - if (destination1 != null && destination2 == null) { - return false; - } - if (destination1 != null && destination1.equals(destination2) == false) { - return false; - } - - String type1 = link1.getType(); - String type2 = link2.getType(); - if (type1 == null && type2 != null) { - return false; - } - if (type1 != null && type2 == null) { - return false; - } - if (type1 != null && type1.equals(type2) == false) { - return false; - } - - int visualID1 = link1.getVisualID(); - int visualID2 = link2.getVisualID(); - if (visualID1 <= -1 || visualID2 <= -1) { - return false; - } - if (visualID1 != visualID2) { - return false; - } - - return true; - } - - /** - * @generated - */ - private List getReferencesLinkDescriptors(Diagram diagram) { - List<EObject> references = MultiDiagramUtil - .getAllReferencesInEAnnotation(diagram); - List linkDescriptors = new ArrayList(); - for (EObject eObject : references) { - if (UMLVisualIDRegistry.getLinkWithClassVisualID(eObject) >= 0) { - UMLLinkDescriptor linkDescriptor = UMLDiagramUpdater - .createLinkDescriptorFromModelElement(eObject); - if (linkDescriptor != null) { - linkDescriptors.add(linkDescriptor); - } - } - } - return linkDescriptors; - } - - /** - * @generated - */ - private Collection createConnections(Collection linkDescriptors, - Domain2Notation domain2NotationMap) { - List adapters = new LinkedList(); - for (Iterator linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator - .hasNext();) { - final UMLLinkDescriptor nextLinkDescriptor = (UMLLinkDescriptor) linkDescriptorsIterator - .next(); - EditPart sourceEditPart = getSourceEditPart(nextLinkDescriptor, - domain2NotationMap); - EditPart targetEditPart = getTargetEditPart(nextLinkDescriptor, - domain2NotationMap); - if (sourceEditPart == null || targetEditPart == null) { - continue; - } - CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor( - nextLinkDescriptor.getSemanticAdapter(), null, - ViewUtil.APPEND, false, ((IGraphicalEditPart) getHost()) - .getDiagramPreferencesHint()); - CreateConnectionViewRequest ccr = new CreateConnectionViewRequest( - descriptor); - ccr.setType(RequestConstants.REQ_CONNECTION_START); - ccr.setSourceEditPart(sourceEditPart); - sourceEditPart.getCommand(ccr); - ccr.setTargetEditPart(targetEditPart); - ccr.setType(RequestConstants.REQ_CONNECTION_END); - Command cmd = targetEditPart.getCommand(ccr); - if (cmd != null && cmd.canExecute()) { - executeCommand(cmd); - IAdaptable viewAdapter = (IAdaptable) ccr.getNewObject(); - if (viewAdapter != null) { - adapters.add(viewAdapter); - } - } - } - return adapters; - } - - /** - * @generated - */ - private EditPart getEditPart(EObject domainModelElement, - Domain2Notation domain2NotationMap) { - View view = (View) domain2NotationMap.get(domainModelElement); - if (view != null) { - return (EditPart) getHost().getViewer().getEditPartRegistry().get( - view); - } - return null; - } - - /** - * @generated - */ - private EditPart getSourceEditPart(UMLLinkDescriptor descriptor, - Domain2Notation domain2NotationMap) { - return getEditPart(descriptor.getSource(), domain2NotationMap); - } - - /** - * @generated - */ - private EditPart getTargetEditPart(UMLLinkDescriptor descriptor, - Domain2Notation domain2NotationMap) { - return getEditPart(descriptor.getDestination(), domain2NotationMap); - } - - /** - * @generated - */ - protected final EditPart getHintedEditPart(EObject domainModelElement, - Domain2Notation domain2NotationMap, int hintVisualId) { - View view = (View) domain2NotationMap.getHinted(domainModelElement, - UMLVisualIDRegistry.getType(hintVisualId)); - if (view != null) { - return (EditPart) getHost().getViewer().getEditPartRegistry().get( - view); - } - return null; - } - - /** - * @generated - */ - private boolean isNotationOnlyEdge(Edge edge) { - return false; - } - - /** - * @generated - */ - private static class Domain2Notation { - /** - * @generated - */ - private final HashMap myMap = new HashMap(); - - /** - * @generated - */ - public boolean containsDomainElement(EObject domainElement) { - return myMap.containsKey(domainElement); - } - - /** - * @generated - */ - public boolean containsKey(EObject domainElement) { - return containsDomainElement(domainElement); - } - - /** - * @generated - */ - public void put(EObject domainElement, View view) { - Object viewOrList = myMap.get(domainElement); - if (viewOrList instanceof View) { - myMap.remove(domainElement); - List<View> list = new LinkedList<View>(); - list.add((View) viewOrList); - myMap.put(domainElement, list); - list.add(view); - } else if (viewOrList instanceof List) { - ((List) viewOrList).add(view); - } else { - myMap.put(domainElement, view); - } - } - - /** - * @generated - */ - public View get(EObject domainEObject) { - Object viewOrList = myMap.get(domainEObject); - if (viewOrList instanceof View) { - return (View) viewOrList; - } - if (viewOrList instanceof List) { - // preferring not-shortcut to shortcut -- important for cases when links arr to/from - // the element that is additionally shortcutted to the same diagram - for (Object next : (List) viewOrList) { - View nextView = (View) next; - if (nextView.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$ - return nextView; - } - } - return (View) ((List) viewOrList).get(0); - } - return null; - } - - /** - * @generated - */ - public View getHinted(EObject domainEObject, String hint) { - if (hint == null) { - return get(domainEObject); - } - Object viewOrList = myMap.get(domainEObject); - if (viewOrList instanceof View) { - //no choice, will return what we have - return (View) viewOrList; - } - for (Object next : (List) viewOrList) { - View nextView = (View) next; - if (hint.equals(nextView.getType())) { - return nextView; - } - } - //hint not found -- return what we have - return (View) ((List) viewOrList).get(0); - } - - } - - /** - * @NOT-generated - */ - @Override - protected boolean shouldHandleNotificationEvent(Notification event) { - // Created events in a Package don't need to refresh the diagram. This - // is done to avoid to refresh the diagram - // before the end of the MessageXCreateCommand. Remember that the Events - // of a Message are created during - // the "doDefaultMessageInitialize" operation. - if (event.getNewValue() instanceof Event) { - return false; - } - return super.shouldHandleNotificationEvent(event); - } - - /** - * @NOT-generated - * {@inheritDoc} - */ - @Override - public boolean canCreate(EObject object) { - // The returned value before was true. However, in order to make the Delete - // From Diagram action work, it should return false. The elements that shouldn't - // have enabled the delete diagram action, are controlled with the - // SequenceDeleteOnlyViewComponentEditPolicy. - return false; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java deleted file mode 100644 index 706ce128822..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/PackageItemSemanticEditPolicy.java +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.commands.Command; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLSwitch; - -import org.eclipse.papyrus.diagram.common.commands.DuplicateAnythingCommand; -import org.eclipse.papyrus.diagram.common.part.DiagramCanvasSwitch; -import org.eclipse.papyrus.diagram.common.util.BasicEcoreSwitch; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.CommentCreateCommand; -import org.eclipse.papyrus.diagram.sequence.edit.commands.InteractionCreateCommand; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class PackageItemSemanticEditPolicy extends - UMLBaseItemSemanticEditPolicy { - - /** - * @generated NOT - * - * modified to handle an Interaction as canvas element. - */ - static class EReferenceDiagramSwitch extends - BasicEcoreSwitch<EReference, IElementType> { - @Override - public EReference doSwitch(EObject modelElement) { - - final IElementType type = getInfo(); - if (type == null) { - return null; - } - UMLSwitch<EReference> aSwitch = new UMLSwitch<EReference>() { - @Override - public EReference casePackage(Package modelElement) { - EReference reference = null; - if (type.equals(UMLElementTypes.Interaction_1001)) { - reference = UMLPackage.eINSTANCE - .getPackage_PackagedElement(); - } - if (type.equals(UMLElementTypes.Comment_2005)) { - reference = UMLPackage.eINSTANCE - .getElement_OwnedComment(); - } - - return reference; - } - - @Override - public EReference caseInteraction(Interaction modelElement) { - EReference reference = null; - if (type.equals(UMLElementTypes.Comment_2005)) { - reference = UMLPackage.eINSTANCE - .getElement_OwnedComment(); - } - return reference; - } - - }; - - return aSwitch.doSwitch(modelElement); - } - } - - /** - * @generated - */ - private EReferenceDiagramSwitch aSwitch = new EReferenceDiagramSwitch(); - - /** - * @generated - */ - @Override - protected Command getCreateCommand(CreateElementRequest req) { - - Diagram diagram = DiagramEditPartsUtil - .findDiagramFromEditPart(getHost()); - if (diagram != null) { - req.getParameters().put(MultiDiagramUtil.BelongToDiagramSource, - diagram); - } - EObject canvasElement = DiagramCanvasSwitch.getCanvasElement(this); - if (canvasElement == null) { - return null; - } - aSwitch.setInfo(req.getElementType()); - req.setContainmentFeature(aSwitch.doSwitch(canvasElement)); - if (UMLElementTypes.Interaction_1001 == req.getElementType()) { - return getGEFWrapper(InteractionCreateCommand.create(req, - canvasElement)); - } - if (UMLElementTypes.Comment_2005 == req.getElementType()) { - return getGEFWrapper(CommentCreateCommand - .create(req, canvasElement)); - } - return super.getCreateCommand(req); - } - - /** - * Modified by gmerin: Sequence diagram should only allow duplicate of - * Interactions Interaction elements - * - * @generated NOT - */ - @Override - protected Command getDuplicateCommand(DuplicateElementsRequest req) { - // Only Interactions should be duplicated - for (Object obj : req.getElementsToBeDuplicated()) { - if (!(obj instanceof Interaction)) - return null; - } - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - Diagram currentDiagram = null; - if (getHost() instanceof IGraphicalEditPart) { - currentDiagram = ((IGraphicalEditPart) getHost()).getNotationView() - .getDiagram(); - } - return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, - currentDiagram)); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java deleted file mode 100644 index db1fd26819f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLBaseItemSemanticEditPolicy.java +++ /dev/null @@ -1,737 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.CompoundCommand; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gef.requests.ReconnectRequest; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy; -import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper; -import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; -import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; -import org.eclipse.gmf.runtime.emf.type.core.IEditHelperContext; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; -import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.sequence.edit.helpers.UMLBaseEditHelper; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLAbstractExpression; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLOCLFactory; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLBaseItemSemanticEditPolicy extends SemanticEditPolicy { - - /** - * Extended request data key to hold editpart visual id. - * - * @generated - */ - public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$ - - /** - * Extended request data key to hold editpart visual id. - * Add visual id of edited editpart to extended data of the request - * so command switch can decide what kind of diagram element is being edited. - * It is done in those cases when it's not possible to deduce diagram - * element kind from domain element. - * - * @generated - */ - @Override - public Command getCommand(Request request) { - if (request instanceof ReconnectRequest) { - Object view = ((ReconnectRequest) request).getConnectionEditPart() - .getModel(); - if (view instanceof View) { - Integer id = new Integer(UMLVisualIDRegistry - .getVisualID((View) view)); - request.getExtendedData().put(VISUAL_ID_KEY, id); - } - } - return super.getCommand(request); - } - - /** - * Returns visual id from request parameters. - * - * @generated - */ - protected int getVisualID(IEditCommandRequest request) { - Object id = request.getParameter(VISUAL_ID_KEY); - return id instanceof Integer ? ((Integer) id).intValue() : -1; - } - - /** - * @generated - */ - @Override - protected Command getSemanticCommand(IEditCommandRequest request) { - IEditCommandRequest completedRequest = completeRequest(request); - Object editHelperContext = completedRequest.getEditHelperContext(); - if (editHelperContext instanceof View - || (editHelperContext instanceof IEditHelperContext && ((IEditHelperContext) editHelperContext) - .getEObject() instanceof View)) { - // no semantic commands are provided for pure design elements - return null; - } - if (editHelperContext == null) { - editHelperContext = ViewUtil - .resolveSemanticElement((View) getHost().getModel()); - } - IElementType elementType = ElementTypeRegistry.getInstance() - .getElementType(editHelperContext); - if (elementType == ElementTypeRegistry.getInstance().getType( - "org.eclipse.gmf.runtime.emf.type.core.default")) { //$NON-NLS-1$ - elementType = null; - } - Command semanticCommand = getSemanticCommandSwitch(completedRequest); - if (semanticCommand != null) { - ICommand command = semanticCommand instanceof ICommandProxy ? ((ICommandProxy) semanticCommand) - .getICommand() - : new CommandProxy(semanticCommand); -// completedRequest.setParameter( -// UMLBaseEditHelper.EDIT_POLICY_COMMAND, command); - } - if (elementType != null) { - ICommand command = elementType.getEditCommand(completedRequest); - if (command != null) { - if (!(command instanceof CompositeTransactionalCommand)) { - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - command = new CompositeTransactionalCommand(editingDomain, - command.getLabel()).compose(command); - } - semanticCommand = new ICommandProxy(command); - } - } - boolean shouldProceed = true; - if (completedRequest instanceof DestroyRequest) { - shouldProceed = shouldProceed((DestroyRequest) completedRequest); - } - if (shouldProceed) { - if (completedRequest instanceof DestroyRequest) { - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()) - .getEditingDomain(); - Command deleteViewCommand = new ICommandProxy( - new DeleteCommand(editingDomain, (View) getHost() - .getModel())); - semanticCommand = semanticCommand == null ? deleteViewCommand - : semanticCommand.chain(deleteViewCommand); - } - return semanticCommand; - } - return null; - } - - /** - * @generated - */ - protected Command getSemanticCommandSwitch(IEditCommandRequest req) { - if (req instanceof CreateRelationshipRequest) { - return getCreateRelationshipCommand((CreateRelationshipRequest) req); - } else if (req instanceof CreateElementRequest) { - return getCreateCommand((CreateElementRequest) req); - } else if (req instanceof ConfigureRequest) { - return getConfigureCommand((ConfigureRequest) req); - } else if (req instanceof DestroyElementRequest) { - return getDestroyElementCommand((DestroyElementRequest) req); - } else if (req instanceof DestroyReferenceRequest) { - return getDestroyReferenceCommand((DestroyReferenceRequest) req); - } else if (req instanceof DuplicateElementsRequest) { - return getDuplicateCommand((DuplicateElementsRequest) req); - } else if (req instanceof GetEditContextRequest) { - return getEditContextCommand((GetEditContextRequest) req); - } else if (req instanceof MoveRequest) { - return getMoveCommand((MoveRequest) req); - } else if (req instanceof ReorientReferenceRelationshipRequest) { - return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest) req); - } else if (req instanceof ReorientRelationshipRequest) { - return getReorientRelationshipCommand((ReorientRelationshipRequest) req); - } else if (req instanceof SetRequest) { - return getSetCommand((SetRequest) req); - } - return null; - } - - /** - * @generated - */ - protected Command getConfigureCommand(ConfigureRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getCreateCommand(CreateElementRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getSetCommand(SetRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getEditContextCommand(GetEditContextRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getDestroyElementCommand(DestroyElementRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getDuplicateCommand(DuplicateElementsRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getMoveCommand(MoveRequest req) { - return null; - } - - /** - * @generated - */ - protected Command getReorientReferenceRelationshipCommand( - ReorientReferenceRelationshipRequest req) { - return UnexecutableCommand.INSTANCE; - } - - /** - * @generated - */ - protected Command getReorientRelationshipCommand( - ReorientRelationshipRequest req) { - return UnexecutableCommand.INSTANCE; - } - - /** - * @generated - */ - protected final Command getGEFWrapper(ICommand cmd) { - return new ICommandProxy(cmd); - } - - /** - * @deprecated use getGEFWrapper() instead - * @generated - */ - @Deprecated - protected final Command getMSLWrapper(ICommand cmd) { - // XXX deprecated: use getGEFWrapper() instead - return getGEFWrapper(cmd); - } - - /** - * @generated - */ - protected EObject getSemanticElement() { - return ViewUtil.resolveSemanticElement((View) getHost().getModel()); - } - - /** - * Returns editing domain from the host edit part. - * - * @generated - */ - protected TransactionalEditingDomain getEditingDomain() { - return ((IGraphicalEditPart) getHost()).getEditingDomain(); - } - - /** - * Creates command to destroy the link. - * - * @generated - */ - protected Command getDestroyElementCommand(View view) { - EditPart editPart = (EditPart) getHost().getViewer() - .getEditPartRegistry().get(view); - DestroyElementRequest request = new DestroyElementRequest( - getEditingDomain(), false); - return editPart.getCommand(new EditCommandRequestWrapper(request, - Collections.EMPTY_MAP)); - } - - /** - * Creates commands to destroy all host incoming and outgoing links. - * - * @generated - */ - protected CompoundCommand getDestroyEdgesCommand() { - CompoundCommand cmd = new CompoundCommand(); - View view = (View) getHost().getModel(); - for (Iterator it = view.getSourceEdges().iterator(); it.hasNext();) { - cmd.add(getDestroyElementCommand((Edge) it.next())); - } - for (Iterator it = view.getTargetEdges().iterator(); it.hasNext();) { - cmd.add(getDestroyElementCommand((Edge) it.next())); - } - return cmd; - } - - /** - * @generated - */ - protected void addDestroyShortcutsCommand(CompoundCommand command) { - View view = (View) getHost().getModel(); - if (view.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ - return; - } - for (Iterator it = view.getDiagram().getChildren().iterator(); it - .hasNext();) { - View nextView = (View) it.next(); - if (nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$ - continue; - } - command.add(getDestroyElementCommand(nextView)); - } - } - - /** - * @generated - */ - public static class LinkConstraints { - /** - * @generated - */ - private static final String OPPOSITE_END_VAR = "oppositeEnd"; //$NON-NLS-1$ - - /** - * @generated - */ - private static UMLAbstractExpression Message_3001_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3002_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3003_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3004_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3005_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3006_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression ElementOwnedComment_3007_TargetExpression; - - /** - * @generated - */ - private static UMLAbstractExpression CommentAnnotatedElement_3008_SourceExpression; - - /** - * @generated - */ - public static boolean canCreateMessage_3001(Interaction container, - Element source, Element target) { - return canExistMessage_3001(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateMessage_3002(Interaction container, - Element source, Element target) { - return canExistMessage_3002(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateMessage_3003(Interaction container, - Element source, Element target) { - return canExistMessage_3003(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateMessage_3004(Interaction container, - Element source, Element target) { - return canExistMessage_3004(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateMessage_3005(Interaction container, - Element source, Element target) { - return canExistMessage_3005(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateMessage_3006(Interaction container, - Element source, Element target) { - return canExistMessage_3006(container, source, target); - } - - /** - * @generated - */ - public static boolean canCreateElementOwnedComment_3007(Element source, - Comment target) { - if (source != null) { - if (source.getOwnedComments().contains(target)) { - return false; - } - if (source == target) { - return false; - } - } - return canExistElementOwnedComment_3007(source, target); - } - - /** - * @generated - */ - public static boolean canCreateCommentAnnotatedElement_3008( - Comment source, Element target) { - if (source != null) { - if (source.getAnnotatedElements().contains(target)) { - return false; - } - } - return canExistCommentAnnotatedElement_3008(source, target); - } - - /** - * @generated - */ - public static boolean canExistMessage_3001(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3001_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3001_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3001_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistMessage_3002(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3002_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3002_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3002_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistMessage_3003(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3003_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3003_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3003_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistMessage_3004(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3004_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3004_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3004_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistMessage_3005(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3005_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3005_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3005_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistMessage_3006(Interaction container, - Element source, Element target) { - try { - if (target == null) { - return true; - } - if (Message_3006_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - Message_3006_TargetExpression = UMLOCLFactory - .getExpression( - "((self.oclIsKindOf(uml::ExecutionSpecification) or self.oclIsKindOf(uml::Lifeline)) and (oppositeEnd.oclIsKindOf(uml::ExecutionSpecification) or oppositeEnd.oclIsKindOf(uml::Lifeline))) and (self.eContainer() = oppositeEnd.eContainer())", UMLPackage.eINSTANCE.getElement(), env); //$NON-NLS-1$ - } - Object targetVal = Message_3006_TargetExpression.evaluate( - target, Collections.singletonMap(OPPOSITE_END_VAR, - source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistElementOwnedComment_3007(Element source, - Comment target) { - try { - if (target == null) { - return true; - } - if (ElementOwnedComment_3007_TargetExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - ElementOwnedComment_3007_TargetExpression = UMLOCLFactory - .getExpression( - "not(self.annotatedElement->includes(oppositeEnd))", UMLPackage.eINSTANCE.getComment(), env); //$NON-NLS-1$ - } - Object targetVal = ElementOwnedComment_3007_TargetExpression - .evaluate(target, Collections.singletonMap( - OPPOSITE_END_VAR, source)); - if (false == targetVal instanceof Boolean - || !((Boolean) targetVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - /** - * @generated - */ - public static boolean canExistCommentAnnotatedElement_3008( - Comment source, Element target) { - try { - if (source == null) { - return true; - } - if (CommentAnnotatedElement_3008_SourceExpression == null) { - Map env = Collections.singletonMap(OPPOSITE_END_VAR, - UMLPackage.eINSTANCE.getElement()); - CommentAnnotatedElement_3008_SourceExpression = UMLOCLFactory - .getExpression( - "not(self.annotatedElement->includes(oppositeEnd))", UMLPackage.eINSTANCE.getComment(), env); //$NON-NLS-1$ - } - Object sourceVal = CommentAnnotatedElement_3008_SourceExpression - .evaluate(source, Collections.singletonMap( - OPPOSITE_END_VAR, target)); - if (false == sourceVal instanceof Boolean - || !((Boolean) sourceVal).booleanValue()) { - return false; - } // else fall-through - return true; - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Link constraint evaluation error", e); //$NON-NLS-1$ - return false; - } - } - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java deleted file mode 100644 index 5b48496d105..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextNonResizableEditPolicy.java +++ /dev/null @@ -1,219 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import java.util.Collections; -import java.util.List; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.handles.MoveHandle; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx; -import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; - -/** - * @generated - */ -public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx { - - /** - * @generated - */ - private IFigure selectionFeedbackFigure; - - /** - * @generated - */ - private IFigure focusFeedbackFigure; - - /** - * @generated - */ - @Override - protected void showPrimarySelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(true); - ((WrappingLabel) getHostFigure()).setFocus(true); - } else { - showSelection(); - showFocus(); - } - } - - /** - * @generated - */ - @Override - protected void showSelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(true); - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - hideSelection(); - addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); - refreshSelectionFeedback(); - hideFocus(); - } - } - - /** - * @generated - */ - @Override - protected void hideSelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(false); - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - if (selectionFeedbackFigure != null) { - removeFeedback(selectionFeedbackFigure); - selectionFeedbackFigure = null; - } - hideFocus(); - } - } - - /** - * @generated - */ - @Override - protected void showFocus() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setFocus(true); - } else { - hideFocus(); - addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); - refreshFocusFeedback(); - } - } - - /** - * @generated - */ - @Override - protected void hideFocus() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - if (focusFeedbackFigure != null) { - removeFeedback(focusFeedbackFigure); - focusFeedbackFigure = null; - } - } - } - - /** - * @generated - */ - protected Rectangle getFeedbackBounds() { - Rectangle bounds; - if (getHostFigure() instanceof Label) { - bounds = ((Label) getHostFigure()).getTextBounds(); - bounds.intersect(getHostFigure().getBounds()); - } else { - bounds = getHostFigure().getBounds().getCopy(); - } - getHostFigure().getParent().translateToAbsolute(bounds); - getFeedbackLayer().translateToRelative(bounds); - return bounds; - } - - /** - * @generated - */ - protected IFigure createSelectionFeedbackFigure() { - if (getHostFigure() instanceof Label) { - Label feedbackFigure = new Label(); - feedbackFigure.setOpaque(true); - feedbackFigure - .setBackgroundColor(ColorConstants.menuBackgroundSelected); - feedbackFigure - .setForegroundColor(ColorConstants.menuForegroundSelected); - return feedbackFigure; - } else { - RectangleFigure feedbackFigure = new RectangleFigure(); - feedbackFigure.setFill(false); - return feedbackFigure; - } - } - - /** - * @generated - */ - protected IFigure createFocusFeedbackFigure() { - return new Figure() { - - protected void paintFigure(Graphics graphics) { - graphics.drawFocus(getBounds().getResized(-1, -1)); - } - }; - } - - /** - * @generated - */ - protected void updateLabel(Label target) { - Label source = (Label) getHostFigure(); - target.setText(source.getText()); - target.setTextAlignment(source.getTextAlignment()); - target.setFont(source.getFont()); - } - - /** - * @generated - */ - protected void refreshSelectionFeedback() { - if (selectionFeedbackFigure != null) { - if (selectionFeedbackFigure instanceof Label) { - updateLabel((Label) selectionFeedbackFigure); - selectionFeedbackFigure.setBounds(getFeedbackBounds()); - } else { - selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, - 5)); - } - } - } - - /** - * @generated - */ - protected void refreshFocusFeedback() { - if (focusFeedbackFigure != null) { - focusFeedbackFigure.setBounds(getFeedbackBounds()); - } - } - - /** - * @generated - */ - public void refreshFeedback() { - refreshSelectionFeedback(); - refreshFocusFeedback(); - } - - /** - * @generated - */ - @Override - protected List createSelectionHandles() { - MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost()); - moveHandle.setBorder(null); - moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost())); - return Collections.singletonList(moveHandle); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java deleted file mode 100644 index e6df5781e56..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/edit/policies/UMLTextSelectionEditPolicy.java +++ /dev/null @@ -1,202 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.edit.policies; - -import org.eclipse.draw2d.ColorConstants; -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.Graphics; -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.RectangleFigure; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.editpolicies.SelectionEditPolicy; -import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel; - -/** - * @generated - */ -public class UMLTextSelectionEditPolicy extends SelectionEditPolicy { - - /** - * @generated - */ - private IFigure selectionFeedbackFigure; - - /** - * @generated - */ - private IFigure focusFeedbackFigure; - - /** - * @generated - */ - @Override - protected void showPrimarySelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(true); - ((WrappingLabel) getHostFigure()).setFocus(true); - } else { - showSelection(); - showFocus(); - } - } - - /** - * @generated - */ - @Override - protected void showSelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(true); - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - hideSelection(); - addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure()); - refreshSelectionFeedback(); - hideFocus(); - } - } - - /** - * @generated - */ - @Override - protected void hideSelection() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setSelected(false); - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - if (selectionFeedbackFigure != null) { - removeFeedback(selectionFeedbackFigure); - selectionFeedbackFigure = null; - } - hideFocus(); - } - } - - /** - * @generated - */ - @Override - protected void showFocus() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setFocus(true); - } else { - hideFocus(); - addFeedback(focusFeedbackFigure = createFocusFeedbackFigure()); - refreshFocusFeedback(); - } - } - - /** - * @generated - */ - @Override - protected void hideFocus() { - if (getHostFigure() instanceof WrappingLabel) { - ((WrappingLabel) getHostFigure()).setFocus(false); - } else { - if (focusFeedbackFigure != null) { - removeFeedback(focusFeedbackFigure); - focusFeedbackFigure = null; - } - } - } - - /** - * @generated - */ - protected Rectangle getFeedbackBounds() { - Rectangle bounds; - if (getHostFigure() instanceof Label) { - bounds = ((Label) getHostFigure()).getTextBounds(); - bounds.intersect(getHostFigure().getBounds()); - } else { - bounds = getHostFigure().getBounds().getCopy(); - } - getHostFigure().getParent().translateToAbsolute(bounds); - getFeedbackLayer().translateToRelative(bounds); - return bounds; - } - - /** - * @generated - */ - protected IFigure createSelectionFeedbackFigure() { - if (getHostFigure() instanceof Label) { - Label feedbackFigure = new Label(); - feedbackFigure.setOpaque(true); - feedbackFigure - .setBackgroundColor(ColorConstants.menuBackgroundSelected); - feedbackFigure - .setForegroundColor(ColorConstants.menuForegroundSelected); - return feedbackFigure; - } else { - RectangleFigure feedbackFigure = new RectangleFigure(); - feedbackFigure.setFill(false); - return feedbackFigure; - } - } - - /** - * @generated - */ - protected IFigure createFocusFeedbackFigure() { - return new Figure() { - - protected void paintFigure(Graphics graphics) { - graphics.drawFocus(getBounds().getResized(-1, -1)); - } - }; - } - - /** - * @generated - */ - protected void updateLabel(Label target) { - Label source = (Label) getHostFigure(); - target.setText(source.getText()); - target.setTextAlignment(source.getTextAlignment()); - target.setFont(source.getFont()); - } - - /** - * @generated - */ - protected void refreshSelectionFeedback() { - if (selectionFeedbackFigure != null) { - if (selectionFeedbackFigure instanceof Label) { - updateLabel((Label) selectionFeedbackFigure); - selectionFeedbackFigure.setBounds(getFeedbackBounds()); - } else { - selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, - 5)); - } - } - } - - /** - * @generated - */ - protected void refreshFocusFeedback() { - if (focusFeedbackFigure != null) { - focusFeedbackFigure.setBounds(getFeedbackBounds()); - } - } - - /** - * @generated - */ - public void refreshFeedback() { - refreshSelectionFeedback(); - refreshFocusFeedback(); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLAbstractExpression.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLAbstractExpression.java deleted file mode 100644 index ed9ebb0cbf5..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLAbstractExpression.java +++ /dev/null @@ -1,165 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.expressions; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Collections; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EEnumLiteral; -import org.eclipse.emf.ecore.util.EcoreUtil; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public abstract class UMLAbstractExpression { - - /** - * @generated - */ - private IStatus status = Status.OK_STATUS; - - /** - * @generated - */ - protected UMLAbstractExpression(String body, EClassifier context) { - myBody = body; - myContext = context; - } - - /** - * @generated - */ - protected void setStatus(int severity, String message, Throwable throwable) { - String pluginID = UMLDiagramEditorPlugin.ID; - this.status = new Status(severity, pluginID, -1, - (message != null) ? message : "", throwable); //$NON-NLS-1$ - if (!this.status.isOK()) { - UMLDiagramEditorPlugin - .getInstance() - .logError( - "Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - - /** - * @generated - */ - protected abstract Object doEvaluate(Object context, Map env); - - /** - * @generated - */ - public Object evaluate(Object context) { - return evaluate(context, Collections.EMPTY_MAP); - } - - /** - * @generated - */ - public Object evaluate(Object context, Map env) { - if (context().isInstance(context)) { - try { - return doEvaluate(context, env); - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Expression evaluation failure: " + body(), e);//$NON-NLS-1$ - } - } - return null; - } - - /** - * Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected - * @generated - */ - public static Object performCast(Object value, EDataType targetType) { - if (targetType instanceof EEnum) { - if (value instanceof EEnumLiteral) { - EEnumLiteral literal = (EEnumLiteral) value; - return (literal.getInstance() != null) ? literal.getInstance() - : literal; - } - } - if (false == value instanceof Number || targetType == null - || targetType.getInstanceClass() == null) { - return value; - } - Class targetClass = targetType.getInstanceClass(); - Number num = (Number) value; - Class valClass = value.getClass(); - Class targetWrapperClass = targetClass; - if (targetClass.isPrimitive()) { - targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass); - } - if (valClass.equals(targetWrapperClass)) { - return value; - } - if (Number.class.isAssignableFrom(targetWrapperClass)) { - if (targetWrapperClass.equals(Byte.class)) - return new Byte(num.byteValue()); - if (targetWrapperClass.equals(Integer.class)) - return new Integer(num.intValue()); - if (targetWrapperClass.equals(Short.class)) - return new Short(num.shortValue()); - if (targetWrapperClass.equals(Long.class)) - return new Long(num.longValue()); - if (targetWrapperClass.equals(BigInteger.class)) - return BigInteger.valueOf(num.longValue()); - if (targetWrapperClass.equals(Float.class)) - return new Float(num.floatValue()); - if (targetWrapperClass.equals(Double.class)) - return new Double(num.doubleValue()); - if (targetWrapperClass.equals(BigDecimal.class)) - return new BigDecimal(num.doubleValue()); - } - return value; - } - - /** - * @generated - */ - public IStatus getStatus() { - return status; - } - - /** - * @generated - */ - private final String myBody; - - /** - * @generated - */ - public String body() { - return myBody; - } - - /** - * @generated - */ - private final EClassifier myContext; - - /** - * @generated - */ - public EClassifier context() { - return myContext; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLOCLFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLOCLFactory.java deleted file mode 100644 index 24081025d18..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/expressions/UMLOCLFactory.java +++ /dev/null @@ -1,214 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.expressions; - -import java.lang.ref.WeakReference; -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.ocl.Environment; -import org.eclipse.ocl.EvaluationEnvironment; -import org.eclipse.ocl.ParserException; -import org.eclipse.ocl.Query; -import org.eclipse.ocl.ecore.EcoreFactory; -import org.eclipse.ocl.expressions.OCLExpression; -import org.eclipse.ocl.expressions.OperationCallExp; -import org.eclipse.ocl.expressions.Variable; -import org.eclipse.ocl.helper.OCLHelper; -import org.eclipse.ocl.utilities.AbstractVisitor; -import org.eclipse.ocl.utilities.PredefinedType; -import org.eclipse.papyrus.diagram.common.parser.lookup.OCLLookup; - - - -/** - * @generated - */ -public class UMLOCLFactory { - - /** - * @generated - */ - private UMLOCLFactory() { - } - - /** - * @generated - */ - public static UMLAbstractExpression getExpression(String body, - EClassifier context, Map environment) { - return new Expression(body, context, environment); - } - - /** - * @generated - */ - public static UMLAbstractExpression getExpression(String body, - EClassifier context) { - return getExpression(body, context, Collections.EMPTY_MAP); - } - - /** - * @generated - */ - private static class Expression extends UMLAbstractExpression { - - /** - * @generated - */ - private WeakReference queryRef; - - /** - * @generated - */ - private final org.eclipse.ocl.ecore.OCL oclInstance; - - /** - * @generated - */ - public Expression(String body, EClassifier context, Map environment) { - super(body, context); - oclInstance = org.eclipse.ocl.ecore.OCL.newInstance(); - initCustomEnv(oclInstance.getEnvironment(), environment); - } - - /** - * @generated - */ - protected Query getQuery() { - Query oclQuery = null; - if (this.queryRef != null) { - oclQuery = (Query) this.queryRef.get(); - } - if (oclQuery == null) { - OCLHelper oclHelper = oclInstance.createOCLHelper(); - oclHelper.setContext(context()); - try { - OCLExpression oclExpression = oclHelper.createQuery(body()); - oclQuery = oclInstance.createQuery(oclExpression); - this.queryRef = new WeakReference(oclQuery); - setStatus(IStatus.OK, null, null); - } catch (ParserException e) { - setStatus(IStatus.ERROR, e.getMessage(), e); - } - } - return oclQuery; - } - - /** - * @generated - */ - @Override - protected Object doEvaluate(Object context, Map env) { - Query oclQuery = getQuery(); - if (oclQuery == null) { - return null; - } - EvaluationEnvironment evalEnv = oclQuery.getEvaluationEnvironment(); - // init environment - for (Iterator it = env.entrySet().iterator(); it.hasNext();) { - Map.Entry nextEntry = (Map.Entry) it.next(); - evalEnv.replace((String) nextEntry.getKey(), nextEntry - .getValue()); - } - try { - initExtentMap(context); - Object result = oclQuery.evaluate(context); - return (result != oclInstance.getEnvironment() - .getOCLStandardLibrary().getOclInvalid()) ? result - : null; - } finally { - evalEnv.clear(); - oclQuery.getExtentMap().clear(); - } - } - - /** - * @generated - */ - private void initExtentMap(Object context) { - if (!getStatus().isOK() || context == null) { - return; - } - final Query queryToInit = getQuery(); - final Object extentContext = context; - queryToInit.getExtentMap().clear(); - if (queryToInit.queryText() != null - && queryToInit.queryText().indexOf( - PredefinedType.ALL_INSTANCES_NAME) >= 0) { - AbstractVisitor visitior = new AbstractVisitor() { - - private boolean usesAllInstances = false; - - public Object visitOperationCallExp(OperationCallExp oc) { - if (!usesAllInstances) { - usesAllInstances = PredefinedType.ALL_INSTANCES == oc - .getOperationCode(); - if (usesAllInstances) { - queryToInit - .getExtentMap() - .putAll( - oclInstance - .getEvaluationEnvironment() - .createExtentMap( - extentContext)); - } - } - return super.visitOperationCallExp(oc); - } - }; - queryToInit.getExpression().accept(visitior); - } - } - - /** - * @generated - */ - private static void initCustomEnv(Environment ecoreEnv, Map environment) { - for (Iterator it = environment.keySet().iterator(); it.hasNext();) { - String varName = (String) it.next(); - EClassifier varType = (EClassifier) environment.get(varName); - ecoreEnv.addElement(varName, createVar(ecoreEnv, varName, - varType), false); - } - } - - /** - * @generated - */ - private static Variable createVar(Environment ecoreEnv, String name, - EClassifier type) { - Variable var = EcoreFactory.eINSTANCE.createVariable(); - var.setName(name); - var.setType(ecoreEnv.getUMLReflection().getOCLType(type)); - return var; - } - } - - /** - * @generated - */ - public static OCLLookup.Expression getOCLLookupExpression(String body, - EClassifier context) { - final UMLAbstractExpression expression = getExpression(body, context); - if (!expression.getStatus().isOK()) { - throw new IllegalArgumentException("Bad OCL:" + body); - } - return new OCLLookup.Expression() { - public Object evaluate(Object context) { - return expression.evaluate(context); - } - }; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLAbstractNavigatorItem.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLAbstractNavigatorItem.java deleted file mode 100644 index 369713b8e77..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLAbstractNavigatorItem.java +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor; - -/** - * @generated - */ -public abstract class UMLAbstractNavigatorItem extends PlatformObject { - - /** - * @generated - */ - static { - final Class[] supportedTypes = new Class[] { ITabbedPropertySheetPageContributor.class }; - final ITabbedPropertySheetPageContributor propertySheetPageContributor = new ITabbedPropertySheetPageContributor() { - public String getContributorId() { - return "org.eclipse.papyrus.diagram.sequence"; //$NON-NLS-1$ - } - }; - Platform.getAdapterManager().registerAdapters( - new IAdapterFactory() { - - public Object getAdapter(Object adaptableObject, - Class adapterType) { - if (adaptableObject instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem - && adapterType == ITabbedPropertySheetPageContributor.class) { - return propertySheetPageContributor; - } - return null; - } - - public Class[] getAdapterList() { - return supportedTypes; - } - }, - org.eclipse.papyrus.diagram.sequence.navigator.UMLAbstractNavigatorItem.class); - } - - /** - * @generated - */ - private Object myParent; - - /** - * @generated - */ - protected UMLAbstractNavigatorItem(Object parent) { - myParent = parent; - } - - /** - * @generated - */ - public Object getParent() { - return myParent; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java deleted file mode 100644 index 784e7305b90..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorContentProvider.java +++ /dev/null @@ -1,244 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.navigator.ICommonContentExtensionSite; -import org.eclipse.ui.navigator.ICommonContentProvider; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLDomainNavigatorContentProvider implements - ICommonContentProvider { - - /** - * @generated - */ - private AdapterFactoryContentProvider myAdapterFctoryContentProvier; - - /** - * @generated - */ - private static final Object[] EMPTY_ARRAY = new Object[0]; - - /** - * @generated - */ - private Viewer myViewer; - - /** - * @generated - */ - private AdapterFactoryEditingDomain myEditingDomain; - - /** - * @generated - */ - private WorkspaceSynchronizer myWorkspaceSynchronizer; - - /** - * @generated - */ - private Runnable myViewerRefreshRunnable; - - /** - * @generated - */ - public UMLDomainNavigatorContentProvider() { - myAdapterFctoryContentProvier = new AdapterFactoryContentProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE - .createEditingDomain(); - myEditingDomain = (AdapterFactoryEditingDomain) editingDomain; - myEditingDomain.setResourceToReadOnlyMap(new HashMap() { - public Object get(Object key) { - if (!containsKey(key)) { - put(key, Boolean.TRUE); - } - return super.get(key); - } - }); - myViewerRefreshRunnable = new Runnable() { - public void run() { - if (myViewer != null) { - myViewer.refresh(); - } - } - }; - myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, - new WorkspaceSynchronizer.Delegate() { - public void dispose() { - } - - public boolean handleResourceChanged(final Resource resource) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - - public boolean handleResourceDeleted(Resource resource) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - - public boolean handleResourceMoved(Resource resource, - final URI newURI) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - }); - } - - /** - * @generated - */ - public void dispose() { - myWorkspaceSynchronizer.dispose(); - myWorkspaceSynchronizer = null; - myViewerRefreshRunnable = null; - for (Iterator it = myEditingDomain.getResourceSet().getResources() - .iterator(); it.hasNext();) { - Resource resource = (Resource) it.next(); - resource.unload(); - } - ((TransactionalEditingDomain) myEditingDomain).dispose(); - myEditingDomain = null; - } - - /** - * @generated - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - myViewer = viewer; - } - - /** - * @generated - */ - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - /** - * @generated - */ - public void restoreState(IMemento aMemento) { - } - - /** - * @generated - */ - public void saveState(IMemento aMemento) { - } - - /** - * @generated - */ - public void init(ICommonContentExtensionSite aConfig) { - } - - /** - * @generated - */ - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof IFile) { - IFile file = (IFile) parentElement; - URI fileURI = URI.createPlatformResourceURI(file.getFullPath() - .toString(), true); - Resource resource = myEditingDomain.getResourceSet().getResource( - fileURI, true); - return wrapEObjects(myAdapterFctoryContentProvier - .getChildren(resource), parentElement); - } - - if (parentElement instanceof UMLDomainNavigatorItem) { - return wrapEObjects(myAdapterFctoryContentProvier - .getChildren(((UMLDomainNavigatorItem) parentElement) - .getEObject()), parentElement); - } - return EMPTY_ARRAY; - } - - /** - * @generated - */ - public Object[] wrapEObjects(Object[] objects, Object parentElement) { - Collection result = new ArrayList(); - for (int i = 0; i < objects.length; i++) { - if (objects[i] instanceof EObject) { - result.add(new UMLDomainNavigatorItem((EObject) objects[i], - parentElement, myAdapterFctoryContentProvier)); - } - } - return result.toArray(); - } - - /** - * @generated - */ - public Object getParent(Object element) { - if (element instanceof UMLAbstractNavigatorItem) { - UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element; - return abstractNavigatorItem.getParent(); - } - return null; - } - - /** - * @generated - */ - public boolean hasChildren(Object element) { - return element instanceof IFile || getChildren(element).length > 0; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorItem.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorItem.java deleted file mode 100644 index 29918fe65ef..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorItem.java +++ /dev/null @@ -1,132 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.gmf.runtime.common.core.util.IAdaptableSelection; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.IPropertySourceProvider; - -/** - * @generated - */ -public class UMLDomainNavigatorItem extends PlatformObject implements - IAdaptableSelection { - - /** - * @generated - */ - static { - final Class[] supportedTypes = new Class[] { EObject.class, - IPropertySource.class }; - Platform.getAdapterManager().registerAdapters( - new IAdapterFactory() { - - public Object getAdapter(Object adaptableObject, - Class adapterType) { - if (adaptableObject instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem) { - org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem) adaptableObject; - EObject eObject = domainNavigatorItem.getEObject(); - if (adapterType == EObject.class) { - return eObject; - } - if (adapterType == IPropertySource.class) { - return domainNavigatorItem - .getPropertySourceProvider() - .getPropertySource(eObject); - } - } - - return null; - } - - public Class[] getAdapterList() { - return supportedTypes; - } - }, - org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem.class); - } - - /** - * @generated - */ - private Object myParent; - - /** - * @generated - */ - private EObject myEObject; - - /** - * @generated - */ - private IPropertySourceProvider myPropertySourceProvider; - - /** - * @generated - */ - public UMLDomainNavigatorItem(EObject eObject, Object parent, - IPropertySourceProvider propertySourceProvider) { - myParent = parent; - myEObject = eObject; - myPropertySourceProvider = propertySourceProvider; - } - - /** - * @generated - */ - public Object getParent() { - return myParent; - } - - /** - * @generated - */ - public EObject getEObject() { - return myEObject; - } - - /** - * @generated - */ - public IPropertySourceProvider getPropertySourceProvider() { - return myPropertySourceProvider; - } - - /** - * @generated - */ - @Override - public boolean equals(Object obj) { - if (obj instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem) { - return EcoreUtil - .getURI(getEObject()) - .equals( - EcoreUtil - .getURI(((org.eclipse.papyrus.diagram.sequence.navigator.UMLDomainNavigatorItem) obj) - .getEObject())); - } - return super.equals(obj); - } - - /** - * @generated - */ - @Override - public int hashCode() { - return EcoreUtil.getURI(getEObject()).hashCode(); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java deleted file mode 100644 index 90ab07e720b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLDomainNavigatorLabelProvider.java +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.navigator.ICommonContentExtensionSite; -import org.eclipse.ui.navigator.ICommonLabelProvider; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLDomainNavigatorLabelProvider implements ICommonLabelProvider { - - /** - * @generated - */ - private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - - /** - * @generated - */ - public void init(ICommonContentExtensionSite aConfig) { - } - - /** - * @generated - */ - public Image getImage(Object element) { - if (element instanceof UMLDomainNavigatorItem) { - return myAdapterFactoryLabelProvider - .getImage(((UMLDomainNavigatorItem) element).getEObject()); - } - return null; - } - - /** - * @generated - */ - public String getText(Object element) { - if (element instanceof UMLDomainNavigatorItem) { - return myAdapterFactoryLabelProvider - .getText(((UMLDomainNavigatorItem) element).getEObject()); - } - return null; - } - - /** - * @generated - */ - public void addListener(ILabelProviderListener listener) { - myAdapterFactoryLabelProvider.addListener(listener); - } - - /** - * @generated - */ - public void dispose() { - myAdapterFactoryLabelProvider.dispose(); - } - - /** - * @generated - */ - public boolean isLabelProperty(Object element, String property) { - return myAdapterFactoryLabelProvider.isLabelProperty(element, property); - } - - /** - * @generated - */ - public void removeListener(ILabelProviderListener listener) { - myAdapterFactoryLabelProvider.removeListener(listener); - } - - /** - * @generated - */ - public void restoreState(IMemento aMemento) { - } - - /** - * @generated - */ - public void saveState(IMemento aMemento) { - } - - /** - * @generated - */ - public String getDescription(Object anElement) { - return null; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorActionProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorActionProvider.java deleted file mode 100644 index 295285a198a..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorActionProvider.java +++ /dev/null @@ -1,193 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import java.util.Iterator; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.ui.URIEditorInput; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.navigator.CommonActionProvider; -import org.eclipse.ui.navigator.ICommonActionConstants; -import org.eclipse.ui.navigator.ICommonActionExtensionSite; -import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite; -import org.eclipse.ui.part.FileEditorInput; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditor; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLNavigatorActionProvider extends CommonActionProvider { - - /** - * @generated - */ - private boolean myContribute; - - /** - * @generated - */ - private OpenDiagramAction myOpenDiagramAction; - - /** - * @generated - */ - @Override - public void init(ICommonActionExtensionSite aSite) { - super.init(aSite); - if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) { - myContribute = true; - makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite()); - } else { - myContribute = false; - } - } - - /** - * @generated - */ - private void makeActions(ICommonViewerWorkbenchSite viewerSite) { - myOpenDiagramAction = new OpenDiagramAction(viewerSite); - } - - /** - * @generated - */ - @Override - public void fillActionBars(IActionBars actionBars) { - if (!myContribute) { - return; - } - IStructuredSelection selection = (IStructuredSelection) getContext() - .getSelection(); - myOpenDiagramAction.selectionChanged(selection); - if (myOpenDiagramAction.isEnabled()) { - actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, - myOpenDiagramAction); - } - } - - /** - * @generated - */ - @Override - public void fillContextMenu(IMenuManager menu) { - } - - /** - * @generated - */ - private class OpenDiagramAction extends Action { - - /** - * @generated - */ - private Diagram myDiagram; - - /** - * @generated - */ - private ICommonViewerWorkbenchSite myViewerSite; - - /** - * @generated - */ - public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) { - super(Messages.NavigatorActionProvider_OpenDiagramActionName); - myViewerSite = viewerSite; - } - - /** - * @generated - */ - public final void selectionChanged(IStructuredSelection selection) { - myDiagram = null; - if (selection.size() == 1) { - Object selectedElement = selection.getFirstElement(); - if (selectedElement instanceof UMLNavigatorItem) { - selectedElement = ((UMLNavigatorItem) selectedElement) - .getView(); - } else if (selectedElement instanceof IAdaptable) { - selectedElement = ((IAdaptable) selectedElement) - .getAdapter(View.class); - } - if (selectedElement instanceof Diagram) { - Diagram diagram = (Diagram) selectedElement; - if (PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(diagram))) { - myDiagram = diagram; - } - } - } - setEnabled(myDiagram != null); - } - - /** - * @generated - */ - @Override - public void run() { - if (myDiagram == null || myDiagram.eResource() == null) { - return; - } - - IEditorInput editorInput = getEditorInput(); - IWorkbenchPage page = myViewerSite.getPage(); - try { - page.openEditor(editorInput, UMLDiagramEditor.ID); - } catch (PartInitException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Exception while openning diagram", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - private IEditorInput getEditorInput() { - for (Iterator it = myDiagram.eResource().getContents().iterator(); it - .hasNext();) { - EObject nextEObject = (EObject) it.next(); - if (nextEObject == myDiagram) { - return new FileEditorInput(WorkspaceSynchronizer - .getFile(myDiagram.eResource())); - } - if (nextEObject instanceof Diagram) { - break; - } - } - URI uri = EcoreUtil.getURI(myDiagram); - String editorName = uri.lastSegment() - + "#" + myDiagram.eResource().getContents().indexOf(myDiagram); //$NON-NLS-1$ - IEditorInput editorInput = new URIEditorInput(uri, editorName); - return editorInput; - } - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorContentProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorContentProvider.java deleted file mode 100644 index 3101d727ca4..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorContentProvider.java +++ /dev/null @@ -1,1451 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.Edge; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.navigator.ICommonContentExtensionSite; -import org.eclipse.ui.navigator.ICommonContentProvider; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLNavigatorContentProvider implements ICommonContentProvider { - - /** - * @generated - */ - private static final Object[] EMPTY_ARRAY = new Object[0]; - - /** - * @generated - */ - private Viewer myViewer; - - /** - * @generated - */ - private AdapterFactoryEditingDomain myEditingDomain; - - /** - * @generated - */ - private WorkspaceSynchronizer myWorkspaceSynchronizer; - - /** - * @generated - */ - private Runnable myViewerRefreshRunnable; - - /** - * @generated - */ - public UMLNavigatorContentProvider() { - TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE - .createEditingDomain(); - myEditingDomain = (AdapterFactoryEditingDomain) editingDomain; - myEditingDomain.setResourceToReadOnlyMap(new HashMap() { - public Object get(Object key) { - if (!containsKey(key)) { - put(key, Boolean.TRUE); - } - return super.get(key); - } - }); - myViewerRefreshRunnable = new Runnable() { - public void run() { - if (myViewer != null) { - myViewer.refresh(); - } - } - }; - myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, - new WorkspaceSynchronizer.Delegate() { - public void dispose() { - } - - public boolean handleResourceChanged(final Resource resource) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - - public boolean handleResourceDeleted(Resource resource) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - - public boolean handleResourceMoved(Resource resource, - final URI newURI) { - for (Iterator it = myEditingDomain.getResourceSet() - .getResources().iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - nextResource.unload(); - } - if (myViewer != null) { - myViewer.getControl().getDisplay().asyncExec( - myViewerRefreshRunnable); - } - return true; - } - }); - } - - /** - * @generated - */ - public void dispose() { - myWorkspaceSynchronizer.dispose(); - myWorkspaceSynchronizer = null; - myViewerRefreshRunnable = null; - for (Iterator it = myEditingDomain.getResourceSet().getResources() - .iterator(); it.hasNext();) { - Resource resource = (Resource) it.next(); - resource.unload(); - } - ((TransactionalEditingDomain) myEditingDomain).dispose(); - myEditingDomain = null; - } - - /** - * @generated - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - myViewer = viewer; - } - - /** - * @generated - */ - public Object[] getElements(Object inputElement) { - return getChildren(inputElement); - } - - /** - * @generated - */ - public void restoreState(IMemento aMemento) { - } - - /** - * @generated - */ - public void saveState(IMemento aMemento) { - } - - /** - * @generated - */ - public void init(ICommonContentExtensionSite aConfig) { - } - - /** - * @generated - */ - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof IFile) { - IFile file = (IFile) parentElement; - URI fileURI = URI.createPlatformResourceURI(file.getFullPath() - .toString(), true); - Resource resource = myEditingDomain.getResourceSet().getResource( - fileURI, true); - Collection result = new ArrayList(); - result.addAll(createNavigatorItems(selectViewsByType(resource - .getContents(), PackageEditPart.MODEL_ID), file, false)); - return result.toArray(); - } - - if (parentElement instanceof UMLNavigatorGroup) { - UMLNavigatorGroup group = (UMLNavigatorGroup) parentElement; - return group.getChildren(); - } - - if (parentElement instanceof UMLNavigatorItem) { - UMLNavigatorItem navigatorItem = (UMLNavigatorItem) parentElement; - if (navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) { - return EMPTY_ARRAY; - } - return getViewChildren(navigatorItem.getView(), parentElement); - } - - /* - * Due to plugin.xml restrictions this code will be called only for views representing - * shortcuts to this diagram elements created on other diagrams. - */ - if (parentElement instanceof IAdaptable) { - View view = (View) ((IAdaptable) parentElement) - .getAdapter(View.class); - if (view != null) { - return getViewChildren(view, parentElement); - } - } - - return EMPTY_ARRAY; - } - - /** - * @generated - */ - private Object[] getViewChildren(View view, Object parentElement) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - - case PackageEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - result.addAll(getForeignShortcuts((Diagram) view, parentElement)); - UMLNavigatorGroup links = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Package_79_links, - "icons/linksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getChildrenByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getChildrenByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - MessageEditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - Message2EditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - Message3EditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - Message4EditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - Message5EditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - Message6EditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - connectedViews = getDiagramLinksByType(Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - links - .addChildren(createNavigatorItems(connectedViews, links, - false)); - if (!links.isEmpty()) { - result.add(links); - } - return result.toArray(); - } - - case InteractionEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Interaction_1001_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Interaction_1001_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getChildrenByType(Collections - .singleton(view), - InteractionInteractionCompartmentEditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - Interaction2EditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getChildrenByType(Collections.singleton(view), - InteractionInteractionCompartmentEditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - LifelineEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getChildrenByType(Collections.singleton(view), - InteractionInteractionCompartmentEditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - CombinedFragmentEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case CommentEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Comment_2005_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Comment_2005_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getIncomingLinksByType(Collections - .singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case Interaction2EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Interaction_2001_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Interaction_2001_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getChildrenByType(Collections - .singleton(view), - InteractionInteractionCompartment2EditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - Interaction2EditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getChildrenByType(Collections.singleton(view), - InteractionInteractionCompartment2EditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - LifelineEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getChildrenByType(Collections.singleton(view), - InteractionInteractionCompartment2EditPart.VISUAL_ID); - connectedViews = getChildrenByType(connectedViews, - CombinedFragmentEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case LifelineEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Lifeline_2002_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Lifeline_2002_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getChildrenByType(Collections - .singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - result.addAll(createNavigatorItems(connectedViews, parentElement, - false)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_BehaviorExecutionSpecification_2003_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_BehaviorExecutionSpecification_2003_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getIncomingLinksByType(Collections - .singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case CombinedFragmentEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup incominglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_CombinedFragment_2004_incominglinks, - "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup outgoinglinks = new UMLNavigatorGroup( - Messages.NavigatorGroupName_CombinedFragment_2004_outgoinglinks, - "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getIncomingLinksByType(Collections - .singleton(view), MessageEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), MessageEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message2EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message3EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message4EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message5EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), Message6EditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getOutgoingLinksByType( - Collections.singleton(view), - ElementOwnedCommentEditPart.VISUAL_ID); - outgoinglinks.addChildren(createNavigatorItems(connectedViews, - outgoinglinks, true)); - connectedViews = getIncomingLinksByType( - Collections.singleton(view), - CommentAnnotatedElementEditPart.VISUAL_ID); - incominglinks.addChildren(createNavigatorItems(connectedViews, - incominglinks, true)); - if (!incominglinks.isEmpty()) { - result.add(incominglinks); - } - if (!outgoinglinks.isEmpty()) { - result.add(outgoinglinks); - } - return result.toArray(); - } - - case MessageEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3001_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3001_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case Message2EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3002_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3002_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case Message3EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3003_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3003_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case Message4EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3004_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3004_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case Message5EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3005_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3005_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case Message6EditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3006_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_Message_3006_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case ElementOwnedCommentEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_ElementOwnedComment_3007_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_ElementOwnedComment_3007_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - InteractionEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - - case CommentAnnotatedElementEditPart.VISUAL_ID: { - Collection result = new ArrayList(); - UMLNavigatorGroup target = new UMLNavigatorGroup( - Messages.NavigatorGroupName_CommentAnnotatedElement_3008_target, - "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - UMLNavigatorGroup source = new UMLNavigatorGroup( - Messages.NavigatorGroupName_CommentAnnotatedElement_3008_source, - "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$ - Collection connectedViews = getLinksTargetByType(Collections - .singleton(view), InteractionEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - Interaction2EditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - LifelineEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - BehaviorExecutionSpecificationEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksTargetByType(Collections.singleton(view), - CombinedFragmentEditPart.VISUAL_ID); - target.addChildren(createNavigatorItems(connectedViews, target, - true)); - connectedViews = getLinksSourceByType(Collections.singleton(view), - CommentEditPart.VISUAL_ID); - source.addChildren(createNavigatorItems(connectedViews, source, - true)); - if (!target.isEmpty()) { - result.add(target); - } - if (!source.isEmpty()) { - result.add(source); - } - return result.toArray(); - } - } - return EMPTY_ARRAY; - } - - /** - * @generated - */ - private Collection getLinksSourceByType(Collection edges, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = edges.iterator(); it.hasNext();) { - Edge nextEdge = (Edge) it.next(); - View nextEdgeSource = nextEdge.getSource(); - if (type.equals(nextEdgeSource.getType()) - && isOwnView(nextEdgeSource)) { - result.add(nextEdgeSource); - } - } - return result; - } - - /** - * @generated - */ - private Collection getLinksTargetByType(Collection edges, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = edges.iterator(); it.hasNext();) { - Edge nextEdge = (Edge) it.next(); - View nextEdgeTarget = nextEdge.getTarget(); - if (type.equals(nextEdgeTarget.getType()) - && isOwnView(nextEdgeTarget)) { - result.add(nextEdgeTarget); - } - } - return result; - } - - /** - * @generated - */ - private Collection getOutgoingLinksByType(Collection nodes, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = nodes.iterator(); it.hasNext();) { - View nextNode = (View) it.next(); - result.addAll(selectViewsByType(nextNode.getSourceEdges(), type)); - } - return result; - } - - /** - * @generated - */ - private Collection getIncomingLinksByType(Collection nodes, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = nodes.iterator(); it.hasNext();) { - View nextNode = (View) it.next(); - result.addAll(selectViewsByType(nextNode.getTargetEdges(), type)); - } - return result; - } - - /** - * @generated - */ - private Collection getChildrenByType(Collection nodes, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = nodes.iterator(); it.hasNext();) { - View nextNode = (View) it.next(); - result.addAll(selectViewsByType(nextNode.getChildren(), type)); - } - return result; - } - - /** - * @generated - */ - private Collection getDiagramLinksByType(Collection diagrams, int visualID) { - Collection result = new ArrayList(); - String type = UMLVisualIDRegistry.getType(visualID); - for (Iterator it = diagrams.iterator(); it.hasNext();) { - Diagram nextDiagram = (Diagram) it.next(); - result.addAll(selectViewsByType(nextDiagram.getEdges(), type)); - } - return result; - } - - /** - * @generated - */ - private Collection selectViewsByType(Collection views, String type) { - Collection result = new ArrayList(); - for (Iterator it = views.iterator(); it.hasNext();) { - View nextView = (View) it.next(); - if (type.equals(nextView.getType()) && isOwnView(nextView)) { - result.add(nextView); - } - } - return result; - } - - /** - * @generated - */ - private boolean isOwnView(View view) { - return PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(view)); - } - - /** - * @generated - */ - private Collection createNavigatorItems(Collection views, Object parent, - boolean isLeafs) { - Collection result = new ArrayList(); - for (Iterator it = views.iterator(); it.hasNext();) { - result.add(new UMLNavigatorItem((View) it.next(), parent, isLeafs)); - } - return result; - } - - /** - * @generated - */ - private Collection getForeignShortcuts(Diagram diagram, Object parent) { - Collection result = new ArrayList(); - for (Iterator it = diagram.getChildren().iterator(); it.hasNext();) { - View nextView = (View) it.next(); - if (!isOwnView(nextView) - && nextView.getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ - result.add(nextView); - } - } - return createNavigatorItems(result, parent, false); - } - - /** - * @generated - */ - public Object getParent(Object element) { - if (element instanceof UMLAbstractNavigatorItem) { - UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) element; - return abstractNavigatorItem.getParent(); - } - return null; - } - - /** - * @generated - */ - public boolean hasChildren(Object element) { - return element instanceof IFile || getChildren(element).length > 0; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorGroup.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorGroup.java deleted file mode 100644 index 04aa4d1a644..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorGroup.java +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import java.util.Collection; -import java.util.LinkedList; - -/** - * @generated - */ -public class UMLNavigatorGroup extends UMLAbstractNavigatorItem { - - /** - * @generated - */ - private String myGroupName; - - /** - * @generated - */ - private String myIcon; - - /** - * @generated - */ - private Collection myChildren = new LinkedList(); - - /** - * @generated - */ - UMLNavigatorGroup(String groupName, String icon, Object parent) { - super(parent); - myGroupName = groupName; - myIcon = icon; - } - - /** - * @generated - */ - public String getGroupName() { - return myGroupName; - } - - /** - * @generated - */ - public String getIcon() { - return myIcon; - } - - /** - * @generated - */ - public Object[] getChildren() { - return myChildren.toArray(); - } - - /** - * @generated - */ - public void addChildren(Collection children) { - myChildren.addAll(children); - } - - /** - * @generated - */ - public void addChild(Object child) { - myChildren.add(child); - } - - /** - * @generated - */ - public boolean isEmpty() { - return myChildren.size() == 0; - } - - /** - * @generated - */ - @Override - public boolean equals(Object obj) { - if (obj instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorGroup) { - org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorGroup anotherGroup = (org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorGroup) obj; - if (getGroupName().equals(anotherGroup.getGroupName())) { - return getParent().equals(anotherGroup.getParent()); - } - } - return super.equals(obj); - } - - /** - * @generated - */ - @Override - public int hashCode() { - return getGroupName().hashCode(); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorItem.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorItem.java deleted file mode 100644 index f9fa1b2a1fa..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorItem.java +++ /dev/null @@ -1,108 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.gmf.runtime.common.core.util.IAdaptableSelection; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class UMLNavigatorItem extends UMLAbstractNavigatorItem implements - IAdaptableSelection { - - /** - * @generated - */ - static { - final Class[] supportedTypes = new Class[] { View.class, EObject.class }; - Platform.getAdapterManager().registerAdapters( - new IAdapterFactory() { - - public Object getAdapter(Object adaptableObject, - Class adapterType) { - if (adaptableObject instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem - && (adapterType == View.class || adapterType == EObject.class)) { - return ((org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem) adaptableObject) - .getView(); - } - return null; - } - - public Class[] getAdapterList() { - return supportedTypes; - } - }, - org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem.class); - } - - /** - * @generated - */ - private View myView; - - /** - * @generated - */ - private boolean myLeaf = false; - - /** - * @generated - */ - public UMLNavigatorItem(View view, Object parent, boolean isLeaf) { - super(parent); - myView = view; - myLeaf = isLeaf; - } - - /** - * @generated - */ - public View getView() { - return myView; - } - - /** - * @generated - */ - public boolean isLeaf() { - return myLeaf; - } - - /** - * @generated - */ - @Override - public boolean equals(Object obj) { - if (obj instanceof org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem) { - return EcoreUtil - .getURI(getView()) - .equals( - EcoreUtil - .getURI(((org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem) obj) - .getView())); - } - return super.equals(obj); - } - - /** - * @generated - */ - @Override - public int hashCode() { - return EcoreUtil.getURI(getView()).hashCode(); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLabelProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLabelProvider.java deleted file mode 100644 index 3c17d9d4e47..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLabelProvider.java +++ /dev/null @@ -1,595 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.viewers.ITreePathLabelProvider; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.ViewerLabel; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.IMemento; -import org.eclipse.ui.navigator.ICommonContentExtensionSite; -import org.eclipse.ui.navigator.ICommonLabelProvider; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.Package; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.providers.UMLParserProvider; - -/** - * @generated - */ -public class UMLNavigatorLabelProvider extends LabelProvider implements - ICommonLabelProvider, ITreePathLabelProvider { - - /** - * @generated - */ - static { - UMLDiagramEditorPlugin - .getInstance() - .getImageRegistry() - .put( - "Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ - UMLDiagramEditorPlugin - .getInstance() - .getImageRegistry() - .put( - "Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$ - } - - /** - * @generated - */ - public void updateLabel(ViewerLabel label, TreePath elementPath) { - Object element = elementPath.getLastSegment(); - if (element instanceof UMLNavigatorItem - && !isOwnView(((UMLNavigatorItem) element).getView())) { - return; - } - label.setText(getText(element)); - label.setImage(getImage(element)); - } - - /** - * @generated - */ - @Override - public Image getImage(Object element) { - if (element instanceof UMLNavigatorGroup) { - UMLNavigatorGroup group = (UMLNavigatorGroup) element; - return UMLDiagramEditorPlugin.getInstance().getBundledImage( - group.getIcon()); - } - - if (element instanceof UMLNavigatorItem) { - UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element; - if (!isOwnView(navigatorItem.getView())) { - return super.getImage(element); - } - return getImage(navigatorItem.getView()); - } - - // Due to plugin.xml content will be called only for "own" views - if (element instanceof IAdaptable) { - View view = (View) ((IAdaptable) element).getAdapter(View.class); - if (view != null && isOwnView(view)) { - return getImage(view); - } - } - - return super.getImage(element); - } - - /** - * @generated - */ - public Image getImage(View view) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - case PackageEditPart.VISUAL_ID: - return getImage( - "Navigator?Diagram?http://www.eclipse.org/uml2/2.1.0/UML?Package", UMLElementTypes.Package_79); //$NON-NLS-1$ - case InteractionEditPart.VISUAL_ID: - return getImage( - "Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.1.0/UML?Interaction", UMLElementTypes.Interaction_1001); //$NON-NLS-1$ - case CommentEditPart.VISUAL_ID: - return getImage( - "Navigator?TopLevelNode?http://www.eclipse.org/uml2/2.1.0/UML?Comment", UMLElementTypes.Comment_2005); //$NON-NLS-1$ - case Interaction2EditPart.VISUAL_ID: - return getImage( - "Navigator?Node?http://www.eclipse.org/uml2/2.1.0/UML?Interaction", UMLElementTypes.Interaction_2001); //$NON-NLS-1$ - case LifelineEditPart.VISUAL_ID: - return getImage( - "Navigator?Node?http://www.eclipse.org/uml2/2.1.0/UML?Lifeline", UMLElementTypes.Lifeline_2002); //$NON-NLS-1$ - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return getImage( - "Navigator?Node?http://www.eclipse.org/uml2/2.1.0/UML?BehaviorExecutionSpecification", UMLElementTypes.BehaviorExecutionSpecification_2003); //$NON-NLS-1$ - case CombinedFragmentEditPart.VISUAL_ID: - return getImage( - "Navigator?Node?http://www.eclipse.org/uml2/2.1.0/UML?CombinedFragment", UMLElementTypes.CombinedFragment_2004); //$NON-NLS-1$ - case MessageEditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3001); //$NON-NLS-1$ - case Message2EditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3002); //$NON-NLS-1$ - case Message3EditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3003); //$NON-NLS-1$ - case Message4EditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3004); //$NON-NLS-1$ - case Message5EditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3005); //$NON-NLS-1$ - case Message6EditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Message", UMLElementTypes.Message_3006); //$NON-NLS-1$ - case ElementOwnedCommentEditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Element?ownedComment", UMLElementTypes.ElementOwnedComment_3007); //$NON-NLS-1$ - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getImage( - "Navigator?Link?http://www.eclipse.org/uml2/2.1.0/UML?Comment?annotatedElement", UMLElementTypes.CommentAnnotatedElement_3008); //$NON-NLS-1$ - } - return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$ - } - - /** - * @generated - */ - private Image getImage(String key, IElementType elementType) { - ImageRegistry imageRegistry = UMLDiagramEditorPlugin.getInstance() - .getImageRegistry(); - Image image = imageRegistry.get(key); - if (image == null && elementType != null - && UMLElementTypes.isKnownElementType(elementType)) { - image = UMLElementTypes.getImage(elementType); - imageRegistry.put(key, image); - } - - if (image == null) { - image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$ - imageRegistry.put(key, image); - } - return image; - } - - /** - * @generated - */ - @Override - public String getText(Object element) { - if (element instanceof UMLNavigatorGroup) { - UMLNavigatorGroup group = (UMLNavigatorGroup) element; - return group.getGroupName(); - } - - if (element instanceof UMLNavigatorItem) { - UMLNavigatorItem navigatorItem = (UMLNavigatorItem) element; - if (!isOwnView(navigatorItem.getView())) { - return null; - } - return getText(navigatorItem.getView()); - } - - // Due to plugin.xml content will be called only for "own" views - if (element instanceof IAdaptable) { - View view = (View) ((IAdaptable) element).getAdapter(View.class); - if (view != null && isOwnView(view)) { - return getText(view); - } - } - - return super.getText(element); - } - - /** - * @generated - */ - public String getText(View view) { - if (view.getElement() != null && view.getElement().eIsProxy()) { - return getUnresolvedDomainElementProxyText(view); - } - switch (UMLVisualIDRegistry.getVisualID(view)) { - case PackageEditPart.VISUAL_ID: - return getPackage_79Text(view); - case InteractionEditPart.VISUAL_ID: - return getInteraction_1001Text(view); - case CommentEditPart.VISUAL_ID: - return getComment_2005Text(view); - case Interaction2EditPart.VISUAL_ID: - return getInteraction_2001Text(view); - case LifelineEditPart.VISUAL_ID: - return getLifeline_2002Text(view); - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return getBehaviorExecutionSpecification_2003Text(view); - case CombinedFragmentEditPart.VISUAL_ID: - return getCombinedFragment_2004Text(view); - case MessageEditPart.VISUAL_ID: - return getMessage_3001Text(view); - case Message2EditPart.VISUAL_ID: - return getMessage_3002Text(view); - case Message3EditPart.VISUAL_ID: - return getMessage_3003Text(view); - case Message4EditPart.VISUAL_ID: - return getMessage_3004Text(view); - case Message5EditPart.VISUAL_ID: - return getMessage_3005Text(view); - case Message6EditPart.VISUAL_ID: - return getMessage_3006Text(view); - case ElementOwnedCommentEditPart.VISUAL_ID: - return getElementOwnedComment_3007Text(view); - case CommentAnnotatedElementEditPart.VISUAL_ID: - return getCommentAnnotatedElement_3008Text(view); - } - return getUnknownElementText(view); - } - - /** - * @generated - */ - private String getPackage_79Text(View view) { - Package domainModelElement = (Package) view.getElement(); - if (domainModelElement != null) { - return String.valueOf(domainModelElement.getName()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "No domain element for view with visualID = " + 79); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - } - - /** - * @generated - */ - private String getInteraction_1001Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Interaction_1001, - (view.getElement() != null ? view.getElement() : view), - UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4004); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getInteraction_2001Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Interaction_2001, - (view.getElement() != null ? view.getElement() : view), - UMLVisualIDRegistry.getType(InteractionName2EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4003); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getLifeline_2002Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Lifeline_2002, - (view.getElement() != null ? view.getElement() : view), - UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4001); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getBehaviorExecutionSpecification_2003Text(View view) { - BehaviorExecutionSpecification domainModelElement = (BehaviorExecutionSpecification) view - .getElement(); - if (domainModelElement != null) { - return String.valueOf(domainModelElement.getName()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "No domain element for view with visualID = " + 2003); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - } - - /** - * @generated - */ - private String getCombinedFragment_2004Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.CombinedFragment_2004, - (view.getElement() != null ? view.getElement() : view), - UMLVisualIDRegistry - .getType(CombinedFragmentInteractionOperatorEditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4002); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getComment_2005Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Comment_2005, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(CommentBodyEditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 5003); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3001Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3001, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageNameEditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4005); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3002Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3002, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageName2EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4006); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3003Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3003, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageName3EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4007); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3004Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3004, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageName4EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4008); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3005Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3005, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageName5EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4009); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getMessage_3006Text(View view) { - IAdaptable hintAdapter = new UMLParserProvider.HintAdapter( - UMLElementTypes.Message_3006, (view.getElement() != null ? view - .getElement() : view), UMLVisualIDRegistry - .getType(MessageName6EditPart.VISUAL_ID)); - IParser parser = ParserService.getInstance().getParser(hintAdapter); - - if (parser != null) { - return parser.getPrintString(hintAdapter, ParserOptions.NONE - .intValue()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Parser was not found for label " + 4010); //$NON-NLS-1$ - return ""; //$NON-NLS-1$ - } - - } - - /** - * @generated - */ - private String getElementOwnedComment_3007Text(View view) { - return ""; //$NON-NLS-1$ - } - - /** - * @generated - */ - private String getCommentAnnotatedElement_3008Text(View view) { - return ""; //$NON-NLS-1$ - } - - /** - * @generated - */ - private String getUnknownElementText(View view) { - return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * @generated - */ - private String getUnresolvedDomainElementProxyText(View view) { - return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * @generated - */ - public void init(ICommonContentExtensionSite aConfig) { - } - - /** - * @generated - */ - public void restoreState(IMemento aMemento) { - } - - /** - * @generated - */ - public void saveState(IMemento aMemento) { - } - - /** - * @generated - */ - public String getDescription(Object anElement) { - return null; - } - - /** - * @generated - */ - private boolean isOwnView(View view) { - return PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(view)); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLinkHelper.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLinkHelper.java deleted file mode 100644 index bacf6a63223..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorLinkHelper.java +++ /dev/null @@ -1,150 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.ui.URIEditorInput; -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.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gef.EditPart; -import org.eclipse.gef.GraphicalViewer; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.navigator.ILinkHelper; -import org.eclipse.ui.part.FileEditorInput; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLNavigatorLinkHelper implements ILinkHelper { - - /** - * @generated - */ - private static IEditorInput getEditorInput(Diagram diagram) { - Resource diagramResource = diagram.eResource(); - for (Iterator it = diagramResource.getContents().iterator(); it - .hasNext();) { - EObject nextEObject = (EObject) it.next(); - if (nextEObject == diagram) { - return new FileEditorInput(WorkspaceSynchronizer - .getFile(diagramResource)); - } - if (nextEObject instanceof Diagram) { - break; - } - } - URI uri = EcoreUtil.getURI(diagram); - String editorName = uri.lastSegment() - + "#" + diagram.eResource().getContents().indexOf(diagram); //$NON-NLS-1$ - IEditorInput editorInput = new URIEditorInput(uri, editorName); - return editorInput; - } - - /** - * @generated - */ - public IStructuredSelection findSelection(IEditorInput anInput) { - IDiagramDocument document = UMLDiagramEditorPlugin.getInstance() - .getDocumentProvider(getEditingDomainID(), anInput) - .getDiagramDocument(anInput); - if (document == null) { - return StructuredSelection.EMPTY; - } - Diagram diagram = document.getDiagram(); - IFile file = WorkspaceSynchronizer.getFile(diagram.eResource()); - if (file != null) { - UMLNavigatorItem item = new UMLNavigatorItem(diagram, file, false); - return new StructuredSelection(item); - } - return StructuredSelection.EMPTY; - } - - /** - * @generated - */ - public void activateEditor(IWorkbenchPage aPage, - IStructuredSelection aSelection) { - if (aSelection == null || aSelection.isEmpty()) { - return; - } - if (false == aSelection.getFirstElement() instanceof UMLAbstractNavigatorItem) { - return; - } - - UMLAbstractNavigatorItem abstractNavigatorItem = (UMLAbstractNavigatorItem) aSelection - .getFirstElement(); - View navigatorView = null; - if (abstractNavigatorItem instanceof UMLNavigatorItem) { - navigatorView = ((UMLNavigatorItem) abstractNavigatorItem) - .getView(); - } else if (abstractNavigatorItem instanceof UMLNavigatorGroup) { - UMLNavigatorGroup navigatorGroup = (UMLNavigatorGroup) abstractNavigatorItem; - if (navigatorGroup.getParent() instanceof UMLNavigatorItem) { - navigatorView = ((UMLNavigatorItem) navigatorGroup.getParent()) - .getView(); - } else if (navigatorGroup.getParent() instanceof IAdaptable) { - navigatorView = (View) ((IAdaptable) navigatorGroup.getParent()) - .getAdapter(View.class); - } - } - if (navigatorView == null) { - return; - } - IEditorInput editorInput = getEditorInput(navigatorView.getDiagram()); - IEditorPart editor = aPage.findEditor(editorInput); - if (editor == null) { - return; - } - aPage.bringToTop(editor); - if (editor instanceof DiagramEditor) { - DiagramEditor diagramEditor = (DiagramEditor) editor; - ResourceSet diagramEditorResourceSet = diagramEditor - .getEditingDomain().getResourceSet(); - EObject selectedView = diagramEditorResourceSet.getEObject( - EcoreUtil.getURI(navigatorView), true); - if (selectedView == null) { - return; - } - GraphicalViewer graphicalViewer = (GraphicalViewer) diagramEditor - .getAdapter(GraphicalViewer.class); - EditPart selectedEditPart = (EditPart) graphicalViewer - .getEditPartRegistry().get(selectedView); - if (selectedEditPart != null) { - graphicalViewer.select(selectedEditPart); - } - } - } - - /** - * @generated - */ - protected String getEditingDomainID() { - return "es.cv.gvcase.mdt.uml2.diagram.SharedEditingDomainID"; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorSorter.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorSorter.java deleted file mode 100644 index 0a9a1e04f90..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/navigator/UMLNavigatorSorter.java +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.navigator; - -import org.eclipse.jface.viewers.ViewerSorter; - -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLNavigatorSorter extends ViewerSorter { - - /** - * @generated - */ - private static final int GROUP_CATEGORY = 5004; - - /** - * @generated - */ - private static final int SHORTCUTS_CATEGORY = 5003; - - /** - * @generated - */ - @Override - public int category(Object element) { - if (element instanceof UMLNavigatorItem) { - UMLNavigatorItem item = (UMLNavigatorItem) element; - if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ - return SHORTCUTS_CATEGORY; - } - return UMLVisualIDRegistry.getVisualID(item.getView()); - } - return GROUP_CATEGORY; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/AbstractParser.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/AbstractParser.java deleted file mode 100644 index 0b2deba8d8e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/AbstractParser.java +++ /dev/null @@ -1,452 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.parsers; - -import java.util.Arrays; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EEnumLiteral; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; -import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand; -import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.osgi.util.NLS; - -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public abstract class AbstractParser implements IParser { - - /** - * @generated - */ - protected final EAttribute[] features; - - /** - * @generated - */ - private String viewPattern; - - /** - * @generated - */ - private String editorPattern; - - /** - * @generated - */ - private String editPattern; - - /** - * @generated - */ - public AbstractParser(EAttribute[] features) { - if (features == null || Arrays.asList(features).contains(null)) { - throw new IllegalArgumentException(); - } - this.features = features; - } - - /** - * @generated - */ - public String getViewPattern() { - return viewPattern; - } - - /** - * @generated - */ - public void setViewPattern(String viewPattern) { - this.viewPattern = viewPattern; - } - - /** - * @generated - */ - public String getEditorPattern() { - return editorPattern; - } - - /** - * @generated - */ - public void setEditorPattern(String editorPattern) { - this.editorPattern = editorPattern; - } - - /** - * @generated - */ - public String getEditPattern() { - return editPattern; - } - - /** - * @generated - */ - public void setEditPattern(String editPattern) { - this.editPattern = editPattern; - } - - /** - * @generated - */ - public boolean isAffectingEvent(Object event, int flags) { - if (event instanceof Notification) { - return isAffectingFeature(((Notification) event).getFeature()); - } - return false; - } - - /** - * @generated - */ - protected boolean isAffectingFeature(Object feature) { - for (int i = 0; i < features.length; i++) { - if (features[i] == feature) { - return true; - } - } - return false; - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor(IAdaptable element) { - return null; - } - - /** - * @generated - */ - protected Object[] getValues(EObject element) { - Object[] values = new Object[features.length]; - for (int i = 0; i < features.length; i++) { - values[i] = getValue(element, features[i]); - } - return values; - } - - /** - * @generated - */ - protected Object getValue(EObject element, EAttribute feature) { - Object value = element.eGet(feature); - Class iClass = feature.getEAttributeType().getInstanceClass(); - if (String.class.equals(iClass)) { - if (value == null) { - value = ""; //$NON-NLS-1$ - } - } - return value; - } - - /** - * @generated - */ - protected ICommand getParseCommand(IAdaptable adapter, Object[] values, - int flags) { - if (values == null - || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) { - return UnexecutableCommand.INSTANCE; - } - EObject element = (EObject) adapter.getAdapter(EObject.class); - TransactionalEditingDomain editingDomain = TransactionUtil - .getEditingDomain(element); - if (editingDomain == null) { - return UnexecutableCommand.INSTANCE; - } - CompositeTransactionalCommand command = new CompositeTransactionalCommand( - editingDomain, "Set Values"); //$NON-NLS-1$ - for (int i = 0; i < values.length; i++) { - command.compose(getModificationCommand(element, features[i], - values[i])); - } - return command; - } - - /** - * @generated - */ - protected ICommand getModificationCommand(EObject element, - EAttribute feature, Object value) { - value = getValidNewValue(feature, value); - if (value instanceof InvalidValue) { - return UnexecutableCommand.INSTANCE; - } - SetRequest request = new SetRequest(element, feature, value); - return new SetValueCommand(request); - } - - /** - * @generated - */ - protected IParserEditStatus validateNewValues(Object[] values) { - if (values.length != features.length) { - return ParserEditStatus.UNEDITABLE_STATUS; - } - for (int i = 0; i < values.length; i++) { - Object value = getValidNewValue(features[i], values[i]); - if (value instanceof InvalidValue) { - return new ParserEditStatus(UMLDiagramEditorPlugin.ID, - IParserEditStatus.UNEDITABLE, value.toString()); - } - } - return ParserEditStatus.EDITABLE_STATUS; - } - - /** - * @generated - */ - protected Object getValidNewValue(EAttribute feature, Object value) { - EClassifier type = feature.getEType(); - if (type instanceof EDataType) { - Class iClass = type.getInstanceClass(); - if (Boolean.TYPE.equals(iClass)) { - if (value instanceof Boolean) { - // ok - } else if (value instanceof String) { - value = Boolean.valueOf((String) value); - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Character.TYPE.equals(iClass)) { - if (value instanceof Character) { - // ok - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - value = new Character(s.charAt(0)); - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Byte.TYPE.equals(iClass)) { - if (value instanceof Byte) { - // ok - } else if (value instanceof Number) { - value = new Byte(((Number) value).byteValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Byte.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Short.TYPE.equals(iClass)) { - if (value instanceof Short) { - // ok - } else if (value instanceof Number) { - value = new Short(((Number) value).shortValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Short.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Integer.TYPE.equals(iClass)) { - if (value instanceof Integer) { - // ok - } else if (value instanceof Number) { - value = new Integer(((Number) value).intValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Integer.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Long.TYPE.equals(iClass)) { - if (value instanceof Long) { - // ok - } else if (value instanceof Number) { - value = new Long(((Number) value).longValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Long.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Float.TYPE.equals(iClass)) { - if (value instanceof Float) { - // ok - } else if (value instanceof Number) { - value = new Float(((Number) value).floatValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Float.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (Double.TYPE.equals(iClass)) { - if (value instanceof Double) { - // ok - } else if (value instanceof Number) { - value = new Double(((Number) value).doubleValue()); - } else if (value instanceof String) { - String s = (String) value; - if (s.length() == 0) { - value = null; - } else { - try { - value = Double.valueOf(s); - } catch (NumberFormatException nfe) { - value = new InvalidValue( - NLS - .bind( - Messages.AbstractParser_WrongStringConversionMessage, - iClass.getName())); - } - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - iClass.getName())); - } - } else if (type instanceof EEnum) { - if (value instanceof String) { - EEnumLiteral literal = ((EEnum) type) - .getEEnumLiteralByLiteral((String) value); - if (literal == null) { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnknownLiteralMessage, - value)); - } else { - value = literal.getInstance(); - } - } else { - value = new InvalidValue(NLS.bind( - Messages.AbstractParser_UnexpectedValueTypeMessage, - String.class.getName())); - } - } - } - return value; - } - - /** - * @generated - */ - protected class InvalidValue { - - /** - * @generated - */ - private String description; - - /** - * @generated - */ - public InvalidValue(String description) { - this.description = description; - } - - /** - * @generated - */ - @Override - public String toString() { - return description; - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/CompositeParser.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/CompositeParser.java deleted file mode 100644 index 54d459c49cf..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/CompositeParser.java +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.parsers; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; - -/** - * @generated - */ -public class CompositeParser implements IParser { - - /** - * @generated - */ - private final IParser reader; - - /** - * @generated - */ - private final IParser writer; - - /** - * @generated - */ - public CompositeParser(IParser reader, IParser writer) { - this.reader = reader; - this.writer = writer; - } - - /** - * @generated - */ - public boolean isAffectingEvent(Object event, int flags) { - return reader.isAffectingEvent(event, flags); - } - - /** - * @generated - */ - public String getPrintString(IAdaptable adapter, int flags) { - return reader.getPrintString(adapter, flags); - } - - /** - * @generated - */ - public String getEditString(IAdaptable adapter, int flags) { - return reader.getEditString(adapter, flags); - } - - /** - * @generated - */ - public IParserEditStatus isValidEditString(IAdaptable adapter, - String editString) { - return writer.isValidEditString(adapter, editString); - } - - /** - * @generated - */ - public ICommand getParseCommand(IAdaptable adapter, String newString, - int flags) { - return writer.getParseCommand(adapter, newString, flags); - } - - /** - * @generated - */ - public IContentAssistProcessor getCompletionProcessor(IAdaptable adapter) { - return writer.getCompletionProcessor(adapter); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/MessageFormatParser.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/MessageFormatParser.java deleted file mode 100644 index 49b20b5a72f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/parsers/MessageFormatParser.java +++ /dev/null @@ -1,227 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.parsers; - -import java.text.FieldPosition; -import java.text.MessageFormat; -import java.text.ParsePosition; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus; -import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus; -import org.eclipse.osgi.util.NLS; - -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class MessageFormatParser extends AbstractParser { - - /** - * @generated - */ - private String defaultPattern; - - /** - * @generated - */ - private MessageFormat viewProcessor; - - /** - * @generated - */ - private MessageFormat editorProcessor; - - /** - * @generated - */ - private MessageFormat editProcessor; - - /** - * @generated - */ - public MessageFormatParser(EAttribute[] features) { - super(features); - } - - /** - * @generated - */ - protected String getDefaultPattern() { - if (defaultPattern == null) { - StringBuffer sb = new StringBuffer(); - for (int i = 0; i < features.length; i++) { - if (i > 0) { - sb.append(' '); - } - sb.append('{'); - sb.append(i); - sb.append('}'); - } - defaultPattern = sb.toString(); - } - return defaultPattern; - } - - /** - * @generated - */ - @Override - public String getViewPattern() { - String pattern = super.getViewPattern(); - return pattern != null ? pattern : getDefaultPattern(); - } - - /** - * @generated - */ - @Override - public void setViewPattern(String viewPattern) { - super.setViewPattern(viewPattern); - viewProcessor = null; - } - - /** - * @generated - */ - protected MessageFormat createViewProcessor(String viewPattern) { - return new MessageFormat(viewPattern); - } - - /** - * @generated - */ - protected MessageFormat getViewProcessor() { - if (viewProcessor == null) { - viewProcessor = createViewProcessor(getViewPattern()); - } - return viewProcessor; - } - - /** - * @generated - */ - @Override - public String getEditorPattern() { - String pattern = super.getEditorPattern(); - return pattern != null ? pattern : getDefaultPattern(); - } - - /** - * @generated - */ - @Override - public void setEditorPattern(String editorPattern) { - super.setEditorPattern(editorPattern); - editorProcessor = null; - } - - /** - * @generated - */ - protected MessageFormat createEditorProcessor(String editorPattern) { - return new MessageFormat(editorPattern); - } - - /** - * @generated - */ - protected MessageFormat getEditorProcessor() { - if (editorProcessor == null) { - editorProcessor = createEditorProcessor(getEditorPattern()); - } - return editorProcessor; - } - - /** - * @generated - */ - @Override - public String getEditPattern() { - String pattern = super.getEditPattern(); - return pattern != null ? pattern : getDefaultPattern(); - } - - /** - * @generated - */ - @Override - public void setEditPattern(String editPattern) { - super.setEditPattern(editPattern); - editProcessor = null; - } - - /** - * @generated - */ - protected MessageFormat createEditProcessor(String editPattern) { - return new MessageFormat(editPattern); - } - - /** - * @generated - */ - protected MessageFormat getEditProcessor() { - if (editProcessor == null) { - editProcessor = createEditProcessor(getEditPattern()); - } - return editProcessor; - } - - /** - * @generated - */ - public String getPrintString(IAdaptable adapter, int flags) { - EObject element = (EObject) adapter.getAdapter(EObject.class); - return getViewProcessor().format(getValues(element), - new StringBuffer(), new FieldPosition(0)).toString(); - } - - /** - * @generated - */ - public String getEditString(IAdaptable adapter, int flags) { - EObject element = (EObject) adapter.getAdapter(EObject.class); - return getEditorProcessor().format(getValues(element), - new StringBuffer(), new FieldPosition(0)).toString(); - } - - /** - * @generated - */ - public IParserEditStatus isValidEditString(IAdaptable adapter, - String editString) { - ParsePosition pos = new ParsePosition(0); - Object[] values = getEditProcessor().parse(editString, pos); - if (values == null) { - return new ParserEditStatus(UMLDiagramEditorPlugin.ID, - IParserEditStatus.UNEDITABLE, NLS.bind( - Messages.MessageFormatParser_InvalidInputError, - new Integer(pos.getErrorIndex()))); - } - return validateNewValues(values); - } - - /** - * @generated - */ - public ICommand getParseCommand(IAdaptable adapter, String newString, - int flags) { - Object[] values = getEditProcessor().parse(newString, - new ParsePosition(0)); - return getParseCommand(adapter, values, flags); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DeleteElementAction.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DeleteElementAction.java deleted file mode 100644 index 351dfdd4332..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DeleteElementAction.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.commands.Command; -import org.eclipse.gef.commands.UnexecutableCommand; -import org.eclipse.gmf.runtime.diagram.ui.actions.AbstractDeleteFromAction; -import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds; -import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; -import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages; -import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; - -/** - * @generated - */ - -public class DeleteElementAction extends AbstractDeleteFromAction { - - /** - * @generated - */ - public DeleteElementAction(IWorkbenchPart part) { - super(part); - } - - /** - * @generated - */ - public DeleteElementAction(IWorkbenchPage workbenchPage) { - super(workbenchPage); - } - - /** - * @generated - */ - @Override - public void init() { - super.init(); - setId(ActionIds.ACTION_DELETE_FROM_MODEL); - setText(DiagramUIMessages.DiagramEditor_Delete_from_Model); - setToolTipText(DiagramUIMessages.DiagramEditor_Delete_from_ModelToolTip); - ISharedImages workbenchImages = PlatformUI.getWorkbench() - .getSharedImages(); - setHoverImageDescriptor(workbenchImages - .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); - setImageDescriptor(workbenchImages - .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); - setDisabledImageDescriptor(workbenchImages - .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); - } - - /** - * @generated - */ - @Override - protected String getCommandLabel() { - return DiagramUIMessages.DiagramEditor_Delete_from_Model; - } - - /** - * @generated - */ - @Override - protected Command getCommand(Request request) { - List operationSet = getOperationSet(); - if (operationSet.isEmpty()) { - return UnexecutableCommand.INSTANCE; - } - Iterator editParts = operationSet.iterator(); - CompositeTransactionalCommand command = new CompositeTransactionalCommand( - getEditingDomain(), getCommandLabel()); - while (editParts.hasNext()) { - EditPart editPart = (EditPart) editParts.next(); - Command curCommand = editPart.getCommand(request); - if (curCommand != null) { - command.compose(new CommandProxy(curCommand)); - } - } - if (command.isEmpty() || command.size() != operationSet.size()) { - return UnexecutableCommand.INSTANCE; - } - return new ICommandProxy(command); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DiagramEditorContextMenuProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DiagramEditorContextMenuProvider.java deleted file mode 100644 index 47c2ff74940..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/DiagramEditorContextMenuProvider.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService; -import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds; -import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.ui.IWorkbenchPart; - -/** - * @generated - */ - -public class DiagramEditorContextMenuProvider extends - DiagramContextMenuProvider { - - /** - * @generated - */ - private IWorkbenchPart part; - - /** - * @generated - */ - private DeleteElementAction deleteAction; - - /** - * @generated - */ - public DiagramEditorContextMenuProvider(IWorkbenchPart part, - EditPartViewer viewer) { - super(part, viewer); - this.part = part; - deleteAction = new DeleteElementAction(part); - deleteAction.init(); - } - - /** - * @generated - */ - @Override - public void dispose() { - if (deleteAction != null) { - deleteAction.dispose(); - deleteAction = null; - } - super.dispose(); - } - - /** - * @generated - */ - @Override - public void buildContextMenu(final IMenuManager menu) { - getViewer().flush(); - try { - TransactionUtil.getEditingDomain( - (EObject) getViewer().getContents().getModel()) - .runExclusive(new Runnable() { - - public void run() { - ContributionItemService - .getInstance() - .contributeToPopupMenu( - DiagramEditorContextMenuProvider.this, - part); - menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL); - menu.appendToGroup("editGroup", deleteAction); - } - }); - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Error building context menu", e); - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/Messages.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/Messages.java deleted file mode 100644 index ab1ca4437c1..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/Messages.java +++ /dev/null @@ -1,584 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.osgi.util.NLS; - -/** - * @generated - */ -public class Messages extends NLS { - - /** - * @generated - */ - static { - NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$ - } - - /** - * @generated - */ - private Messages() { - } - - /** - * @generated - */ - public static String UMLCreationWizardTitle; - - /** - * @generated - */ - public static String UMLCreationWizard_DiagramModelFilePageTitle; - - /** - * @generated - */ - public static String UMLCreationWizard_DiagramModelFilePageDescription; - - /** - * @generated - */ - public static String UMLCreationWizard_DomainModelFilePageTitle; - - /** - * @generated - */ - public static String UMLCreationWizard_DomainModelFilePageDescription; - - /** - * @generated - */ - public static String UMLCreationWizardOpenEditorError; - - /** - * @generated - */ - public static String UMLCreationWizardCreationError; - - /** - * @generated - */ - public static String UMLCreationWizardPageExtensionError; - - /** - * @generated - */ - public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle; - - /** - * @generated - */ - public static String UMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage; - - /** - * @generated - */ - public static String UMLDiagramEditorUtil_CreateDiagramProgressTask; - - /** - * @generated - */ - public static String UMLDiagramEditorUtil_CreateDiagramCommandLabel; - - /** - * @generated - */ - public static String UMLDocumentProvider_isModifiable; - - /** - * @generated - */ - public static String UMLDocumentProvider_handleElementContentChanged; - - /** - * @generated - */ - public static String UMLDocumentProvider_IncorrectInputError; - - /** - * @generated - */ - public static String UMLDocumentProvider_NoDiagramInResourceError; - - /** - * @generated - */ - public static String UMLDocumentProvider_DiagramLoadingError; - - /** - * @generated - */ - public static String UMLDocumentProvider_UnsynchronizedFileSaveError; - - /** - * @generated - */ - public static String UMLDocumentProvider_SaveDiagramTask; - - /** - * @generated - */ - public static String UMLDocumentProvider_SaveNextResourceTask; - - /** - * @generated - */ - public static String UMLDocumentProvider_SaveAsOperation; - - /** - * @generated - */ - public static String UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle; - - /** - * @generated - */ - public static String UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage; - - /** - * @generated - */ - public static String UMLInitDiagramFileAction_InitDiagramFileWizardTitle; - - /** - * @generated - */ - public static String UMLInitDiagramFileAction_OpenModelFileDialogTitle; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_CreationPageName; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_CreationPageTitle; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_CreationPageDescription; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageName; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageTitle; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageDescription; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_InitDiagramCommand; - - /** - * @generated - */ - public static String UMLNewDiagramFileWizard_IncorrectRootError; - - /** - * @generated - */ - public static String UMLDiagramEditor_SavingDeletedFile; - - /** - * @generated - */ - public static String UMLDiagramEditor_SaveAsErrorTitle; - - /** - * @generated - */ - public static String UMLDiagramEditor_SaveAsErrorMessage; - - /** - * @generated - */ - public static String UMLDiagramEditor_SaveErrorTitle; - - /** - * @generated - */ - public static String UMLDiagramEditor_SaveErrorMessage; - - /** - * @generated - */ - public static String UMLElementChooserDialog_SelectModelElementTitle; - - /** - * @generated - */ - public static String ModelElementSelectionPageMessage; - - /** - * @generated - */ - public static String ValidateActionMessage; - - /** - * @generated - */ - public static String Interaction1Group_title; - - /** - * @generated - */ - public static String Interaction1Group_desc; - - /** - * @generated - */ - public static String Objects2Group_title; - - /** - * @generated - */ - public static String Objects2Group_desc; - - /** - * @generated - */ - public static String Messages3Group_title; - - /** - * @generated - */ - public static String Comments4Group_title; - - /** - * @generated - */ - public static String Interaction1CreationTool_title; - - /** - * @generated - */ - public static String Interaction1CreationTool_desc; - - /** - * @generated - */ - public static String Lifeline1CreationTool_title; - - /** - * @generated - */ - public static String Lifeline1CreationTool_desc; - - /** - * @generated - */ - public static String ExecutionBehaviour2CreationTool_title; - - /** - * @generated - */ - public static String ExecutionBehaviour2CreationTool_desc; - - /** - * @generated - */ - public static String CombinedFragment3CreationTool_title; - - /** - * @generated - */ - public static String CombinedFragment3CreationTool_desc; - - /** - * @generated - */ - public static String Callsynch1CreationTool_title; - - /** - * @generated - */ - public static String Callsynch1CreationTool_desc; - - /** - * @generated - */ - public static String Callasynch2CreationTool_title; - - /** - * @generated - */ - public static String Callasynch2CreationTool_desc; - - /** - * @generated - */ - public static String Reply3CreationTool_title; - - /** - * @generated - */ - public static String Reply3CreationTool_desc; - - /** - * @generated - */ - public static String SendSignal5CreationTool_title; - - /** - * @generated - */ - public static String CreationEvent6CreationTool_title; - - /** - * @generated - */ - public static String DestructionEvent7CreationTool_title; - - /** - * @generated - */ - public static String Comment1CreationTool_title; - - /** - * @generated - */ - public static String Comment1CreationTool_desc; - - /** - * @generated - */ - public static String CommentLink2CreationTool_title; - - /** - * @generated - */ - public static String CommentLink2CreationTool_desc; - - /** - * @generated - */ - public static String InteractionInteractionCompartmentEditPart_title; - - /** - * @generated - */ - public static String InteractionInteractionCompartment2EditPart_title; - - /** - * @generated - */ - public static String CommandName_OpenDiagram; - - /** - * @generated - */ - public static String NavigatorGroupName_Package_79_links; - - /** - * @generated - */ - public static String NavigatorGroupName_Interaction_1001_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Interaction_1001_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Interaction_2001_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Interaction_2001_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Lifeline_2002_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Lifeline_2002_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_BehaviorExecutionSpecification_2003_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_BehaviorExecutionSpecification_2003_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_CombinedFragment_2004_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_CombinedFragment_2004_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Comment_2005_incominglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Comment_2005_outgoinglinks; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3001_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3001_source; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3002_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3002_source; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3003_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3003_source; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3004_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3004_source; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3005_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3005_source; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3006_target; - - /** - * @generated - */ - public static String NavigatorGroupName_Message_3006_source; - - /** - * @generated - */ - public static String NavigatorGroupName_ElementOwnedComment_3007_target; - - /** - * @generated - */ - public static String NavigatorGroupName_ElementOwnedComment_3007_source; - - /** - * @generated - */ - public static String NavigatorGroupName_CommentAnnotatedElement_3008_target; - - /** - * @generated - */ - public static String NavigatorGroupName_CommentAnnotatedElement_3008_source; - - /** - * @generated - */ - public static String NavigatorActionProvider_OpenDiagramActionName; - - /** - * @generated - */ - public static String AbstractParser_UnexpectedValueTypeMessage; - - /** - * @generated - */ - public static String AbstractParser_WrongStringConversionMessage; - - /** - * @generated - */ - public static String AbstractParser_UnknownLiteralMessage; - - /** - * @generated - */ - public static String MessageFormatParser_InvalidInputError; - - /** - * @generated - */ - public static String UMLModelingAssistantProviderTitle; - - /** - * @generated - */ - public static String UMLModelingAssistantProviderMessage; - - // TODO: put accessor fields manually -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ModelElementSelectionPage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ModelElementSelectionPage.java deleted file mode 100644 index c109bd07523..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ModelElementSelectionPage.java +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.edit.provider.IWrapperItemProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; - -import org.eclipse.papyrus.diagram.common.dialogs.IWizardModelElementProvider; - -/** - * Wizard page that allows to select element from model. - * - * @generated - */ -public class ModelElementSelectionPage extends WizardPage implements - IWizardModelElementProvider { - - /** - * @generated - */ - protected EObject selectedModelElement; - - /** - * @generated - */ - private TreeViewer modelVewer; - - /** - * @generated - */ - public ModelElementSelectionPage(String pageName) { - super(pageName); - } - - /** - * @generated - */ - public EObject getModelElement() { - return selectedModelElement; - } - - /** - * @generated - */ - public void setModelElement(EObject modelElement) { - selectedModelElement = modelElement; - if (modelVewer != null) { - if (selectedModelElement != null) { - modelVewer.setInput(selectedModelElement.eResource()); - modelVewer.setSelection(new StructuredSelection( - selectedModelElement)); - } else { - modelVewer.setInput(null); - } - setPageComplete(validatePage()); - } - } - - /** - * @generated - */ - public void createControl(Composite parent) { - initializeDialogUnits(parent); - - Composite plate = new Composite(parent, SWT.NONE); - plate.setLayoutData(new GridData(GridData.FILL_BOTH)); - GridLayout layout = new GridLayout(); - layout.marginWidth = 0; - plate.setLayout(layout); - setControl(plate); - - Label label = new Label(plate, SWT.NONE); - label.setText(getSelectionTitle()); - label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); - - modelVewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL - | SWT.V_SCROLL | SWT.BORDER); - GridData layoutData = new GridData(GridData.FILL_BOTH); - layoutData.heightHint = 300; - layoutData.widthHint = 300; - modelVewer.getTree().setLayoutData(layoutData); - modelVewer.setContentProvider(new AdapterFactoryContentProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory())); - modelVewer.setLabelProvider(new AdapterFactoryLabelProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory())); - if (selectedModelElement != null) { - modelVewer.setInput(selectedModelElement.eResource()); - modelVewer.setSelection(new StructuredSelection( - selectedModelElement)); - } - modelVewer.addSelectionChangedListener(new ISelectionChangedListener() { - - public void selectionChanged(SelectionChangedEvent event) { - ModelElementSelectionPage.this - .updateSelection((IStructuredSelection) event - .getSelection()); - } - }); - - setPageComplete(validatePage()); - } - - /** - * Override to provide custom model element description. - * - * @generated - */ - protected String getSelectionTitle() { - return Messages.ModelElementSelectionPageMessage; - } - - /** - * @generated - */ - protected void updateSelection(IStructuredSelection selection) { - selectedModelElement = null; - if (selection.size() == 1) { - Object selectedElement = selection.getFirstElement(); - if (selectedElement instanceof IWrapperItemProvider) { - selectedElement = ((IWrapperItemProvider) selectedElement) - .getValue(); - } - if (selectedElement instanceof FeatureMap.Entry) { - selectedElement = ((FeatureMap.Entry) selectedElement) - .getValue(); - } - if (selectedElement instanceof EObject) { - selectedModelElement = (EObject) selectedElement; - } - } - setPageComplete(validatePage()); - } - - /** - * Override to provide specific validation of the selected model element. - * - * @generated - */ - protected boolean validatePage() { - return true; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/SequenceDiagramEditorFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/SequenceDiagramEditorFactory.java deleted file mode 100644 index daad99e0f58..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/SequenceDiagramEditorFactory.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat - * de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.papyrus.core.adaptor.gmf.GmfEditorFactory; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * A factory for creating SequenceDiagramEditor objects. - */ -public class SequenceDiagramEditorFactory extends GmfEditorFactory { - - /** - * Instantiates a new sequence diagram editor factory. - */ - public SequenceDiagramEditorFactory() { - super(UMLSequenceDiagramForMultiEditor.class, PackageEditPart.MODEL_ID); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreateShortcutAction.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreateShortcutAction.java deleted file mode 100644 index 550739c32e3..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreateShortcutAction.java +++ /dev/null @@ -1,139 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.command.ICommand; -import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand; -import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.sequence.edit.commands.UMLCreateShortcutDecorationsCommand; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLCreateShortcutAction implements IObjectActionDelegate { - - /** - * @generated - */ - private GraphicalEditPart mySelectedElement; - - /** - * @generated - */ - private Shell myShell; - - /** - * @generated - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - myShell = targetPart.getSite().getShell(); - } - - /** - * @generated - */ - public void selectionChanged(IAction action, ISelection selection) { - mySelectedElement = null; - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - if (structuredSelection.size() == 1) { - if (structuredSelection.getFirstElement() instanceof PackageEditPart) { - mySelectedElement = (PackageEditPart) structuredSelection - .getFirstElement(); - } - if (structuredSelection.getFirstElement() instanceof InteractionInteractionCompartmentEditPart) { - mySelectedElement = (InteractionInteractionCompartmentEditPart) structuredSelection - .getFirstElement(); - } - if (structuredSelection.getFirstElement() instanceof InteractionInteractionCompartment2EditPart) { - mySelectedElement = (InteractionInteractionCompartment2EditPart) structuredSelection - .getFirstElement(); - } - } - } - action.setEnabled(isEnabled()); - } - - /** - * @generated - */ - private boolean isEnabled() { - return mySelectedElement != null; - } - - /** - * @generated - */ - public void run(IAction action) { - final View view = (View) mySelectedElement.getModel(); - UMLElementChooserDialog elementChooser = new UMLElementChooserDialog( - myShell, view); - int result = elementChooser.open(); - if (result != Window.OK) { - return; - } - URI selectedModelElementURI = elementChooser - .getSelectedModelElementURI(); - final EObject selectedElement; - try { - selectedElement = mySelectedElement.getEditingDomain() - .getResourceSet().getEObject(selectedModelElementURI, true); - } catch (WrappedException e) { - UMLDiagramEditorPlugin - .getInstance() - .logError( - "Exception while loading object: " + selectedModelElementURI.toString(), e); //$NON-NLS-1$ - return; - } - - if (selectedElement == null) { - return; - } - CreateViewRequest.ViewDescriptor viewDescriptor = new CreateViewRequest.ViewDescriptor( - new EObjectAdapter(selectedElement), Node.class, null, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - ICommand command = new CreateCommand(mySelectedElement - .getEditingDomain(), viewDescriptor, view); - command = command.compose(new UMLCreateShortcutDecorationsCommand( - mySelectedElement.getEditingDomain(), view, viewDescriptor)); - try { - OperationHistoryFactory.getOperationHistory().execute(command, - new NullProgressMonitor(), null); - DiagramEditPartsUtil.updateDiagram(mySelectedElement); - } catch (ExecutionException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to create shortcut", e); //$NON-NLS-1$ - } - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizard.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizard.java deleted file mode 100644 index 67c063e22e0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizard.java +++ /dev/null @@ -1,172 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.lang.reflect.InvocationTargetException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/** - * @generated - */ -public class UMLCreationWizard extends Wizard implements INewWizard { - - /** - * @generated - */ - private IWorkbench workbench; - - /** - * @generated - */ - protected IStructuredSelection selection; - - /** - * @generated - */ - protected UMLCreationWizardPage diagramModelFilePage; - - /** - * @generated - */ - protected UMLCreationWizardPage domainModelFilePage; - - /** - * @generated - */ - protected Resource diagram; - - /** - * @generated - */ - private boolean openNewlyCreatedDiagramEditor = true; - - /** - * @generated - */ - public IWorkbench getWorkbench() { - return workbench; - } - - /** - * @generated - */ - public IStructuredSelection getSelection() { - return selection; - } - - /** - * @generated - */ - public final Resource getDiagram() { - return diagram; - } - - /** - * @generated - */ - public final boolean isOpenNewlyCreatedDiagramEditor() { - return openNewlyCreatedDiagramEditor; - } - - /** - * @generated - */ - public void setOpenNewlyCreatedDiagramEditor( - boolean openNewlyCreatedDiagramEditor) { - this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor; - } - - /** - * @generated - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(Messages.UMLCreationWizardTitle); - setDefaultPageImageDescriptor(UMLDiagramEditorPlugin - .getBundledImageDescriptor("icons/wizban/NewUMLWizard.gif")); //$NON-NLS-1$ - setNeedsProgressMonitor(true); - } - - /** - * @generated - */ - @Override - public void addPages() { - diagramModelFilePage = new UMLCreationWizardPage( - "DiagramModelFile", getSelection(), "sequenceuml_diagram"); //$NON-NLS-1$ //$NON-NLS-2$ - diagramModelFilePage - .setTitle(Messages.UMLCreationWizard_DiagramModelFilePageTitle); - diagramModelFilePage - .setDescription(Messages.UMLCreationWizard_DiagramModelFilePageDescription); - addPage(diagramModelFilePage); - - domainModelFilePage = new UMLCreationWizardPage( - "DomainModelFile", getSelection(), "uml"); //$NON-NLS-1$ //$NON-NLS-2$ - domainModelFilePage - .setTitle(Messages.UMLCreationWizard_DomainModelFilePageTitle); - domainModelFilePage - .setDescription(Messages.UMLCreationWizard_DomainModelFilePageDescription); - addPage(domainModelFilePage); - } - - /** - * @generated - */ - @Override - public boolean performFinish() { - IRunnableWithProgress op = new WorkspaceModifyOperation(null) { - - protected void execute(IProgressMonitor monitor) - throws CoreException, InterruptedException { - diagram = UMLDiagramEditorUtil.createDiagram( - diagramModelFilePage.getURI(), domainModelFilePage - .getURI(), monitor); - if (isOpenNewlyCreatedDiagramEditor() && diagram != null) { - try { - UMLDiagramEditorUtil.openDiagram(diagram); - } catch (PartInitException e) { - ErrorDialog.openError(getContainer().getShell(), - Messages.UMLCreationWizardOpenEditorError, - null, e.getStatus()); - } - } - } - }; - try { - getContainer().run(false, true, op); - } catch (InterruptedException e) { - return false; - } catch (InvocationTargetException e) { - if (e.getTargetException() instanceof CoreException) { - ErrorDialog.openError(getContainer().getShell(), - Messages.UMLCreationWizardCreationError, null, - ((CoreException) e.getTargetException()).getStatus()); - } else { - UMLDiagramEditorPlugin.getInstance().logError( - "Error creating diagram", e.getTargetException()); //$NON-NLS-1$ - } - return false; - } - return diagram != null; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizardPage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizardPage.java deleted file mode 100644 index cbe292a43b7..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLCreationWizardPage.java +++ /dev/null @@ -1,133 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -/** - * @generated - */ -public class UMLCreationWizardPage extends WizardNewFileCreationPage { - - /** - * @generated - */ - private final String fileExtension; - - /** - * @generated - */ - public UMLCreationWizardPage(String pageName, - IStructuredSelection selection, String fileExtension) { - super(pageName, selection); - this.fileExtension = fileExtension; - } - - /** - * Override to create files with this extension. - * - * @generated - */ - protected String getExtension() { - return fileExtension; - } - - /** - * @generated - */ - public URI getURI() { - return URI.createPlatformResourceURI(getFilePath().toString(), false); - } - - /** - * @generated - */ - protected IPath getFilePath() { - IPath path = getContainerFullPath(); - if (path == null) { - path = new Path(""); //$NON-NLS-1$ - } - String fileName = getFileName(); - if (fileName != null) { - path = path.append(fileName); - } - return path; - } - - /** - * @generated - */ - @Override - public void createControl(Composite parent) { - super.createControl(parent); - setFileName(UMLDiagramEditorUtil.getUniqueFileName( - getContainerFullPath(), getFileName(), getExtension())); - setPageComplete(validatePage()); - } - - /** - * @generated - */ - @Override - protected boolean validatePage() { - if (!super.validatePage()) { - return false; - } - String extension = getExtension(); - if (extension != null - && !getFilePath().toString().endsWith("." + extension)) { - setErrorMessage(NLS.bind( - Messages.UMLCreationWizardPageExtensionError, extension)); - return false; - } - return true; - } - - /** - * @generated - */ - /** - * #174315 Automatically set diagram file extension - * @generated - */ - @Override - public IWizardPage getNextPage() { - IWizardPage nextPage = super.getNextPage(); - if ("DiagramModelFile".equals(getName()) - && "DomainModelFile".equals(nextPage.getName())) { - setDomainFileName(nextPage); - } - return nextPage; - } - - /** - * #174315 Automatically set diagram file extension - * @generated - */ - protected void setDomainFileName(IWizardPage nextPage) { - UMLCreationWizardPage nextWizardPage = (UMLCreationWizardPage) nextPage; - String fileName = getFileName(); - String extension = getExtension(); - if (fileName.endsWith(extension)) { - fileName = fileName.substring(0, fileName.length() - - extension.length()); - } - fileName += nextWizardPage.getExtension(); - nextWizardPage.setFileName(fileName); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramActionBarContributor.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramActionBarContributor.java deleted file mode 100644 index 9d8fb4c217c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramActionBarContributor.java +++ /dev/null @@ -1,35 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor; - -/** - * @generated - */ -public class UMLDiagramActionBarContributor extends DiagramActionBarContributor { - - /** - * @generated - */ - @Override - protected Class getEditorClass() { - return UMLDiagramEditor.class; - } - - /** - * @generated - */ - @Override - protected String getEditorId() { - return UMLDiagramEditor.ID; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditor.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditor.java deleted file mode 100644 index f2dc132164a..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditor.java +++ /dev/null @@ -1,494 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.ui.URIEditorInput; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.transaction.ResourceSetListener; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gef.palette.PaletteEntry; -import org.eclipse.gef.palette.PaletteRoot; -import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramDropTargetListener; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider; -import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteService; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IMessageProvider; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.util.LocalSelectionTransfer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.dnd.TransferData; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorMatchingStrategy; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IFileEditorInput; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.navigator.resources.ProjectExplorer; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.IShowInTargetList; -import org.eclipse.ui.part.ShowInContext; - -import org.eclipse.papyrus.diagram.common.Activator; -import org.eclipse.papyrus.diagram.common.part.CachedResourcesDiagramEditor; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.common.ids.UMLDiagramEditorIDs; -import org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorItem; - -/** - * @generated - */ -public class UMLDiagramEditor extends CachedResourcesDiagramEditor implements - IGotoMarker { - - /** - * @generated NOT - */ - public static final String ID = "org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorID"; //$NON-NLS-1$ - - /** - * @generated - */ - public static final String CONTEXT_ID = "org.eclipse.papyrus.diagram.sequence.ui.diagramContext"; //$NON-NLS-1$ - - /** - * @generated - */ - public UMLDiagramEditor() { - super(true); - } - - /** - * @generated - */ - @Override - protected String getContextID() { - return CONTEXT_ID; - } - - /** - * @generated - */ - @Override - protected String getEditingDomainID() { - return "org.eclipse.uml2.diagram.clazz.EditingDomain"; - } - - /** - * @generated - */ - @Override - protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) { - PaletteRoot root = super.createPaletteRoot(existingPaletteRoot); - new UMLPaletteFactory().fillPalette(root); - return root; - } - - /** - * @generated - */ - @Override - protected PreferencesHint getPreferencesHint() { - return UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT; - } - - /** - * @generated - */ - @Override - public String getEditorID() { - return ID; - } - - /** - * @generated - */ - @Override - public String getContributorId() { - return "org.eclipse.papyrustabs"; - } - - /** - * @generated - */ - @Override - public Object getAdapter(Class type) { - if (type == IShowInTargetList.class) { - return new IShowInTargetList() { - public String[] getShowInTargetIds() { - return new String[] { ProjectExplorer.VIEW_ID }; - } - }; - } - return super.getAdapter(type); - } - - /** - * @generated - */ - @Override - protected IDocumentProvider getDocumentProvider(IEditorInput input) { - if (input instanceof IFileEditorInput - || input instanceof URIEditorInput) { - - return UMLDiagramEditorPlugin.getInstance().getDocumentProvider( - getEditingDomainID(), input); - } - return super.getDocumentProvider(input); - } - - /** - * @generated - */ - @Override - public TransactionalEditingDomain getEditingDomain() { - IDocument document = getEditorInput() != null ? getDocumentProvider() - .getDocument(getEditorInput()) : null; - if (document instanceof IDiagramDocument) { - return ((IDiagramDocument) document).getEditingDomain(); - } - return super.getEditingDomain(); - } - - /** - * @generated - */ - @Override - protected void setDocumentProvider(IEditorInput input) { - if (input instanceof IFileEditorInput - || input instanceof URIEditorInput) { - - setDocumentProvider(UMLDiagramEditorPlugin.getInstance() - .getDocumentProvider(getEditingDomainID(), input)); - } else { - super.setDocumentProvider(input); - } - } - - /** - * @generated - */ - public void gotoMarker(IMarker marker) { - MarkerNavigationService.getInstance().gotoMarker(this, marker); - } - - /** - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * @generated - */ - @Override - public void doSaveAs() { - performSaveAs(new NullProgressMonitor()); - } - - /** - * @generated - */ - @Override - protected void performSaveAs(IProgressMonitor progressMonitor) { - Shell shell = getSite().getShell(); - IEditorInput input = getEditorInput(); - SaveAsDialog dialog = new SaveAsDialog(shell); - IFile original = input instanceof IFileEditorInput ? ((IFileEditorInput) input) - .getFile() - : null; - // Store the editor ID that opens this diagram file. - String editorID = null; - if (original != null) { - dialog.setOriginalFile(original); - // Get the editor ID that opens the diagram file. - try { - editorID = original - .getPersistentProperty(org.eclipse.ui.ide.IDE.EDITOR_KEY); - } catch (CoreException ex) { - editorID = null; - } - } - dialog.create(); - IDocumentProvider provider = getDocumentProvider(); - if (provider == null) { - // editor has been programmatically closed while the dialog was open - return; - } - if (provider.isDeleted(input) && original != null) { - String message = NLS.bind( - Messages.UMLDiagramEditor_SavingDeletedFile, original - .getName()); - dialog.setErrorMessage(null); - dialog.setMessage(message, IMessageProvider.WARNING); - } - if (dialog.open() == Window.CANCEL) { - if (progressMonitor != null) { - progressMonitor.setCanceled(true); - } - return; - } - IPath filePath = dialog.getResult(); - if (filePath == null) { - if (progressMonitor != null) { - progressMonitor.setCanceled(true); - } - return; - } - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - IFile file = workspaceRoot.getFile(filePath); - final IEditorInput newInput = new FileEditorInput(file); - // Check if the editor is already open - IEditorMatchingStrategy matchingStrategy = getEditorDescriptor() - .getEditorMatchingStrategy(); - IEditorReference[] editorRefs = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage() - .getEditorReferences(); - for (int i = 0; i < editorRefs.length; i++) { - if (matchingStrategy.matches(editorRefs[i], newInput)) { - MessageDialog.openWarning(shell, - Messages.UMLDiagramEditor_SaveAsErrorTitle, - Messages.UMLDiagramEditor_SaveAsErrorMessage); - return; - } - } - boolean success = false; - try { - provider.aboutToChange(newInput); - getDocumentProvider(newInput).saveDocument(progressMonitor, - newInput, - getDocumentProvider().getDocument(getEditorInput()), true); - success = true; - } catch (CoreException x) { - IStatus status = x.getStatus(); - if (status == null || status.getSeverity() != IStatus.CANCEL) { - ErrorDialog.openError(shell, - Messages.UMLDiagramEditor_SaveErrorTitle, - Messages.UMLDiagramEditor_SaveErrorMessage, x - .getStatus()); - } - } finally { - provider.changed(newInput); - if (success) { - setInput(newInput); - // everything went OK, set the editorID that opens the diagram - // file - if (editorID != null) { - URI uri = URI.createURI(filePath.toString()); - try { - MultiDiagramUtil.setEditorForDiagram(uri, editorID); - } catch (CoreException ex) { - IStatus status = new Status(IStatus.ERROR, "org.eclipse.papyrus.diagram.sequence", "Error setting file property"); - Activator.getDefault().getLog().log(status); - } - } - } - } - if (progressMonitor != null) { - progressMonitor.setCanceled(!success); - } - } - - /** - * @generated - */ - @Override - public ShowInContext getShowInContext() { - return new ShowInContext(getEditorInput(), getNavigatorSelection()); - } - - /** - * @generated - */ - private ISelection getNavigatorSelection() { - IDiagramDocument document = getDiagramDocument(); - if (document == null) { - return StructuredSelection.EMPTY; - } - Diagram diagram = document.getDiagram(); - IFile file = WorkspaceSynchronizer.getFile(diagram.eResource()); - if (file != null) { - UMLNavigatorItem item = new UMLNavigatorItem(diagram, file, false); - return new StructuredSelection(item); - } - return StructuredSelection.EMPTY; - } - - /* Propiedad para almacenar al escuchador */ - private ResourceSetListener myResourceSetListener; - - /** - * @generated - */ - @Override - protected void initializeGraphicalViewer() { - super.initializeGraphicalViewer(); - getDiagramGraphicalViewer().addDropTargetListener( - new DropTargetListener(getDiagramGraphicalViewer(), - LocalSelectionTransfer.getTransfer()) { - - protected Object getJavaObject(TransferData data) { - return LocalSelectionTransfer.getTransfer() - .nativeToJava(data); - } - - }); - getDiagramGraphicalViewer().addDropTargetListener( - new DropTargetListener(getDiagramGraphicalViewer(), - LocalTransfer.getInstance()) { - - protected Object getJavaObject(TransferData data) { - return LocalTransfer.getInstance().nativeToJava(data); - } - - }); - } - - /** - * @generated - */ - private abstract class DropTargetListener extends DiagramDropTargetListener { - - /** - * @generated - */ - public DropTargetListener(EditPartViewer viewer, Transfer xfer) { - super(viewer, xfer); - } - - /** - * @generated - */ - @Override - protected List getObjectsBeingDropped() { - TransferData data = getCurrentEvent().currentDataType; - Collection uris = new HashSet(); - - Object transferedObject = getJavaObject(data); - if (transferedObject instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) transferedObject; - for (Iterator it = selection.iterator(); it.hasNext();) { - Object nextSelectedObject = it.next(); - if (nextSelectedObject instanceof UMLNavigatorItem) { - View view = ((UMLNavigatorItem) nextSelectedObject) - .getView(); - nextSelectedObject = view.getElement(); - } else if (nextSelectedObject instanceof IAdaptable) { - IAdaptable adaptable = (IAdaptable) nextSelectedObject; - nextSelectedObject = adaptable - .getAdapter(EObject.class); - } - - if (nextSelectedObject instanceof EObject) { - EObject modelElement = (EObject) nextSelectedObject; - Resource modelElementResource = modelElement - .eResource(); - uris.add(modelElementResource.getURI().appendFragment( - modelElementResource - .getURIFragment(modelElement))); - } - } - } - - List result = new ArrayList(); - for (Iterator it = uris.iterator(); it.hasNext();) { - URI nextURI = (URI) it.next(); - EObject modelObject = getEditingDomain().getResourceSet() - .getEObject(nextURI, true); - result.add(modelObject); - } - return result; - } - - /** - * @generated - */ - protected abstract Object getJavaObject(TransferData data); - - } - - /** - * @generated - */ - public void refresh() { - refreshPalette(); - refreshDiagram(); - } - - /** - * @generated - */ - private void refreshDiagram() { - getDiagramGraphicalViewer().setContents(getDiagram()); - } - - /** - * @generated - */ - private void refreshPalette() { - PaletteRoot paletteRoot = getEditDomain().getPaletteViewer() - .getPaletteRoot(); - cleanPaletteRoot(paletteRoot); - createPaletteRoot(paletteRoot); - } - - /** - * @generated - */ - private void cleanPaletteRoot(PaletteRoot paletteRoot) { - List<Object> entries = new ArrayList<Object>(); - entries.addAll(paletteRoot.getChildren()); - for (Object entry : entries) { - PaletteEntry paletteEntry = (PaletteEntry) entry; - // we don't repaint standard palette group - if (PaletteService.GROUP_STANDARD.equals(paletteEntry.getId())) { - continue; - } - paletteRoot.remove(paletteEntry); - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorPlugin.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorPlugin.java deleted file mode 100644 index 7d0a38379ba..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorPlugin.java +++ /dev/null @@ -1,309 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * Francisco Javier Cano Muñoz - Expanded functionality - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants; -import org.eclipse.jface.preference.PreferenceConverter; -import org.eclipse.jface.resource.FontRegistry; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory; -import org.osgi.framework.BundleContext; - -import org.eclipse.papyrus.diagram.common.part.CachedResourcesDocumentProvider; -import org.eclipse.papyrus.diagram.common.part.DocumentProviderRegistry; -import org.eclipse.papyrus.diagram.common.ids.UMLDiagramEditorIDs; -import org.eclipse.papyrus.diagram.common.providers.AlternativeUMLItemProviderAdapterFactory; - -/** - * @generated - */ -public class UMLDiagramEditorPlugin extends AbstractUIPlugin { - - /** - * @generated NOT - */ - public static final String ID = "org.eclipse.papyrus.diagram.sequence"; - - /** - * @generated - */ - public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID); - - /** - * @generated - */ - private static UMLDiagramEditorPlugin instance; - - /** - * @generated - */ - private ComposedAdapterFactory adapterFactory; - - /** - * @generated - */ - public UMLDiagramEditorPlugin() { - } - - /** - * @generated - */ - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - instance = this; - PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, - getPreferenceStore()); - adapterFactory = createAdapterFactory(); - } - - /** - * @generated - */ - @Override - public void stop(BundleContext context) throws Exception { - adapterFactory.dispose(); - adapterFactory = null; - instance = null; - super.stop(context); - } - - /** - * @generated - */ - public static UMLDiagramEditorPlugin getInstance() { - return instance; - } - - /** - * @generated - */ - protected ComposedAdapterFactory createAdapterFactory() { - List factories = new ArrayList(); - fillItemProviderFactories(factories); - return new ComposedAdapterFactory(factories); - } - - /** - * @generated - */ - protected void fillItemProviderFactories(List factories) { - //custom icons for diagram elements - factories.add(new AlternativeUMLItemProviderAdapterFactory( - getPreferenceStore())); - - factories.add(new UMLItemProviderAdapterFactory()); - factories.add(new EcoreItemProviderAdapterFactory()); - factories.add(new ResourceItemProviderAdapterFactory()); - factories.add(new ReflectiveItemProviderAdapterFactory()); - } - - /** - * @generated - */ - public AdapterFactory getItemProvidersAdapterFactory() { - return adapterFactory; - } - - /** - * @generated - */ - public ImageDescriptor getItemImageDescriptor(Object item) { - IItemLabelProvider labelProvider = (IItemLabelProvider) adapterFactory - .adapt(item, IItemLabelProvider.class); - if (labelProvider != null) { - return ExtendedImageRegistry.getInstance().getImageDescriptor( - labelProvider.getImage(item)); - } - return null; - } - - /** - * Returns an image descriptor for the image file at the given plug-in - * relative path. - * - * @generated - * @param path - * the path - * @return the image descriptor - */ - public static ImageDescriptor getBundledImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path); - } - - /** - * Respects images residing in any plug-in. If path is relative, then this - * bundle is looked up for the image, otherwise, for absolute path, first - * segment is taken as id of plug-in with image - * - * @generated - * @param path - * the path to image, either absolute (with plug-in id as first - * segment), or relative for bundled images - * @return the image descriptor - */ - public static ImageDescriptor findImageDescriptor(String path) { - final IPath p = new Path(path); - if (p.isAbsolute() && p.segmentCount() > 1) { - return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p - .removeFirstSegments(1).makeAbsolute().toString()); - } else { - return getBundledImageDescriptor(p.makeAbsolute().toString()); - } - } - - /** - * Returns an image for the image file at the given plug-in relative path. - * Client do not need to dispose this image. Images will be disposed - * automatically. - * - * @generated - * @param path - * the path - * @return image instance - */ - public Image getBundledImage(String path) { - Image image = getImageRegistry().get(path); - if (image == null) { - getImageRegistry().put(path, getBundledImageDescriptor(path)); - image = getImageRegistry().get(path); - } - return image; - } - - /** - * Returns string from plug-in's resource bundle - * - * @generated - */ - public static String getString(String key) { - return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$ - } - - /** - * @generated - */ - public CachedResourcesDocumentProvider getDocumentProvider(String domainID, - IEditorInput input) { - return DocumentProviderRegistry.getInstance().get(domainID, input); - } - - /** - * @generated - */ - public void logError(String error) { - logError(error, null); - } - - /** - * @generated - */ - public void logError(String error, Throwable throwable) { - if (error == null && throwable != null) { - error = throwable.getMessage(); - } - getLog().log( - new Status(IStatus.ERROR, UMLDiagramEditorPlugin.ID, - IStatus.OK, error, throwable)); - debug(error, throwable); - } - - /** - * @generated - */ - public void logInfo(String message) { - logInfo(message, null); - } - - /** - * @generated - */ - public void logInfo(String message, Throwable throwable) { - if (message == null && throwable != null) { - message = throwable.getMessage(); - } - getLog().log( - new Status(IStatus.INFO, UMLDiagramEditorPlugin.ID, IStatus.OK, - message, throwable)); - debug(message, throwable); - } - - /** - * @generated - */ - private void debug(String message, Throwable throwable) { - if (!isDebugging()) { - return; - } - if (message != null) { - System.err.println(message); - } - if (throwable != null) { - throwable.printStackTrace(); - } - } - - /** - * @generated - */ - public FontRegistry getFontRegistry() { - if (myFontRegistry == null) { - myFontRegistry = new FontRegistry(Display.getCurrent()); - myFontRegistry.put(IPreferenceConstants.PREF_DEFAULT_FONT, - PreferenceConverter.getDefaultFontDataArray( - getPreferenceStore(), - IPreferenceConstants.PREF_DEFAULT_FONT)); - } - return myFontRegistry; - } - - /** - * @generated - */ - public Font getDefaultFont() { - return getFontRegistry().get(IPreferenceConstants.PREF_DEFAULT_FONT); - } - - /** - * @generated - */ - public Font getDefaultBoldFont() { - return getFontRegistry() - .getBold(IPreferenceConstants.PREF_DEFAULT_FONT); - } - - /** - * @generated - */ - private FontRegistry myFontRegistry; -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorUtil.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorUtil.java deleted file mode 100644 index 7330f31da53..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramEditorUtil.java +++ /dev/null @@ -1,516 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.SubProgressMonitor; -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.ResourceSet; -import org.eclipse.emf.ecore.xmi.XMLResource; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.core.services.ViewService; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart; -import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer; -import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; -import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.uml2.uml.ElementImport; -import org.eclipse.uml2.uml.Model; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLFactory; -import org.eclipse.uml2.uml.resource.UMLResource; - -import org.eclipse.papyrus.diagram.common.providers.IMOSKittEditorFactory; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLDiagramEditorUtil implements IMOSKittEditorFactory { - - /** - * @generated - */ - public static Map getSaveOptions() { - Map saveOptions = new HashMap(); - saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$ - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, - Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - return saveOptions; - } - - /** - * @generated - */ - public static boolean openDiagram(Resource diagram) - throws PartInitException { - String path = diagram.getURI().toPlatformString(true); - IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot() - .findMember(new Path(path)); - if (workspaceResource instanceof IFile) { - IWorkbenchPage page = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage(); - return null != page.openEditor(new FileEditorInput( - (IFile) workspaceResource), UMLDiagramEditor.ID); - } - return false; - } - - /** - * @generated - */ - public static void setCharset(IFile file) { - if (file == null) { - return; - } - try { - file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$ - } catch (CoreException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static String getUniqueFileName(IPath containerFullPath, - String fileName, String extension) { - if (containerFullPath == null) { - containerFullPath = new Path(""); //$NON-NLS-1$ - } - if (fileName == null || fileName.trim().length() == 0) { - fileName = "default"; //$NON-NLS-1$ - } - - extension = "." + extension; - if (fileName.endsWith(extension)) { - fileName = fileName.substring(0, fileName.length() - - extension.length()); - } - int i = 1; - IPath filePath = containerFullPath.append(fileName + extension); - while (ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) { - i++; - filePath = containerFullPath.append(fileName + i + extension); - } - return filePath.lastSegment(); - } - - /** - * Runs the wizard in a dialog. - * - * @generated - */ - public static void runWizard(Shell shell, Wizard wizard, String settingsKey) { - IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin - .getInstance().getDialogSettings(); - IDialogSettings wizardDialogSettings = pluginDialogSettings - .getSection(settingsKey); - if (wizardDialogSettings == null) { - wizardDialogSettings = pluginDialogSettings - .addNewSection(settingsKey); - } - wizard.setDialogSettings(wizardDialogSettings); - WizardDialog dialog = new WizardDialog(shell, wizard); - dialog.create(); - dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), - 500); - dialog.open(); - } - - /** - * This method should be called within a workspace modify operation since it creates resources. - * @generated - */ - public static Resource createDiagram(URI diagramURI, URI modelURI, - IProgressMonitor progressMonitor) { - TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE - .createEditingDomain(); - progressMonitor.beginTask( - Messages.UMLDiagramEditorUtil_CreateDiagramProgressTask, 3); - final Resource diagramResource = editingDomain.getResourceSet() - .createResource(diagramURI); - final Resource modelResource = editingDomain.getResourceSet() - .createResource(modelURI); - final String diagramName = diagramURI.lastSegment(); - AbstractTransactionalCommand command = new AbstractTransactionalCommand( - editingDomain, - Messages.UMLDiagramEditorUtil_CreateDiagramCommandLabel, - Collections.EMPTY_LIST) { - protected CommandResult doExecuteWithResult( - IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - Package model = createInitialModel(); - - Diagram diagram = ViewService.createDiagram(model, - PackageEditPart.MODEL_ID, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - if (diagram != null) { - attachModelToResource(model, modelResource, diagram); - diagramResource.getContents().add(diagram); - diagram.setName(diagramName); - diagram.setElement(model); - } - - try { - modelResource - .save(org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorUtil - .getSaveOptions()); - diagramResource - .save(org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorUtil - .getSaveOptions()); - } catch (IOException e) { - - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to store model and diagram resources", e); //$NON-NLS-1$ - } - return CommandResult.newOKCommandResult(); - } - }; - try { - OperationHistoryFactory.getOperationHistory().execute(command, - new SubProgressMonitor(progressMonitor, 1), null); - } catch (ExecutionException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to create model and diagram", e); //$NON-NLS-1$ - } - setCharset(WorkspaceSynchronizer.getFile(modelResource)); - setCharset(WorkspaceSynchronizer.getFile(diagramResource)); - return diagramResource; - } - - /** - * Create a new instance of domain element associated with canvas. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static Package createInitialModel() { - return UMLFactory.eINSTANCE.createPackage(); - } - - /** - * Store model element in the resource. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - private static void attachModelToResource(Package model, Resource resource, - Diagram diagram) { - resource.getContents().add(model); - loadDefaultImports(model, diagram); - - } - - /** - * @generated - */ - public static void selectElementsInDiagram( - IDiagramWorkbenchPart diagramPart, List/*EditPart*/editParts) { - diagramPart.getDiagramGraphicalViewer().deselectAll(); - - EditPart firstPrimary = null; - for (Iterator it = editParts.iterator(); it.hasNext();) { - EditPart nextPart = (EditPart) it.next(); - diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart); - if (firstPrimary == null && nextPart instanceof IPrimaryEditPart) { - firstPrimary = nextPart; - } - } - - if (!editParts.isEmpty()) { - diagramPart.getDiagramGraphicalViewer().reveal( - firstPrimary != null ? firstPrimary : (EditPart) editParts - .get(0)); - } - } - - /** - * @generated - */ - private static int findElementsInDiagramByID(DiagramEditPart diagramPart, - EObject element, List editPartCollector) { - IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer) diagramPart - .getViewer(); - final int intialNumOfEditParts = editPartCollector.size(); - - if (element instanceof View) { // support notation element lookup - EditPart editPart = (EditPart) viewer.getEditPartRegistry().get( - element); - if (editPart != null) { - editPartCollector.add(editPart); - return 1; - } - } - - String elementID = EMFCoreUtil.getProxyID(element); - List associatedParts = viewer.findEditPartsForElement(elementID, - IGraphicalEditPart.class); - // perform the possible hierarchy disjoint -> take the top-most parts only - for (Iterator editPartIt = associatedParts.iterator(); editPartIt - .hasNext();) { - EditPart nextPart = (EditPart) editPartIt.next(); - EditPart parentPart = nextPart.getParent(); - while (parentPart != null && !associatedParts.contains(parentPart)) { - parentPart = parentPart.getParent(); - } - if (parentPart == null) { - editPartCollector.add(nextPart); - } - } - - if (intialNumOfEditParts == editPartCollector.size()) { - if (!associatedParts.isEmpty()) { - editPartCollector.add(associatedParts.iterator().next()); - } else { - if (element.eContainer() != null) { - return findElementsInDiagramByID(diagramPart, element - .eContainer(), editPartCollector); - } - } - } - return editPartCollector.size() - intialNumOfEditParts; - } - - /** - * @generated - */ - public static View findView(DiagramEditPart diagramEditPart, - EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) { - boolean hasStructuralURI = false; - if (targetElement.eResource() instanceof XMLResource) { - hasStructuralURI = ((XMLResource) targetElement.eResource()) - .getID(targetElement) == null; - } - - View view = null; - if (hasStructuralURI - && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) { - view = (View) lazyElement2ViewMap.getElement2ViewMap().get( - targetElement); - } else if (findElementsInDiagramByID(diagramEditPart, targetElement, - lazyElement2ViewMap.editPartTmpHolder) > 0) { - EditPart editPart = (EditPart) lazyElement2ViewMap.editPartTmpHolder - .get(0); - lazyElement2ViewMap.editPartTmpHolder.clear(); - view = editPart.getModel() instanceof View ? (View) editPart - .getModel() : null; - } - - return (view == null) ? diagramEditPart.getDiagramView() : view; - } - - /** - * @generated - */ - public static class LazyElement2ViewMap { - /** - * @generated - */ - private Map element2ViewMap; - - /** - * @generated - */ - private View scope; - - /** - * @generated - */ - private Set elementSet; - - /** - * @generated - */ - public final List editPartTmpHolder = new ArrayList(); - - /** - * @generated - */ - public LazyElement2ViewMap(View scope, Set elements) { - this.scope = scope; - this.elementSet = elements; - } - - /** - * @generated - */ - public final Map getElement2ViewMap() { - if (element2ViewMap == null) { - element2ViewMap = new HashMap(); - // map possible notation elements to itself as these can't be found by view.getElement() - for (Iterator it = elementSet.iterator(); it.hasNext();) { - EObject element = (EObject) it.next(); - if (element instanceof View) { - View view = (View) element; - if (view.getDiagram() == scope.getDiagram()) { - element2ViewMap.put(element, element); // take only those that part of our diagram - } - } - } - - buildElement2ViewMap(scope, element2ViewMap, elementSet); - } - return element2ViewMap; - } - - /** - * @generated - */ - static Map buildElement2ViewMap(View parentView, Map element2ViewMap, - Set elements) { - if (elements.size() == element2ViewMap.size()) - return element2ViewMap; - - if (parentView.isSetElement() - && !element2ViewMap.containsKey(parentView.getElement()) - && elements.contains(parentView.getElement())) { - element2ViewMap.put(parentView.getElement(), parentView); - if (elements.size() == element2ViewMap.size()) - return element2ViewMap; - } - - for (Iterator it = parentView.getChildren().iterator(); it - .hasNext();) { - buildElement2ViewMap((View) it.next(), element2ViewMap, - elements); - if (elements.size() == element2ViewMap.size()) - return element2ViewMap; - } - for (Iterator it = parentView.getSourceEdges().iterator(); it - .hasNext();) { - buildElement2ViewMap((View) it.next(), element2ViewMap, - elements); - if (elements.size() == element2ViewMap.size()) - return element2ViewMap; - } - for (Iterator it = parentView.getSourceEdges().iterator(); it - .hasNext();) { - buildElement2ViewMap((View) it.next(), element2ViewMap, - elements); - if (elements.size() == element2ViewMap.size()) - return element2ViewMap; - } - return element2ViewMap; - } - } //LazyElement2ViewMap - - /** - * @generated - */ - public static IFile getFile(URI uri) { - if (uri.toString().startsWith("platform:/resource")) { //$NON-NLS-1$ - String path = uri.toString().substring( - "platform:/resource".length()); //$NON-NLS-1$ - IResource workspaceResource = ResourcesPlugin.getWorkspace() - .getRoot().findMember(new Path(path)); - if (workspaceResource instanceof IFile) { - return (IFile) workspaceResource; - } - } - return null; - } - - /** - * @generated - */ - private static void loadDefaultImports(Package model, Diagram diagram) { - ResourceSet resourceSet = model.eResource().getResourceSet(); - Model umlLibrary = (Model) resourceSet.getResource( - URI.createURI(UMLResource.UML_PRIMITIVE_TYPES_LIBRARY_URI), - true).getContents().get(0); - ElementImport elementImport = null; - elementImport = model.createElementImport(umlLibrary - .getOwnedType("Boolean")); - if (!MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, - elementImport)) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - elementImport); - } - elementImport = model.createElementImport(umlLibrary - .getOwnedType("String")); - if (!MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, - elementImport)) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - elementImport); - } - elementImport = model.createElementImport(umlLibrary - .getOwnedType("UnlimitedNatural")); - if (!MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, - elementImport)) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - elementImport); - } - elementImport = model.createElementImport(umlLibrary - .getOwnedType("Integer")); - if (!MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, - elementImport)) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, - elementImport); - } - } - - /** - * @generated - */ - public boolean providesFor(Object object) { - return true; - } - - /** - * @generated - */ - public IEditorPart createEditorFor(Object object) { - return new UMLDiagramEditor(); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdateCommand.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdateCommand.java deleted file mode 100644 index 68456108d48..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdateCommand.java +++ /dev/null @@ -1,96 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.PlatformUI; - -/** - * @generated - */ -@SuppressWarnings("unchecked") -public class UMLDiagramUpdateCommand implements IHandler { - - /** - * @generated - */ - public void addHandlerListener(IHandlerListener handlerListener) { - } - - /** - * @generated - */ - public void dispose() { - } - - /** - * @generated - */ - public Object execute(ExecutionEvent event) throws ExecutionException { - ISelection selection = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getSelectionService() - .getSelection(); - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - if (structuredSelection.size() != 1) { - return null; - } - if (structuredSelection.getFirstElement() instanceof EditPart - && ((EditPart) structuredSelection.getFirstElement()) - .getModel() instanceof View) { - EObject modelElement = ((View) ((EditPart) structuredSelection - .getFirstElement()).getModel()).getElement(); - List editPolicies = CanonicalEditPolicy - .getRegisteredEditPolicies(modelElement); - for (Iterator it = editPolicies.iterator(); it.hasNext();) { - CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy) it - .next(); - nextEditPolicy.refresh(); - } - - } - } - return null; - } - - /** - * @generated - */ - public boolean isEnabled() { - return true; - } - - /** - * @generated - */ - public boolean isHandled() { - return true; - } - - /** - * @generated - */ - public void removeHandlerListener(IHandlerListener handlerListener) { - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdater.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdater.java deleted file mode 100644 index e768a818fef..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDiagramUpdater.java +++ /dev/null @@ -1,2086 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.Collection; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.CombinedFragment; -import org.eclipse.uml2.uml.Comment; -import org.eclipse.uml2.uml.Element; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.InteractionFragment; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.PackageableElement; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.util.UMLSwitch; - -import org.eclipse.papyrus.diagram.common.util.BasicEcoreSwitch; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -@SuppressWarnings("unchecked") -public class UMLDiagramUpdater { - - /** - * @generated - */ - public static boolean isShortcutOrphaned(View view) { - return !view.isSetElement() || view.getElement() == null - || view.getElement().eIsProxy(); - } - - /** - * @generated - */ - public static List getSemanticChildren(View view) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - case LifelineEditPart.VISUAL_ID: - return getLifeline_2002SemanticChildren(view); - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - return getInteractionInteractionCompartment_5001SemanticChildren(view); - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - return getInteractionInteractionCompartment_5002SemanticChildren(view); - case PackageEditPart.VISUAL_ID: - return getPackage_79SemanticChildren(view); - } - return Collections.EMPTY_LIST; - } - - /** - * @generated NOT - */ - public static List getLifeline_2002SemanticChildren(View view) { - if (!view.isSetElement()) { - return Collections.EMPTY_LIST; - } - Lifeline modelElement = (Lifeline) view.getElement(); - List result = new LinkedList(); - - // Added code - if (modelElement instanceof Lifeline) { - if ((modelElement).getCoveredBys().size() > 0) { - Interaction interaction = modelElement.getInteraction(); - - for (Iterator values = interaction.getFragments().iterator(); values - .hasNext();) { - EObject nextValue = (EObject) values.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - nextValue); - if (BehaviorExecutionSpecificationEditPart.VISUAL_ID == visualID) { - BehaviorExecutionSpecification be = (BehaviorExecutionSpecification) nextValue; - if (be.getCovereds().size() > 0 - && be.getCovereds().get(0) == modelElement) { - // result.add(nextValue); - result.add(new UMLNodeDescriptor(nextValue, - visualID)); - } - } - } - } - } - - // Autogenerated code not valid - // for (Iterator it = modelElement.getFragments().iterator(); - // it.hasNext();) { - // InteractionFragment childElement = (InteractionFragment) it.next(); - // int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - // childElement); - // if (visualID == BehaviorExecutionSpecificationEditPart.VISUAL_ID) { - // result.add(new UMLNodeDescriptor(childElement, visualID)); - // continue; - // } - // } - - return result; - } - - /** - * @generated - */ - public static List getInteractionInteractionCompartment_5001SemanticChildren( - View view) { - if (false == view.eContainer() instanceof View) { - return Collections.EMPTY_LIST; - } - View containerView = (View) view.eContainer(); - if (!containerView.isSetElement()) { - return Collections.EMPTY_LIST; - } - Interaction modelElement = (Interaction) containerView.getElement(); - List result = new LinkedList(); - for (Iterator it = modelElement.getFragments().iterator(); it.hasNext();) { - InteractionFragment childElement = (InteractionFragment) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - childElement); - if (visualID == Interaction2EditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - if (visualID == CombinedFragmentEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - } - for (Iterator it = modelElement.getLifelines().iterator(); it.hasNext();) { - Lifeline childElement = (Lifeline) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - childElement); - if (visualID == LifelineEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - } - return result; - } - - /** - * @generated - */ - public static List getInteractionInteractionCompartment_5002SemanticChildren( - View view) { - if (false == view.eContainer() instanceof View) { - return Collections.EMPTY_LIST; - } - View containerView = (View) view.eContainer(); - if (!containerView.isSetElement()) { - return Collections.EMPTY_LIST; - } - Interaction modelElement = (Interaction) containerView.getElement(); - List result = new LinkedList(); - for (Iterator it = modelElement.getFragments().iterator(); it.hasNext();) { - InteractionFragment childElement = (InteractionFragment) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - childElement); - if (visualID == Interaction2EditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - if (visualID == CombinedFragmentEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - } - for (Iterator it = modelElement.getLifelines().iterator(); it.hasNext();) { - Lifeline childElement = (Lifeline) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID(view, - childElement); - if (visualID == LifelineEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, visualID)); - continue; - } - } - return result; - } - - /** - * @generated NOT - * - * modified to handle an Interaction as canvas element. - */ - static class ThisDiagramUpdaterSwitch extends - BasicEcoreSwitch<List<UMLNodeDescriptor>, View> { - @Override - public List<UMLNodeDescriptor> doSwitch(EObject modelElement) { - - final View view = getInfo(); - if (view == null) { - return Collections.EMPTY_LIST; - } - - UMLSwitch<List<UMLNodeDescriptor>> aSwitch = new UMLSwitch<List<UMLNodeDescriptor>>() { - - @Override - public List<UMLNodeDescriptor> casePackage(Package modelElement) { - List<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>(); - for (Iterator it = modelElement.getPackagedElements() - .iterator(); it.hasNext();) { - PackageableElement childElement = (PackageableElement) it - .next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID( - view, childElement); - if (visualID == InteractionEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, - visualID)); - continue; - } - } - for (Iterator it = modelElement.getOwnedComments() - .iterator(); it.hasNext();) { - Comment childElement = (Comment) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID( - view, childElement); - if (visualID == CommentEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, - visualID)); - continue; - } - } - return result; - } - - @Override - public List<UMLNodeDescriptor> caseInteraction( - Interaction modelElement) { - List<UMLNodeDescriptor> result = new LinkedList<UMLNodeDescriptor>(); - for (Iterator it = modelElement.getOwnedComments() - .iterator(); it.hasNext();) { - Comment childElement = (Comment) it.next(); - int visualID = UMLVisualIDRegistry.getNodeVisualID( - view, childElement); - if (visualID == CommentEditPart.VISUAL_ID) { - result.add(new UMLNodeDescriptor(childElement, - visualID)); - continue; - } - } - result.add(new UMLNodeDescriptor(modelElement, - InteractionEditPart.VISUAL_ID)); - return result; - } - - }; - return aSwitch.doSwitch(modelElement); - } - } - - /** - * @generated - */ - private static ThisDiagramUpdaterSwitch aSwitch = new ThisDiagramUpdaterSwitch(); - - /** - * @generated - */ - public static List getPackage_79SemanticChildren(View view) { - if (!view.isSetElement()) { - return Collections.EMPTY_LIST; - } - EObject modelElement = (EObject) view.getElement(); - aSwitch.setInfo(view); - List<UMLNodeDescriptor> result = aSwitch.doSwitch(modelElement); - if (result == null || result.size() <= 0) { - return Collections.EMPTY_LIST; - } - return result; - } - - /** - * @generated - */ - public static List getContainedLinks(View view) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - case PackageEditPart.VISUAL_ID: - return getPackage_79ContainedLinks(view); - case InteractionEditPart.VISUAL_ID: - return getInteraction_1001ContainedLinks(view); - case CommentEditPart.VISUAL_ID: - return getComment_2005ContainedLinks(view); - case Interaction2EditPart.VISUAL_ID: - return getInteraction_2001ContainedLinks(view); - case LifelineEditPart.VISUAL_ID: - return getLifeline_2002ContainedLinks(view); - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return getBehaviorExecutionSpecification_2003ContainedLinks(view); - case CombinedFragmentEditPart.VISUAL_ID: - return getCombinedFragment_2004ContainedLinks(view); - case MessageEditPart.VISUAL_ID: - return getMessage_3001ContainedLinks(view); - case Message2EditPart.VISUAL_ID: - return getMessage_3002ContainedLinks(view); - case Message3EditPart.VISUAL_ID: - return getMessage_3003ContainedLinks(view); - case Message4EditPart.VISUAL_ID: - return getMessage_3004ContainedLinks(view); - case Message5EditPart.VISUAL_ID: - return getMessage_3005ContainedLinks(view); - case Message6EditPart.VISUAL_ID: - return getMessage_3006ContainedLinks(view); - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - public static List getIncomingLinks(View view) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - case InteractionEditPart.VISUAL_ID: - return getInteraction_1001IncomingLinks(view); - case CommentEditPart.VISUAL_ID: - return getComment_2005IncomingLinks(view); - case Interaction2EditPart.VISUAL_ID: - return getInteraction_2001IncomingLinks(view); - case LifelineEditPart.VISUAL_ID: - return getLifeline_2002IncomingLinks(view); - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return getBehaviorExecutionSpecification_2003IncomingLinks(view); - case CombinedFragmentEditPart.VISUAL_ID: - return getCombinedFragment_2004IncomingLinks(view); - case MessageEditPart.VISUAL_ID: - return getMessage_3001IncomingLinks(view); - case Message2EditPart.VISUAL_ID: - return getMessage_3002IncomingLinks(view); - case Message3EditPart.VISUAL_ID: - return getMessage_3003IncomingLinks(view); - case Message4EditPart.VISUAL_ID: - return getMessage_3004IncomingLinks(view); - case Message5EditPart.VISUAL_ID: - return getMessage_3005IncomingLinks(view); - case Message6EditPart.VISUAL_ID: - return getMessage_3006IncomingLinks(view); - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - public static List getOutgoingLinks(View view) { - switch (UMLVisualIDRegistry.getVisualID(view)) { - case InteractionEditPart.VISUAL_ID: - return getInteraction_1001OutgoingLinks(view); - case CommentEditPart.VISUAL_ID: - return getComment_2005OutgoingLinks(view); - case Interaction2EditPart.VISUAL_ID: - return getInteraction_2001OutgoingLinks(view); - case LifelineEditPart.VISUAL_ID: - return getLifeline_2002OutgoingLinks(view); - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return getBehaviorExecutionSpecification_2003OutgoingLinks(view); - case CombinedFragmentEditPart.VISUAL_ID: - return getCombinedFragment_2004OutgoingLinks(view); - case MessageEditPart.VISUAL_ID: - return getMessage_3001OutgoingLinks(view); - case Message2EditPart.VISUAL_ID: - return getMessage_3002OutgoingLinks(view); - case Message3EditPart.VISUAL_ID: - return getMessage_3003OutgoingLinks(view); - case Message4EditPart.VISUAL_ID: - return getMessage_3004OutgoingLinks(view); - case Message5EditPart.VISUAL_ID: - return getMessage_3005OutgoingLinks(view); - case Message6EditPart.VISUAL_ID: - return getMessage_3006OutgoingLinks(view); - } - return Collections.EMPTY_LIST; - } - - /** - * @generated NOT - * - * Modified to handle an Interaction as canvas element. - */ - public static List getPackage_79ContainedLinks(View view) { - EObject eObject = view.getElement(); - if (eObject instanceof Element) { - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007((Element) eObject)); - return result; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - public static List getInteraction_1001ContainedLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - List result = new LinkedList(); - result - .addAll(getContainedTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getInteraction_2001ContainedLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - List result = new LinkedList(); - result - .addAll(getContainedTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getContainedTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getLifeline_2002ContainedLinks(View view) { - Lifeline modelElement = (Lifeline) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getBehaviorExecutionSpecification_2003ContainedLinks( - View view) { - BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view - .getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getCombinedFragment_2004ContainedLinks(View view) { - CombinedFragment modelElement = (CombinedFragment) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getComment_2005ContainedLinks(View view) { - Comment modelElement = (Comment) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_3008(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3001ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3002ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3003ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3004ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3005ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated not - */ - public static List getMessage_3006ContainedLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getInteraction_1001IncomingLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getInteraction_2001IncomingLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getLifeline_2002IncomingLinks(View view) { - Lifeline modelElement = (Lifeline) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getBehaviorExecutionSpecification_2003IncomingLinks( - View view) { - BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view - .getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getCombinedFragment_2004IncomingLinks(View view) { - CombinedFragment modelElement = (CombinedFragment) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getComment_2005IncomingLinks(View view) { - Comment modelElement = (Comment) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Element_OwnedComment_3007( - modelElement, crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3001IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3002IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3003IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3004IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3005IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3006IncomingLinks(View view) { - Message modelElement = (Message) view.getElement(); - Map crossReferences = EcoreUtil.CrossReferencer.find(view.eResource() - .getResourceSet().getResources()); - List result = new LinkedList(); - result.addAll(getIncomingTypeModelFacetLinks_Message_3001(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3002(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3003(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3004(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3005(modelElement, - crossReferences)); - result.addAll(getIncomingTypeModelFacetLinks_Message_3006(modelElement, - crossReferences)); - result - .addAll(getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - modelElement, crossReferences)); - return result; - } - - /** - * @generated - */ - public static List getInteraction_1001OutgoingLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getInteraction_2001OutgoingLinks(View view) { - Interaction modelElement = (Interaction) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getLifeline_2002OutgoingLinks(View view) { - Lifeline modelElement = (Lifeline) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getBehaviorExecutionSpecification_2003OutgoingLinks( - View view) { - BehaviorExecutionSpecification modelElement = (BehaviorExecutionSpecification) view - .getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getCombinedFragment_2004OutgoingLinks(View view) { - CombinedFragment modelElement = (CombinedFragment) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getComment_2005OutgoingLinks(View view) { - Comment modelElement = (Comment) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_3008(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3001OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3002OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3003OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3004OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3005OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated - */ - public static List getMessage_3006OutgoingLinks(View view) { - Message modelElement = (Message) view.getElement(); - List result = new LinkedList(); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3001(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3002(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3003(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3004(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3005(modelElement)); - result - .addAll(getOutgoingTypeModelFacetLinks_Message_3006(modelElement)); - result - .addAll(getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007(modelElement)); - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3001( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3001, MessageEditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3002( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3002, Message2EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3003( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3003, Message3EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3004( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3004, Message4EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3005( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3005, Message5EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getContainedTypeModelFacetLinks_Message_3006( - Interaction container) { - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - if (dst == null || src == null) { - continue; - } - - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3006, Message6EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3001( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3001, MessageEditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3002( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3002, Message2EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3003( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3003, Message3EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3004( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3004, Message4EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3005( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3005, Message5EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getIncomingTypeModelFacetLinks_Message_3006( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() != UMLPackage.eINSTANCE - .getElement_OwnedElement() - || false == setting.getEObject() instanceof Message) { - continue; - } - Message link = (Message) setting.getEObject(); - if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Original code - // Element src = link.getOwner(); - - // New code - Element src = MessageCommonUtil.getMessageSrc(link); - - result.add(new UMLLinkDescriptor(src, target, link, - UMLElementTypes.Message_3006, Message6EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated - */ - private static Collection getIncomingFeatureModelFacetLinks_Element_OwnedComment_3007( - Comment target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE - .getElement_OwnedComment()) { - result - .add(new org.eclipse.papyrus.diagram.sequence.part.UMLLinkDescriptor( - setting.getEObject(), target, - UMLElementTypes.ElementOwnedComment_3007, - ElementOwnedCommentEditPart.VISUAL_ID)); - } - } - return result; - } - - /** - * @generated - */ - private static Collection getIncomingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - Element target, Map crossReferences) { - Collection result = new LinkedList(); - Collection settings = (Collection) crossReferences.get(target); - for (Iterator it = settings.iterator(); it.hasNext();) { - EStructuralFeature.Setting setting = (EStructuralFeature.Setting) it - .next(); - if (setting.getEStructuralFeature() == UMLPackage.eINSTANCE - .getComment_AnnotatedElement()) { - result - .add(new org.eclipse.papyrus.diagram.sequence.part.UMLLinkDescriptor( - setting.getEObject(), target, - UMLElementTypes.CommentAnnotatedElement_3008, - CommentAnnotatedElementEditPart.VISUAL_ID)); - } - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3001( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3001, MessageEditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3002( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3002, Message2EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3003( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - List targets = link.getOwnedElements(); - Object theTarget = targets.size() == 1 ? targets.get(0) : null; - if (false == theTarget instanceof Element) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3003, Message3EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3004( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - List targets = link.getOwnedElements(); - Object theTarget = targets.size() == 1 ? targets.get(0) : null; - if (false == theTarget instanceof Element) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3004, Message4EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3005( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - List targets = link.getOwnedElements(); - Object theTarget = targets.size() == 1 ? targets.get(0) : null; - if (false == theTarget instanceof Element) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3005, Message5EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - private static Collection getOutgoingTypeModelFacetLinks_Message_3006( - Element source) { - Interaction container = null; - // Find container element for the link. - // Climb up by containment hierarchy starting from the source - // and return the first element that is instance of the container class. - for (EObject element = source; element != null && container == null; element = element - .eContainer()) { - if (element instanceof Interaction) { - container = (Interaction) element; - } - } - if (container == null) { - return Collections.EMPTY_LIST; - } - Collection result = new LinkedList(); - for (Iterator links = container.getMessages().iterator(); links - .hasNext();) { - Object linkObject = links.next(); - if (false == linkObject instanceof Message) { - continue; - } - Message link = (Message) linkObject; - if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry - .getLinkWithClassVisualID(link)) { - continue; - } - List targets = link.getOwnedElements(); - Object theTarget = targets.size() == 1 ? targets.get(0) : null; - if (false == theTarget instanceof Element) { - continue; - } - // Generated code - // List targets = link.getOwnedElements(); - // Object theTarget = targets.size() == 1 ? targets.get(0) : null; - // if (false == theTarget instanceof Element) { - // continue; - // } - // Element dst = (Element) theTarget; - // Element src = link.getOwner(); - - // New code - Element dst = MessageCommonUtil.getMessageDst(link); - Element src = MessageCommonUtil.getMessageSrc(link); - - // Generated code - // if (src != source) { - // continue; - // } - result.add(new UMLLinkDescriptor(src, dst, link, - UMLElementTypes.Message_3006, Message6EditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated not - */ - private static Collection getOutgoingFeatureModelFacetLinks_Element_OwnedComment_3007( - Element source) { - return new LinkedList(); - } - - /** - * @generated - */ - private static Collection getOutgoingFeatureModelFacetLinks_Comment_AnnotatedElement_3008( - Comment source) { - Collection result = new LinkedList(); - for (Iterator destinations = source.getAnnotatedElements().iterator(); destinations - .hasNext();) { - Element destination = (Element) destinations.next(); - result - .add(new org.eclipse.papyrus.diagram.sequence.part.UMLLinkDescriptor( - source, destination, - UMLElementTypes.CommentAnnotatedElement_3008, - CommentAnnotatedElementEditPart.VISUAL_ID)); - } - return result; - } - - /** - * @generated NOT - */ - public static UMLLinkDescriptor createLinkDescriptorFromModelElement( - EObject eObject) { - int linkID = UMLVisualIDRegistry.getLinkWithClassVisualID(eObject); - switch (linkID) { - case MessageEditPart.VISUAL_ID: - return createLinkDescriptorFromMessage((Message) eObject); - case Message2EditPart.VISUAL_ID: - return createLinkDescriptorFromMessage2((Message) eObject); - case Message3EditPart.VISUAL_ID: - return createLinkDescriptorFromMessage3((Message) eObject); - case Message4EditPart.VISUAL_ID: - return createLinkDescriptorFromMessage4((Message) eObject); - case Message5EditPart.VISUAL_ID: - return createLinkDescriptorFromMessage5((Message) eObject); - case Message6EditPart.VISUAL_ID: - return createLinkDescriptorFromMessage6((Message) eObject); - default: - return null; - } - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3001, MessageEditPart.VISUAL_ID); - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage2( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3002, Message2EditPart.VISUAL_ID); - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage3( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3003, Message3EditPart.VISUAL_ID); - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage4( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3004, Message4EditPart.VISUAL_ID); - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage5( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3005, Message5EditPart.VISUAL_ID); - } - - private static UMLLinkDescriptor createLinkDescriptorFromMessage6( - Message message) { - Element src = MessageCommonUtil.getMessageSrc(message); - Element target = MessageCommonUtil.getMessageDst(message); - return new UMLLinkDescriptor(src, target, message, - UMLElementTypes.Message_3006, Message6EditPart.VISUAL_ID); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDocumentProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDocumentProvider.java deleted file mode 100644 index 4311228331d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDocumentProvider.java +++ /dev/null @@ -1,714 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceStatus; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.MultiRule; -import org.eclipse.emf.common.ui.URIEditorInput; -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.util.EcoreUtil; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes; -import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.jface.operation.IRunnableContext; -import org.eclipse.osgi.util.NLS; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.part.FileEditorInput; - -import org.eclipse.papyrus.diagram.common.part.CachedResourcesDocumentProvider; - -/** - * @generated - */ -public class UMLDocumentProvider extends CachedResourcesDocumentProvider - implements IDiagramDocumentProvider { - - /** - * @generated - */ - @Override - protected ElementInfo createElementInfo(Object element) - throws CoreException { - if (false == element instanceof FileEditorInput - && false == element instanceof URIEditorInput) { - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - NLS - .bind( - Messages.UMLDocumentProvider_IncorrectInputError, - new Object[] { - element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$ - null)); - } - IEditorInput editorInput = (IEditorInput) element; - IDiagramDocument document = (IDiagramDocument) createDocument(editorInput); - - CachedResourceSetInfo info = new CachedResourceSetInfo(document, - editorInput); - info.setModificationStamp(computeModificationStamp(info)); - info.fStatus = null; - return info; - } - - /** - * @generated - */ - @Override - protected IDocument createDocument(Object element) throws CoreException { - if (false == element instanceof FileEditorInput - && false == element instanceof URIEditorInput) { - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - NLS - .bind( - Messages.UMLDocumentProvider_IncorrectInputError, - new Object[] { - element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$ - null)); - } - IDocument document = createEmptyDocument((IEditorInput) element); - setDocumentContent(document, (IEditorInput) element); - setupDocument(element, document); - return document; - } - - /** - * Sets up the given document as it would be provided for the given element. The - * content of the document is not changed. This default implementation is empty. - * Subclasses may reimplement. - * - * @param element the blue-print element - * @param document the document to set up - * @generated - */ - protected void setupDocument(Object element, IDocument document) { - // for subclasses - } - - /** - * @generated - */ - protected void setDocumentContent(IDocument document, IEditorInput element) - throws CoreException { - IDiagramDocument diagramDocument = (IDiagramDocument) document; - TransactionalEditingDomain domain = diagramDocument.getEditingDomain(); - if (element instanceof FileEditorInput) { - IStorage storage = ((FileEditorInput) element).getStorage(); - Diagram diagram = DiagramIOUtil.load(domain, storage, true, - getProgressMonitor()); - document.setContent(diagram); - } else if (element instanceof URIEditorInput) { - URI uri = ((URIEditorInput) element).getURI(); - Resource resource = null; - try { - resource = domain.getResourceSet().getResource( - uri.trimFragment(), false); - if (resource == null) { - resource = domain.getResourceSet().createResource( - uri.trimFragment()); - } - if (!resource.isLoaded()) { - try { - Map options = new HashMap(GMFResourceFactory - .getDefaultLoadOptions()); - // @see 171060 - // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); - resource.load(options); - } catch (IOException e) { - resource.unload(); - throw e; - } - } - if (uri.fragment() != null) { - EObject rootElement = resource.getEObject(uri.fragment()); - if (rootElement instanceof Diagram) { - document.setContent((Diagram) rootElement); - return; - } - } else { - for (Iterator it = resource.getContents().iterator(); it - .hasNext();) { - Object rootElement = it.next(); - if (rootElement instanceof Diagram) { - document.setContent((Diagram) rootElement); - return; - } - } - } - throw new RuntimeException( - Messages.UMLDocumentProvider_NoDiagramInResourceError); - } catch (Exception e) { - CoreException thrownExcp = null; - if (e instanceof CoreException) { - thrownExcp = (CoreException) e; - } else { - String msg = e.getLocalizedMessage(); - thrownExcp = new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - msg != null ? msg - : Messages.UMLDocumentProvider_DiagramLoadingError, - e)); - } - throw thrownExcp; - } - } else { - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - NLS - .bind( - Messages.UMLDocumentProvider_IncorrectInputError, - new Object[] { - element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$ - null)); - } - } - - /** - * @generated - */ - @Override - public long getModificationStamp(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - return computeModificationStamp(info); - } - return super.getModificationStamp(element); - } - - /** - * @generated - */ - @Override - public boolean isDeleted(Object element) { - IDiagramDocument document = getDiagramDocument(element); - if (document != null) { - Resource diagramResource = document.getDiagram().eResource(); - if (diagramResource != null) { - IFile file = WorkspaceSynchronizer.getFile(diagramResource); - return file == null || file.getLocation() == null - || !file.getLocation().toFile().exists(); - } - } - return super.isDeleted(element); - } - - /** - * @generated - */ - public CachedResourceSetInfo getResourceSetInfo(Object editorInput) { - return (CachedResourceSetInfo) super.getElementInfo(editorInput); - } - - /** - * @generated - */ - @Override - protected void doValidateState(Object element, Object computationContext) - throws CoreException { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - Collection files2Validate = new ArrayList(); - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null && file.isReadOnly()) { - files2Validate.add(file); - } - } - ResourcesPlugin.getWorkspace().validateEdit( - (IFile[]) files2Validate.toArray(new IFile[files2Validate - .size()]), computationContext); - } - - super.doValidateState(element, computationContext); - } - - /** - * @generated - */ - @Override - public boolean isReadOnly(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - if (info.isUpdateCache()) { - try { - updateCache(element); - } catch (CoreException ex) { - UMLDiagramEditorPlugin.getInstance().logError( - Messages.UMLDocumentProvider_isModifiable, ex); - // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable - } - } - return info.isReadOnly(); - } - return super.isReadOnly(element); - } - - /** - * @generated - */ - @Override - public boolean isModifiable(Object element) { - if (!isStateValidated(element)) { - if (element instanceof FileEditorInput - || element instanceof URIEditorInput) { - return true; - } - } - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - if (info.isUpdateCache()) { - try { - updateCache(element); - } catch (CoreException ex) { - UMLDiagramEditorPlugin.getInstance().logError( - Messages.UMLDocumentProvider_isModifiable, ex); - // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable - } - } - return info.isModifiable(); - } - return super.isModifiable(element); - } - - /** - * @generated - */ - protected void updateCache(Object element) throws CoreException { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null && file.isReadOnly()) { - info.setReadOnly(true); - info.setModifiable(false); - return; - } - } - info.setReadOnly(false); - info.setModifiable(true); - return; - } - } - - /** - * @generated - */ - @Override - protected void doUpdateStateCache(Object element) throws CoreException { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - info.setUpdateCache(true); - } - super.doUpdateStateCache(element); - } - - /** - * @generated - */ - @Override - public boolean isSynchronized(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - return info.isSynchronized(); - } - return super.isSynchronized(element); - } - - /** - * @generated - */ - @Override - protected ISchedulingRule getResetRule(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - Collection rules = new ArrayList(); - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null) { - rules.add(ResourcesPlugin.getWorkspace().getRuleFactory() - .modifyRule(file)); - } - } - return new MultiRule((ISchedulingRule[]) rules - .toArray(new ISchedulingRule[rules.size()])); - } - return null; - } - - /** - * @generated - */ - @Override - protected ISchedulingRule getSaveRule(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - Collection rules = new ArrayList(); - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null) { - rules.add(computeSchedulingRule(file)); - } - } - return new MultiRule((ISchedulingRule[]) rules - .toArray(new ISchedulingRule[rules.size()])); - } - return null; - } - - /** - * @generated - */ - @Override - protected ISchedulingRule getSynchronizeRule(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - Collection rules = new ArrayList(); - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null) { - rules.add(ResourcesPlugin.getWorkspace().getRuleFactory() - .refreshRule(file)); - } - } - return new MultiRule((ISchedulingRule[]) rules - .toArray(new ISchedulingRule[rules.size()])); - } - return null; - } - - /** - * @generated - */ - @Override - protected ISchedulingRule getValidateStateRule(Object element) { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - Collection files = new ArrayList(); - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - IFile file = WorkspaceSynchronizer.getFile(nextResource); - if (file != null) { - files.add(file); - } - } - return ResourcesPlugin.getWorkspace().getRuleFactory() - .validateEditRule( - (IFile[]) files.toArray(new IFile[files.size()])); - } - return null; - } - - /** - * @generated - */ - private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) { - if (toCreateOrModify.exists()) - return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule( - toCreateOrModify); - - IResource parent = toCreateOrModify; - do { - /* - * XXX This is a workaround for - * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601 - * IResourceRuleFactory.createRule should iterate the hierarchy - * itself. - */ - toCreateOrModify = parent; - parent = toCreateOrModify.getParent(); - } while (parent != null && !parent.exists()); - - return ResourcesPlugin.getWorkspace().getRuleFactory().createRule( - toCreateOrModify); - } - - /** - * @generated - */ - @Override - protected void doSynchronize(Object element, IProgressMonitor monitor) - throws CoreException { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - for (Iterator it = info.getResourceSet().getResources().iterator(); it - .hasNext();) { - Resource nextResource = (Resource) it.next(); - handleElementChanged(info, nextResource, monitor); - } - return; - } - super.doSynchronize(element, monitor); - } - - /** - * @generated - */ - @Override - protected void doSaveDocument(IProgressMonitor monitor, Object element, - IDocument document, boolean overwrite) throws CoreException { - CachedResourceSetInfo info = getResourceSetInfo(element); - if (info != null) { - if (!overwrite && !info.isSynchronized()) { - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - IResourceStatus.OUT_OF_SYNC_LOCAL, - Messages.UMLDocumentProvider_UnsynchronizedFileSaveError, - null)); - } - info.stopResourceListening(); - fireElementStateChanging(element); - List resources = info.getResourceSet().getResources(); - try { - monitor.beginTask(Messages.UMLDocumentProvider_SaveDiagramTask, - resources.size() + 1); //"Saving diagram" - for (Iterator it = resources.iterator(); it.hasNext();) { - Resource nextResource = (Resource) it.next(); - monitor.setTaskName(NLS.bind( - Messages.UMLDocumentProvider_SaveNextResourceTask, - nextResource.getURI())); - if (nextResource.isLoaded() - && !info.getEditingDomain() - .isReadOnly(nextResource)) { - try { - nextResource.save(UMLDiagramEditorUtil - .getSaveOptions()); - } catch (IOException e) { - fireElementStateChangeFailed(element); - throw new CoreException(new Status(IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - EditorStatusCodes.RESOURCE_FAILURE, e - .getLocalizedMessage(), null)); - } - } - monitor.worked(1); - } - monitor.done(); - info.setModificationStamp(computeModificationStamp(info)); - } catch (RuntimeException x) { - fireElementStateChangeFailed(element); - throw x; - } finally { - info.startResourceListening(); - } - } else { - URI newResoruceURI; - List affectedFiles = null; - if (element instanceof FileEditorInput) { - IFile newFile = ((FileEditorInput) element).getFile(); - affectedFiles = Collections.singletonList(newFile); - newResoruceURI = URI.createPlatformResourceURI(newFile - .getFullPath().toString(), true); - } else if (element instanceof URIEditorInput) { - newResoruceURI = ((URIEditorInput) element).getURI(); - } else { - fireElementStateChangeFailed(element); - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - NLS - .bind( - Messages.UMLDocumentProvider_IncorrectInputError, - new Object[] { - element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$ - null)); - } - if (false == document instanceof IDiagramDocument) { - fireElementStateChangeFailed(element); - throw new CoreException( - new Status( - IStatus.ERROR, - UMLDiagramEditorPlugin.ID, - 0, - "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$ - } - IDiagramDocument diagramDocument = (IDiagramDocument) document; - final Resource newResource = diagramDocument.getEditingDomain() - .getResourceSet().createResource(newResoruceURI); - final Diagram diagramCopy = (Diagram) EcoreUtil - .copy(diagramDocument.getDiagram()); - try { - new AbstractTransactionalCommand(diagramDocument - .getEditingDomain(), NLS.bind( - Messages.UMLDocumentProvider_SaveAsOperation, - diagramCopy.getName()), affectedFiles) { - protected CommandResult doExecuteWithResult( - IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - newResource.getContents().add(diagramCopy); - return CommandResult.newOKCommandResult(); - } - }.execute(monitor, null); - newResource.save(UMLDiagramEditorUtil.getSaveOptions()); - } catch (ExecutionException e) { - fireElementStateChangeFailed(element); - throw new CoreException(new Status(IStatus.ERROR, - UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), - null)); - } catch (IOException e) { - fireElementStateChangeFailed(element); - throw new CoreException(new Status(IStatus.ERROR, - UMLDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), - null)); - } - newResource.unload(); - } - } - - /** - * @generated - */ - @Override - protected void handleElementChanged(CachedResourceSetInfo info, - Resource changedResource, IProgressMonitor monitor) { - IFile file = WorkspaceSynchronizer.getFile(changedResource); - if (file != null) { - try { - file.refreshLocal(IResource.DEPTH_INFINITE, monitor); - } catch (CoreException ex) { - UMLDiagramEditorPlugin - .getInstance() - .logError( - Messages.UMLDocumentProvider_handleElementContentChanged, - ex); - // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged - } - } - changedResource.unload(); - - fireElementContentAboutToBeReplaced(info.getEditorInput()); - removeUnchangedElementListeners(info.getEditorInput(), info); - info.fStatus = null; - try { - setDocumentContent(info.fDocument, info.getEditorInput()); - } catch (CoreException e) { - info.fStatus = e.getStatus(); - } - if (!info.fCanBeSaved) { - info.setModificationStamp(computeModificationStamp(info)); - } - addUnchangedElementListeners(info.getEditorInput(), info); - fireElementContentReplaced(info.getEditorInput()); - } - - /** - * @generated - */ - @Override - protected void handleElementMoved(IEditorInput input, URI uri) { - if (input instanceof FileEditorInput) { - IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile( - new Path(URI.decode(uri.path())).removeFirstSegments(1)); - fireElementMoved(input, newFile == null ? null - : new FileEditorInput(newFile)); - return; - } - // TODO: append suffix to the URI! (use diagram as a parameter) - fireElementMoved(input, new URIEditorInput(uri)); - } - - /** - * @generated - */ - public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, - TransactionalEditingDomain domain) { - return editorInput; - } - - /** - * @generated - */ - public IDiagramDocument getDiagramDocument(Object element) { - IDocument doc = getDocument(element); - if (doc instanceof IDiagramDocument) { - return (IDiagramDocument) doc; - } - return null; - } - - /** - * @generated - */ - @Override - protected IRunnableContext getOperationRunner(IProgressMonitor monitor) { - return null; - } - - /** - * @generated - */ - @Override - protected String getEditingDomainID() { - return "es.cv.gvcase.mdt.uml2.diagram.SharedEditingDomainID"; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDomainModelElementTester.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDomainModelElementTester.java deleted file mode 100644 index a5c5ddc9d0a..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLDomainModelElementTester.java +++ /dev/null @@ -1,778 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.uml2.uml.UMLPackage; - -/** - * @generated - */ -public class UMLDomainModelElementTester extends PropertyTester { - - /** - * @generated - */ - public boolean test(Object receiver, String method, Object[] args, - Object expectedValue) { - if (false == receiver instanceof EObject) { - return false; - } - EObject eObject = (EObject) receiver; - EClass eClass = eObject.eClass(); - if (eClass == UMLPackage.eINSTANCE.getComment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPackage()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPackageableElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getNamedElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDependency()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDirectedRelationship()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRelationship()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getNamespace()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getElementImport()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPackageImport()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConstraint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getValueSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTypedElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getType()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAssociation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClassifier()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRedefinableElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTemplateableElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTemplateBinding()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTemplateSignature()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTemplateParameter()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getParameterableElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTemplateParameterSubstitution()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getGeneralization()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getGeneralizationSet()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getFeature()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSubstitution()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRealization()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAbstraction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOpaqueExpression()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getParameter()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMultiplicityElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConnectableElement()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE - .getConnectableElementTemplateParameter()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConnectorEnd()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProperty()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDeploymentTarget()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDeployment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDeployedArtifact()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDeploymentSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getArtifact()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getManifestation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOperation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getBehavioralFeature()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getBehavior()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClass_()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getBehavioredClassifier()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInterfaceRealization()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInterface()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReception()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSignal()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProtocolStateMachine()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStateMachine()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRegion()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getVertex()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTransition()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTrigger()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPort()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getState()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConnectionPointReference()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPseudostate()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProtocolConformance()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getEncapsulatedClassifier()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStructuredClassifier()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConnector()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExtension()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExtensionEnd()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStereotype()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getImage()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProfile()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getModel()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getParameterSet()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDataType()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOperationTemplateParameter()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStructuralFeature()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCollaborationUse()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCollaboration()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getUseCase()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInclude()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExtend()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExtensionPoint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRedefinableTemplateSignature()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClassifierTemplateParameter()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStringExpression()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExpression()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getUsage()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPackageMerge()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProfileApplication()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getEnumeration()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getEnumerationLiteral()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInstanceSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSlot()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPrimitiveType()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralInteger()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralString()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralBoolean()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralNull()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInstanceValue()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLiteralUnlimitedNatural()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOpaqueBehavior()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getFunctionBehavior()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOpaqueAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExecutableNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStructuredActivityNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityGroup()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivity()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getVariable()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityEdge()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityPartition()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInterruptibleActivityRegion()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExceptionHandler()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getObjectNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOutputPin()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPin()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInputPin()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCallAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInvocationAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSendSignalAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCallOperationAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCallBehaviorAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSequenceNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getControlNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getControlFlow()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInitialNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityParameterNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getValuePin()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMessage()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMessageEnd()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInteraction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInteractionFragment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLifeline()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getPartDecomposition()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInteractionUse()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getGate()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getGeneralOrdering()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getOccurrenceSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInteractionOperand()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInteractionConstraint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExecutionSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStateInvariant()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActionExecutionSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getBehaviorExecutionSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExecutionEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCreationEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDestructionEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSendOperationEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMessageEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSendSignalEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMessageOccurrenceSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE - .getExecutionOccurrenceSpecification()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReceiveOperationEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReceiveSignalEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActor()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCallEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getChangeEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSignalEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAnyReceiveEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getForkNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getFlowFinalNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getFinalNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCentralBufferNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getMergeNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDecisionNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActivityFinalNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getComponentRealization()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getComponent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCommunicationPath()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDevice()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExecutionEnvironment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCombinedFragment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getContinuation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConsiderIgnoreFragment()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCreateObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDestroyObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTestIdentityAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadSelfAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStructuralFeatureAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadStructuralFeatureAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getWriteStructuralFeatureAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClearStructuralFeatureAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE - .getRemoveStructuralFeatureValueAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAddStructuralFeatureValueAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLinkAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLinkEndData()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getQualifierValue()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadLinkAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLinkEndCreationData()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCreateLinkAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getWriteLinkAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDestroyLinkAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLinkEndDestructionData()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClearAssociationAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getBroadcastSignalAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getSendObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getValueSpecificationAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTimeExpression()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getObservation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDuration()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDurationInterval()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInterval()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTimeConstraint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getIntervalConstraint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTimeInterval()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDurationConstraint()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTimeObservation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDurationObservation()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getFinalState()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getTimeEvent()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getVariableAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadVariableAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getWriteVariableAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClearVariableAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAddVariableValueAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRemoveVariableValueAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getRaiseExceptionAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getActionInputPin()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInformationItem()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getInformationFlow()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadExtentAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReclassifyObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadIsClassifiedObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getStartClassifierBehaviorAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReadLinkObjectEndAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE - .getReadLinkObjectEndQualifierAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getCreateLinkObjectAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAcceptEventAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAcceptCallAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReplyAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getUnmarshallAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getReduceAction()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getJoinNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getDataStoreNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getObjectFlow()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getConditionalNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getClause()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getLoopNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExpansionNode()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getExpansionRegion()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getProtocolTransition()) { - return true; - } - if (eClass == UMLPackage.eINSTANCE.getAssociationClass()) { - return true; - } - return false; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLElementChooserDialog.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLElementChooserDialog.java deleted file mode 100644 index 414b2c19004..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLElementChooserDialog.java +++ /dev/null @@ -1,416 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.Collections; -import java.util.Iterator; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.util.FeatureMap; -import org.eclipse.emf.edit.provider.IWrapperItemProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.diagram.core.services.ViewService; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * @generated - */ -public class UMLElementChooserDialog extends Dialog { - - /** - * @generated - */ - private TreeViewer myTreeViewer; - - /** - * @generated - */ - private URI mySelectedModelElementURI; - - /** - * @generated - */ - private View myView; - - /** - * @generated - */ - private TransactionalEditingDomain myEditingDomain = GMFEditingDomainFactory.INSTANCE - .createEditingDomain(); - - /** - * @generated - */ - public UMLElementChooserDialog(Shell parentShell, View view) { - super(parentShell); - setShellStyle(getShellStyle() | SWT.RESIZE); - myView = view; - } - - /** - * @generated - */ - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - getShell().setText( - Messages.UMLElementChooserDialog_SelectModelElementTitle); - createModelBrowser(composite); - return composite; - } - - /** - * @generated - */ - @Override - protected Control createButtonBar(Composite parent) { - Control buttonBar = super.createButtonBar(parent); - setOkButtonEnabled(false); - return buttonBar; - } - - /** - * @generated - */ - private void createModelBrowser(Composite composite) { - myTreeViewer = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL - | SWT.V_SCROLL | SWT.BORDER); - GridData layoutData = new GridData(GridData.FILL_BOTH); - layoutData.heightHint = 300; - layoutData.widthHint = 300; - myTreeViewer.getTree().setLayoutData(layoutData); - myTreeViewer.setContentProvider(new ModelElementsTreeContentProvider()); - myTreeViewer.setLabelProvider(new ModelElementsTreeLabelProvider()); - myTreeViewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); - myTreeViewer.addFilter(new ModelFilesFilter()); - myTreeViewer.addSelectionChangedListener(new OkButtonEnabler()); - } - - /** - * @generated - */ - private void setOkButtonEnabled(boolean enabled) { - getButton(IDialogConstants.OK_ID).setEnabled(enabled); - } - - /** - * @generated - */ - private boolean isValidModelFile(IFile file) { - String fileExtension = file.getFullPath().getFileExtension(); - return "uml".equals(fileExtension); //$NON-NLS-1$ - } - - /** - * @generated - */ - public URI getSelectedModelElementURI() { - return mySelectedModelElementURI; - } - - /** - * @generated - */ - @Override - public int open() { - int result = super.open(); - for (Iterator it = myEditingDomain.getResourceSet().getResources() - .iterator(); it.hasNext();) { - Resource resource = (Resource) it.next(); - resource.unload(); - } - myEditingDomain.dispose(); - return result; - } - - /** - * @generated - */ - private class ModelElementsTreeContentProvider implements - ITreeContentProvider { - - /** - * @generated - */ - private ITreeContentProvider myWorkbenchContentProvider = new WorkbenchContentProvider(); - - /** - * @generated - */ - private AdapterFactoryContentProvider myAdapterFctoryContentProvier = new AdapterFactoryContentProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - - /** - * @generated - */ - public Object[] getChildren(Object parentElement) { - Object[] result = myWorkbenchContentProvider - .getChildren(parentElement); - if (result != null && result.length > 0) { - return result; - } - if (parentElement instanceof IFile) { - IFile modelFile = (IFile) parentElement; - IPath resourcePath = modelFile.getFullPath(); - ResourceSet resourceSet = myEditingDomain.getResourceSet(); - try { - Resource modelResource = resourceSet.getResource(URI - .createPlatformResourceURI(resourcePath.toString(), - true), true); - return myAdapterFctoryContentProvier - .getChildren(modelResource); - } catch (WrappedException e) { - UMLDiagramEditorPlugin - .getInstance() - .logError( - "Unable to load resource: " + resourcePath.toString(), e); //$NON-NLS-1$ - } - return Collections.EMPTY_LIST.toArray(); - } - return myAdapterFctoryContentProvier.getChildren(parentElement); - } - - /** - * @generated - */ - public Object getParent(Object element) { - Object parent = myWorkbenchContentProvider.getParent(element); - if (parent != null) { - return parent; - } - if (element instanceof EObject) { - EObject eObject = (EObject) element; - if (eObject.eContainer() == null - && eObject.eResource().getURI().isFile()) { - String path = eObject.eResource().getURI().path(); - return ResourcesPlugin.getWorkspace().getRoot() - .getFileForLocation(new Path(path)); - } - return myAdapterFctoryContentProvier.getParent(eObject); - } - return null; - } - - /** - * @generated - */ - public boolean hasChildren(Object element) { - if (element instanceof IFile) { - return isValidModelFile((IFile) element); - } - return myWorkbenchContentProvider.hasChildren(element) - || myAdapterFctoryContentProvier.hasChildren(element); - } - - /** - * @generated - */ - public Object[] getElements(Object inputElement) { - Object[] elements = myWorkbenchContentProvider - .getElements(inputElement); - return elements; - } - - /** - * @generated - */ - public void dispose() { - myWorkbenchContentProvider.dispose(); - myAdapterFctoryContentProvier.dispose(); - } - - /** - * @generated - */ - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - myWorkbenchContentProvider.inputChanged(viewer, oldInput, newInput); - myAdapterFctoryContentProvier.inputChanged(viewer, oldInput, - newInput); - } - - } - - /** - * @generated - */ - private class ModelElementsTreeLabelProvider implements ILabelProvider { - - /** - * @generated - */ - private WorkbenchLabelProvider myWorkbenchLabelProvider = new WorkbenchLabelProvider(); - - /** - * @generated - */ - private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - - /** - * @generated - */ - public Image getImage(Object element) { - Image result = myWorkbenchLabelProvider.getImage(element); - return result != null ? result : myAdapterFactoryLabelProvider - .getImage(element); - } - - /** - * @generated - */ - public String getText(Object element) { - String result = myWorkbenchLabelProvider.getText(element); - return result != null && result.length() > 0 ? result - : myAdapterFactoryLabelProvider.getText(element); - } - - /** - * @generated - */ - public void addListener(ILabelProviderListener listener) { - myWorkbenchLabelProvider.addListener(listener); - myAdapterFactoryLabelProvider.addListener(listener); - } - - /** - * @generated - */ - public void dispose() { - myWorkbenchLabelProvider.dispose(); - myAdapterFactoryLabelProvider.dispose(); - } - - /** - * @generated - */ - public boolean isLabelProperty(Object element, String property) { - return myWorkbenchLabelProvider.isLabelProperty(element, property) - || myAdapterFactoryLabelProvider.isLabelProperty(element, - property); - } - - /** - * @generated - */ - public void removeListener(ILabelProviderListener listener) { - myWorkbenchLabelProvider.removeListener(listener); - myAdapterFactoryLabelProvider.removeListener(listener); - } - - } - - /** - * @generated - */ - private class ModelFilesFilter extends ViewerFilter { - - /** - * @generated - */ - @Override - public boolean select(Viewer viewer, Object parentElement, - Object element) { - if (element instanceof IContainer) { - return true; - } - if (element instanceof IFile) { - IFile file = (IFile) element; - return isValidModelFile(file); - } - return true; - } - - } - - /** - * @generated - */ - private class OkButtonEnabler implements ISelectionChangedListener { - - /** - * @generated - */ - public void selectionChanged(SelectionChangedEvent event) { - if (event.getSelection() instanceof IStructuredSelection) { - IStructuredSelection selection = (IStructuredSelection) event - .getSelection(); - if (selection.size() == 1) { - Object selectedElement = selection.getFirstElement(); - if (selectedElement instanceof IWrapperItemProvider) { - selectedElement = ((IWrapperItemProvider) selectedElement) - .getValue(); - } - if (selectedElement instanceof FeatureMap.Entry) { - selectedElement = ((FeatureMap.Entry) selectedElement) - .getValue(); - } - if (selectedElement instanceof EObject) { - EObject selectedModelElement = (EObject) selectedElement; - setOkButtonEnabled(ViewService - .getInstance() - .provides( - Node.class, - new EObjectAdapter(selectedModelElement), - myView, - null, - ViewUtil.APPEND, - true, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT)); - mySelectedModelElementURI = EcoreUtil - .getURI(selectedModelElement); - return; - } - } - } - mySelectedModelElementURI = null; - setOkButtonEnabled(false); - } - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLInitDiagramFileAction.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLInitDiagramFileAction.java deleted file mode 100644 index c91711a7faa..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLInitDiagramFileAction.java +++ /dev/null @@ -1,109 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.resources.IFile; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.common.util.WrappedException; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLInitDiagramFileAction implements IObjectActionDelegate { - - /** - * @generated - */ - private IWorkbenchPart targetPart; - - /** - * @generated - */ - private URI domainModelURI; - - /** - * @generated - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - this.targetPart = targetPart; - } - - /** - * @generated - */ - public void selectionChanged(IAction action, ISelection selection) { - domainModelURI = null; - action.setEnabled(false); - if (selection instanceof IStructuredSelection == false - || selection.isEmpty()) { - return; - } - IFile file = (IFile) ((IStructuredSelection) selection) - .getFirstElement(); - domainModelURI = URI.createPlatformResourceURI(file.getFullPath() - .toString(), true); - action.setEnabled(true); - } - - /** - * @generated - */ - private Shell getShell() { - return targetPart.getSite().getShell(); - } - - /** - * @generated - */ - public void run(IAction action) { - TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE - .createEditingDomain(); - ResourceSet resourceSet = editingDomain.getResourceSet(); - EObject diagramRoot = null; - try { - Resource resource = resourceSet.getResource(domainModelURI, true); - diagramRoot = (EObject) resource.getContents().get(0); - } catch (WrappedException ex) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$ - } - if (diagramRoot == null) { - MessageDialog - .openError( - getShell(), - Messages.UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle, - Messages.UMLInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage); - return; - } - Wizard wizard = new UMLNewDiagramFileWizard(domainModelURI, - diagramRoot, editingDomain); - wizard.setWindowTitle(NLS.bind( - Messages.UMLInitDiagramFileAction_InitDiagramFileWizardTitle, - PackageEditPart.MODEL_ID)); - UMLDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$ - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLinkDescriptor.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLinkDescriptor.java deleted file mode 100644 index c91672a69e0..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLinkDescriptor.java +++ /dev/null @@ -1,104 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; - -/** - * @generated - */ -@SuppressWarnings("unchecked") -public class UMLLinkDescriptor extends UMLNodeDescriptor { - - /** - * @generated - */ - private EObject mySource; - - /** - * @generated - */ - private EObject myDestination; - - /** - * @generated - */ - private IAdaptable mySemanticAdapter; - - /** - * @generated - */ - private UMLLinkDescriptor(EObject source, EObject destination, - EObject linkElement, int linkVID) { - super(linkElement, linkVID); - mySource = source; - myDestination = destination; - } - - /** - * @generated - */ - public UMLLinkDescriptor(EObject source, EObject destination, - IElementType elementType, int linkVID) { - this(source, destination, (EObject) null, linkVID); - final IElementType elementTypeCopy = elementType; - mySemanticAdapter = new IAdaptable() { - public Object getAdapter(Class adapter) { - if (IElementType.class.equals(adapter)) { - return elementTypeCopy; - } - return null; - } - }; - } - - /** - * @generated - */ - public UMLLinkDescriptor(EObject source, EObject destination, - EObject linkElement, IElementType elementType, int linkVID) { - this(source, destination, linkElement, linkVID); - final IElementType elementTypeCopy = elementType; - mySemanticAdapter = new EObjectAdapter(linkElement) { - public Object getAdapter(Class adapter) { - if (IElementType.class.equals(adapter)) { - return elementTypeCopy; - } - return super.getAdapter(adapter); - } - }; - } - - /** - * @generated - */ - public EObject getSource() { - return mySource; - } - - /** - * @generated - */ - public EObject getDestination() { - return myDestination; - } - - /** - * @generated - */ - public IAdaptable getSemanticAdapter() { - return mySemanticAdapter; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLoadResourceAction.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLoadResourceAction.java deleted file mode 100644 index 29cadb90c65..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLLoadResourceAction.java +++ /dev/null @@ -1,77 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLLoadResourceAction implements IObjectActionDelegate { - - /** - * @generated - */ - private PackageEditPart mySelectedElement; - - /** - * @generated - */ - private Shell myShell; - - /** - * @generated - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - myShell = targetPart.getSite().getShell(); - } - - /** - * @generated - */ - public void run(IAction action) { - LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog( - myShell, mySelectedElement.getEditingDomain()); - loadResourceDialog.open(); - } - - /** - * @generated - */ - public void selectionChanged(IAction action, ISelection selection) { - mySelectedElement = null; - if (selection instanceof IStructuredSelection) { - IStructuredSelection structuredSelection = (IStructuredSelection) selection; - if (structuredSelection.size() == 1 - && structuredSelection.getFirstElement() instanceof PackageEditPart) { - mySelectedElement = (PackageEditPart) structuredSelection - .getFirstElement(); - } - } - action.setEnabled(isEnabled()); - } - - /** - * @generated - */ - private boolean isEnabled() { - return mySelectedElement != null; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLMatchingStrategy.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLMatchingStrategy.java deleted file mode 100644 index 371ab79cc04..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLMatchingStrategy.java +++ /dev/null @@ -1,75 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.emf.common.ui.URIEditorInput; -import org.eclipse.emf.common.util.URI; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorMatchingStrategy; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.PartInitException; - -import org.eclipse.papyrus.diagram.common.part.CachedResourcesDiagramEditor; -import org.eclipse.papyrus.diagram.common.part.CachedResourcesEditorInput; -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.util.URIUtil; - -/** - * @generated - */ -public class UMLMatchingStrategy implements IEditorMatchingStrategy { - - /** - * @generated - */ - public boolean matches(IEditorReference editorRef, IEditorInput newInput) { - IEditorInput oldInput; - try { - oldInput = editorRef.getEditorInput(); - } catch (PartInitException e) { - return false; - } - - boolean openInNewEditor = false; - - CachedResourcesEditorInput newCachedEditorInput = null; - if (newInput instanceof CachedResourcesEditorInput) { - newCachedEditorInput = (CachedResourcesEditorInput) newInput; - openInNewEditor = newCachedEditorInput.isOpenInNewEditor(); - } - - if (openInNewEditor) { - // we want to open in a new editor, alas if the IEditorInput is - // exactly the same (the same resource AND diagram) we can reuse - // this editor - if (CachedResourcesEditorInput.checkSameEditorInputWithFragment( - oldInput, newCachedEditorInput)) { - return true; - } - return false; - } - - // get real URIs for both the old input ant the new input - CachedResourcesDiagramEditor editor = MDTUtil - .getCachedResourcesDiagramEditorFromEditorRef(editorRef); - String editorID = editor != null ? editor.getEditorID() : null; - URI oldUri = URIUtil.getUri(oldInput, editorID); - URI newUri = URIUtil.getUri(newInput, editorID); - - if (oldUri != null && newUri != null) { - return oldUri.equals(newUri); - } - - return false; - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNewDiagramFileWizard.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNewDiagramFileWizard.java deleted file mode 100644 index 88bb517afad..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNewDiagramFileWizard.java +++ /dev/null @@ -1,242 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.operations.OperationHistoryFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -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.ResourceSet; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.gmf.runtime.common.core.command.CommandResult; -import org.eclipse.gmf.runtime.diagram.core.services.ViewService; -import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation; -import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.jface.viewers.IBaseLabelProvider; -import org.eclipse.jface.viewers.IContentProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.osgi.util.NLS; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; - -import org.eclipse.papyrus.diagram.common.dialogs.SelectModelElementsForDiagramDialog; -import org.eclipse.papyrus.diagram.common.util.DiagramEditPartsUtil; -import org.eclipse.papyrus.diagram.common.util.MultiDiagramUtil; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ -public class UMLNewDiagramFileWizard extends Wizard { - - /** - * @generated - */ - private WizardNewFileCreationPage myFileCreationPage; - - /** - * @generated - */ - private ModelElementSelectionPage diagramRootElementSelectionPage; - - /** - * @generated - */ - private SelectModelElementsForDiagramDialog diagramElementsSelectionPage; - - /** - * @generated - */ - private TransactionalEditingDomain myEditingDomain; - - /** - * @generated - */ - public UMLNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, - TransactionalEditingDomain editingDomain) { - assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$ - assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$ - assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$ - - myFileCreationPage = new WizardNewFileCreationPage( - Messages.UMLNewDiagramFileWizard_CreationPageName, - StructuredSelection.EMPTY); - myFileCreationPage - .setTitle(Messages.UMLNewDiagramFileWizard_CreationPageTitle); - myFileCreationPage.setDescription(NLS.bind( - Messages.UMLNewDiagramFileWizard_CreationPageDescription, - PackageEditPart.MODEL_ID)); - IPath filePath; - String fileName = domainModelURI.trimFileExtension().lastSegment(); - if (domainModelURI.isPlatformResource()) { - filePath = new Path(domainModelURI.trimSegments(1) - .toPlatformString(true)); - } else if (domainModelURI.isFile()) { - filePath = new Path(domainModelURI.trimSegments(1).toFileString()); - } else { - // TODO : use some default path - throw new IllegalArgumentException( - "Unsupported URI: " + domainModelURI); //$NON-NLS-1$ - } - myFileCreationPage.setContainerFullPath(filePath); - myFileCreationPage.setFileName(UMLDiagramEditorUtil.getUniqueFileName( - filePath, fileName, "sequenceuml_diagram")); //$NON-NLS-1$ - - diagramRootElementSelectionPage = new DiagramRootElementSelectionPage( - Messages.UMLNewDiagramFileWizard_RootSelectionPageName); - diagramRootElementSelectionPage - .setTitle(Messages.UMLNewDiagramFileWizard_RootSelectionPageTitle); - diagramRootElementSelectionPage - .setDescription(Messages.UMLNewDiagramFileWizard_RootSelectionPageDescription); - diagramRootElementSelectionPage.setModelElement(diagramRoot); - - IBaseLabelProvider labelProvider = new AdapterFactoryLabelProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - IContentProvider contentProvider = new AdapterFactoryContentProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - diagramElementsSelectionPage = new SelectModelElementsForDiagramDialog( - diagramRootElementSelectionPage, contentProvider, labelProvider); - - myEditingDomain = editingDomain; - } - - /** - * @generated - */ - @Override - public void addPages() { - addPage(myFileCreationPage); - addPage(diagramRootElementSelectionPage); - addPage(diagramElementsSelectionPage); - } - - /** - * @generated - */ - @Override - public boolean performFinish() { - List affectedFiles = new LinkedList(); - IFile diagramFile = myFileCreationPage.createNewFile(); - UMLDiagramEditorUtil.setCharset(diagramFile); - affectedFiles.add(diagramFile); - URI diagramModelURI = URI.createPlatformResourceURI(diagramFile - .getFullPath().toString(), true); - ResourceSet resourceSet = myEditingDomain.getResourceSet(); - final Resource diagramResource = resourceSet - .createResource(diagramModelURI); - AbstractTransactionalCommand command = new AbstractTransactionalCommand( - myEditingDomain, - Messages.UMLNewDiagramFileWizard_InitDiagramCommand, - affectedFiles) { - - protected CommandResult doExecuteWithResult( - IProgressMonitor monitor, IAdaptable info) - throws ExecutionException { - int diagramVID = UMLVisualIDRegistry - .getDiagramVisualID(diagramRootElementSelectionPage - .getModelElement()); - if (diagramVID != PackageEditPart.VISUAL_ID) { - return CommandResult - .newErrorCommandResult(Messages.UMLNewDiagramFileWizard_IncorrectRootError); - } - Diagram diagram = ViewService.createDiagram( - diagramRootElementSelectionPage.getModelElement(), - PackageEditPart.MODEL_ID, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT); - diagramResource.getContents().add(diagram); - addReferencedEObjectsToDiagram(diagram); - return CommandResult.newOKCommandResult(); - } - - private void addReferencedEObjectsToDiagram(Diagram diagram) { - for (EObject eObject : diagramElementsSelectionPage - .getSelectedEObjects()) { - MultiDiagramUtil.AddEAnnotationReferenceToDiagram( - diagram, eObject); - } - } - }; - try { - OperationHistoryFactory.getOperationHistory().execute(command, - new NullProgressMonitor(), null); - diagramResource.save(UMLDiagramEditorUtil.getSaveOptions()); - UMLDiagramEditorUtil.openDiagram(diagramResource); - } catch (ExecutionException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to create model and diagram", e); //$NON-NLS-1$ - } catch (IOException ex) { - UMLDiagramEditorPlugin.getInstance().logError( - "Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$ - } catch (PartInitException ex) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to open editor", ex); //$NON-NLS-1$ - } - return true; - } - - /** - * @generated - */ - private static class DiagramRootElementSelectionPage extends - ModelElementSelectionPage { - - /** - * @generated - */ - protected DiagramRootElementSelectionPage(String pageName) { - super(pageName); - } - - /** - * @generated - */ - @Override - protected String getSelectionTitle() { - return Messages.UMLNewDiagramFileWizard_RootSelectionPageSelectionTitle; - } - - /** - * @generated - */ - @Override - protected boolean validatePage() { - if (selectedModelElement == null) { - setErrorMessage(Messages.UMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage); - return false; - } - boolean result = ViewService.getInstance().provides( - new CreateDiagramViewOperation(new EObjectAdapter( - selectedModelElement), PackageEditPart.MODEL_ID, - UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT)); - setErrorMessage(result ? null - : Messages.UMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage); - return result; - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNodeDescriptor.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNodeDescriptor.java deleted file mode 100644 index efb72ef2c57..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLNodeDescriptor.java +++ /dev/null @@ -1,68 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.emf.ecore.EObject; - -/** - * @generated - */ -@SuppressWarnings("unchecked") -public class UMLNodeDescriptor { - - /** - * @generated - */ - private EObject myModelElement; - - /** - * @generated - */ - private int myVisualID; - - /** - * @generated - */ - private String myType; - - /** - * @generated - */ - public UMLNodeDescriptor(EObject modelElement, int visualID) { - myModelElement = modelElement; - myVisualID = visualID; - } - - /** - * @generated - */ - public EObject getModelElement() { - return myModelElement; - } - - /** - * @generated - */ - public int getVisualID() { - return myVisualID; - } - - /** - * @generated - */ - public String getType() { - if (myType == null) { - myType = UMLVisualIDRegistry.getType(getVisualID()); - } - return myType; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLPaletteFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLPaletteFactory.java deleted file mode 100644 index f6ceab469db..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLPaletteFactory.java +++ /dev/null @@ -1,336 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gef.Tool; -import org.eclipse.gef.palette.PaletteContainer; -import org.eclipse.gef.palette.PaletteDrawer; -import org.eclipse.gef.palette.PaletteRoot; -import org.eclipse.gef.palette.PaletteSeparator; -import org.eclipse.gef.palette.ToolEntry; -import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool; -import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool; - -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ -public class UMLPaletteFactory { - - /** - * @generated - */ - public void fillPalette(PaletteRoot paletteRoot) { - paletteRoot.add(createInteraction1Group()); - paletteRoot.add(createObjects2Group()); - paletteRoot.add(createMessages3Group()); - paletteRoot.add(createComments4Group()); - } - - /** - * Creates "Interaction" palette tool group - * @generated - */ - private PaletteContainer createInteraction1Group() { - PaletteDrawer paletteContainer = new PaletteDrawer( - Messages.Interaction1Group_title); - paletteContainer.setDescription(Messages.Interaction1Group_desc); - paletteContainer.add(createInteraction1CreationTool()); - return paletteContainer; - } - - /** - * Creates "Objects" palette tool group - * @generated - */ - private PaletteContainer createObjects2Group() { - PaletteDrawer paletteContainer = new PaletteDrawer( - Messages.Objects2Group_title); - paletteContainer.setDescription(Messages.Objects2Group_desc); - paletteContainer.add(createLifeline1CreationTool()); - paletteContainer.add(createExecutionBehaviour2CreationTool()); - paletteContainer.add(createCombinedFragment3CreationTool()); - return paletteContainer; - } - - /** - * Creates "Messages" palette tool group - * @generated - */ - private PaletteContainer createMessages3Group() { - PaletteDrawer paletteContainer = new PaletteDrawer( - Messages.Messages3Group_title); - paletteContainer.add(createCallsynch1CreationTool()); - paletteContainer.add(createCallasynch2CreationTool()); - paletteContainer.add(createReply3CreationTool()); - paletteContainer.add(new PaletteSeparator()); - paletteContainer.add(createSendSignal5CreationTool()); - paletteContainer.add(createCreationEvent6CreationTool()); - paletteContainer.add(createDestructionEvent7CreationTool()); - return paletteContainer; - } - - /** - * Creates "Comments" palette tool group - * @generated - */ - private PaletteContainer createComments4Group() { - PaletteDrawer paletteContainer = new PaletteDrawer( - Messages.Comments4Group_title); - paletteContainer.add(createComment1CreationTool()); - paletteContainer.add(createCommentLink2CreationTool()); - return paletteContainer; - } - - /** - * @generated - */ - private ToolEntry createInteraction1CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2); - types.add(UMLElementTypes.Interaction_1001); - types.add(UMLElementTypes.Interaction_2001); - NodeToolEntry entry = new NodeToolEntry( - Messages.Interaction1CreationTool_title, - Messages.Interaction1CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Interaction_1001)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createLifeline1CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Lifeline_2002); - NodeToolEntry entry = new NodeToolEntry( - Messages.Lifeline1CreationTool_title, - Messages.Lifeline1CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Lifeline_2002)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createExecutionBehaviour2CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.BehaviorExecutionSpecification_2003); - NodeToolEntry entry = new NodeToolEntry( - Messages.ExecutionBehaviour2CreationTool_title, - Messages.ExecutionBehaviour2CreationTool_desc, types); - entry - .setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.BehaviorExecutionSpecification_2003)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createCombinedFragment3CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.CombinedFragment_2004); - NodeToolEntry entry = new NodeToolEntry( - Messages.CombinedFragment3CreationTool_title, - Messages.CombinedFragment3CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.CombinedFragment_2004)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createCallsynch1CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3001); - LinkToolEntry entry = new LinkToolEntry( - Messages.Callsynch1CreationTool_title, - Messages.Callsynch1CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3001)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createCallasynch2CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3002); - LinkToolEntry entry = new LinkToolEntry( - Messages.Callasynch2CreationTool_title, - Messages.Callasynch2CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3002)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createReply3CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3003); - LinkToolEntry entry = new LinkToolEntry( - Messages.Reply3CreationTool_title, - Messages.Reply3CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3003)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createSendSignal5CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3004); - LinkToolEntry entry = new LinkToolEntry( - Messages.SendSignal5CreationTool_title, null, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3004)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createCreationEvent6CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3005); - LinkToolEntry entry = new LinkToolEntry( - Messages.CreationEvent6CreationTool_title, null, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3005)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createDestructionEvent7CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Message_3006); - LinkToolEntry entry = new LinkToolEntry( - Messages.DestructionEvent7CreationTool_title, null, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Message_3006)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createComment1CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(1); - types.add(UMLElementTypes.Comment_2005); - NodeToolEntry entry = new NodeToolEntry( - Messages.Comment1CreationTool_title, - Messages.Comment1CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.Comment_2005)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private ToolEntry createCommentLink2CreationTool() { - List/*<IElementType>*/types = new ArrayList/*<IElementType>*/(2); - types.add(UMLElementTypes.ElementOwnedComment_3007); - types.add(UMLElementTypes.CommentAnnotatedElement_3008); - LinkToolEntry entry = new LinkToolEntry( - Messages.CommentLink2CreationTool_title, - Messages.CommentLink2CreationTool_desc, types); - entry.setSmallIcon(UMLElementTypes - .getImageDescriptor(UMLElementTypes.ElementOwnedComment_3007)); - entry.setLargeIcon(entry.getSmallIcon()); - return entry; - } - - /** - * @generated - */ - private static class NodeToolEntry extends ToolEntry { - - /** - * @generated - */ - private final List elementTypes; - - /** - * @generated - */ - private NodeToolEntry(String title, String description, - List elementTypes) { - super(title, description, null, null); - this.elementTypes = elementTypes; - } - - /** - * @generated - */ - @Override - public Tool createTool() { - Tool tool = new UnspecifiedTypeCreationTool(elementTypes); - tool.setProperties(getToolProperties()); - return tool; - } - } - - /** - * @generated - */ - private static class LinkToolEntry extends ToolEntry { - - /** - * @generated - */ - private final List relationshipTypes; - - /** - * @generated - */ - private LinkToolEntry(String title, String description, - List relationshipTypes) { - super(title, description, null, null); - this.relationshipTypes = relationshipTypes; - } - - /** - * @generated - */ - @Override - public Tool createTool() { - Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes); - tool.setProperties(getToolProperties()); - return tool; - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLSequenceDiagramForMultiEditor.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLSequenceDiagramForMultiEditor.java deleted file mode 100644 index 6f76e1480b5..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLSequenceDiagramForMultiEditor.java +++ /dev/null @@ -1,246 +0,0 @@ -/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.diagram.sequence.part;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.l10n.EditorMessages;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.core.adaptor.gmf.GmfEditorContext;
-import org.eclipse.papyrus.core.editor.BackboneException;
-import org.eclipse.papyrus.core.extension.editorcontext.IEditorContext;
-import org.eclipse.papyrus.core.extension.editorcontext.IEditorContextRegistry;
-import org.eclipse.papyrus.core.services.ServiceException;
-import org.eclipse.papyrus.core.services.ServicesRegistry;
-import org.eclipse.papyrus.core.utils.EditorUtils;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-
-/**
- * The Class UMLSequenceDiagramForMultiEditor.
- */
-public class UMLSequenceDiagramForMultiEditor extends UMLDiagramEditor {
-
- /** The diagram. */
- private Diagram diagram = null;
-
- /** The context. */
- private GmfEditorContext context = null;
-
- /**
- * The location of diagram icon in the plug-in
- */
- private static final String DIAG_IMG_PATH = "icons/SequenceDiagram.gif";
-
- /**
- * The image descriptor of the diagram icon
- */
- private static final ImageDescriptor DIAG_IMG_DESC = UMLDiagramEditorPlugin.getBundledImageDescriptor(UMLSequenceDiagramForMultiEditor.DIAG_IMG_PATH);
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved from the ServiceRegistry.
- *
- * @throws BackboneException
- * @throws ServiceException
- *
- * @generated NOT
- */
- public UMLSequenceDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException {
- super();
- this.diagram = diagram;
-// ServicesRegistry servicesRegistry = EditorUtils.getServiceRegistry();
- IEditorContextRegistry contextRegistry;
- contextRegistry = (IEditorContextRegistry) servicesRegistry.getService(IEditorContextRegistry.class);
-
- // Get the context by its ID
- this.context = (GmfEditorContext) contextRegistry.getContext(GmfEditorContext.GMF_CONTEXT_ID);
-
- // overrides editing domain created by super constructor
-
- setDocumentProvider(context.getDocumentProvider());
- System.err.println(this.getClass().getName());
- }
-
- /**
- * Instantiates a new uML sequence diagram for multi editor.
- *
- * @param diagram
- * the diagram
- * @param context
- * the context
- */
- public UMLSequenceDiagramForMultiEditor(Object diagram, IEditorContext context) {
- this((Diagram) diagram, (GmfEditorContext) context);
- }
-
- /**
- * Instantiates a new uML sequence diagram for multi editor.
- *
- * @param diagram
- * the diagram
- * @param context
- * the context
- */
- public UMLSequenceDiagramForMultiEditor(Diagram diagram, GmfEditorContext context) {
- super();
- this.diagram = diagram;
- this.context = context;
- setDocumentProvider(context.getDocumentProvider());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Diagram getDiagram() {
- return diagram;
- }
-
- /**
- * Sets the diagram.
- *
- * @param diagram
- * the new diagram
- */
- public void setDiagram(Diagram diagram) {
- this.diagram = diagram;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- final protected IDocumentProvider getDocumentProvider(IEditorInput input) {
- if (input instanceof IFileEditorInput || input instanceof URIEditorInput) {
- return context.getDocumentProvider();
- }
- return super.getDocumentProvider(input);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setDocumentProvider(IEditorInput input) {
- if (input instanceof IFileEditorInput || input instanceof URIEditorInput) {
- setDocumentProvider(context.getDocumentProvider());
- } else {
- super.setDocumentProvider(input);
- }
- }
-
- /**
- * Configures the diagram with the parent Multi editor shared command stack
- */
- @Override
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- DiagramEditDomain editDomain = (DiagramEditDomain) getDiagramEditDomain();
-
- if (editDomain != null) {
- editDomain.setCommandStack(context.getDiagramEditDomain().getDiagramCommandStack());
- editDomain.setActionManager(editDomain.getActionManager());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- setPartName(getDiagram().getName());
- setTitleImage(DIAG_IMG_DESC.createImage());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setInput(IEditorInput input) {
- try {
- // We are in a nested editor.
- // Provide an URI with fragment in order to reuse the same Resource
- // and to
- // set the diagram to the fragment.
- // First, compute the URI
- URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(diagram));
- System.err.println(this.getClass().getSimpleName() + ".setInput(" + uriInput.toString() + ")");
- doSetInput(uriInput, true);
- } catch (CoreException x) {
- String title = EditorMessages.Editor_error_setinput_title;
- String msg = EditorMessages.Editor_error_setinput_message;
- Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
-
- }
-
- /**
- * Gets the shared objects.
- *
- * @return the shared objects
- */
- public GmfEditorContext getSharedObjects() {
- return context;
- }
-
- /**
- * Sets the shared object.
- *
- * @param parentEditor
- * the new shared object
- */
- public void setSharedObject(GmfEditorContext parentEditor) {
- this.context = parentEditor;
- }
-
- /** The splitter. */
- Composite splitter;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createGraphicalViewer(Composite parent) {
- System.out.println("store Composite " + parent);
- splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setFocus() {
- splitter.setFocus();
- super.setFocus();
- }
-
-}
diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLShortcutPropertyTester.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLShortcutPropertyTester.java deleted file mode 100644 index e37113bfa5b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLShortcutPropertyTester.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; - -/** - * @generated - */ - -public class UMLShortcutPropertyTester extends PropertyTester { - - /** - * @generated - */ - protected static final String SHORTCUT_PROPERTY = "isShortcut"; //$NON-NLS-1$ - - /** - * @generated - */ - public boolean test(Object receiver, String method, Object[] args, - Object expectedValue) { - if (false == receiver instanceof View) { - return false; - } - View view = (View) receiver; - if (SHORTCUT_PROPERTY.equals(method)) { - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - return PackageEditPart.MODEL_ID.equals(annotation.getDetails() - .get("modelID")); //$NON-NLS-1$ - } - } - return false; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLUriEditorInputTester.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLUriEditorInputTester.java deleted file mode 100644 index 82aab8e1c08..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLUriEditorInputTester.java +++ /dev/null @@ -1,34 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.emf.common.ui.URIEditorInput; - -/** - * @generated - */ -public class UMLUriEditorInputTester extends PropertyTester { - - /** - * @generated - */ - public boolean test(Object receiver, String method, Object[] args, - Object expectedValue) { - if (false == receiver instanceof URIEditorInput) { - return false; - } - URIEditorInput editorInput = (URIEditorInput) receiver; - return "sequenceuml_diagram".equals(editorInput.getURI().fileExtension())//$NON-NLS-1$ - ; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLVisualIDRegistry.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLVisualIDRegistry.java deleted file mode 100644 index 3c2b434768f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/UMLVisualIDRegistry.java +++ /dev/null @@ -1,617 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.part; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.Package; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.providers.ViewInfo; -import org.eclipse.papyrus.diagram.common.providers.ViewInfoRegistry; -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLAbstractExpression; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLOCLFactory; - -/** - * This registry is used to determine which type of visual object should be - * created for the corresponding Diagram, Node, ChildNode or Link represented - * by a domain model object. - * - * @generated - */ -public class UMLVisualIDRegistry { - - /** - * @generated - */ - private static final String DEBUG_KEY = "org.eclipse.papyrus.diagram.sequence/debug/visualID"; //$NON-NLS-1$ - - /** - * @generated - */ - private static UMLAbstractExpression Message_3001_Constraint; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3002_Constraint; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3003_Constraint; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3004_Constraint; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3005_Constraint; - - /** - * @generated - */ - private static UMLAbstractExpression Message_3006_Constraint; - - /** - * @generated - */ - public static int getVisualID(View view) { - if (view instanceof Diagram) { - if (PackageEditPart.MODEL_ID.equals(view.getType())) { - return PackageEditPart.VISUAL_ID; - } else { - return -1; - } - } - return org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry - .getVisualID(view.getType()); - } - - /** - * @generated - */ - public static String getModelID(View view) { - View diagram = view.getDiagram(); - while (view != diagram) { - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - return (String) annotation.getDetails().get("modelID"); //$NON-NLS-1$ - } - view = (View) view.eContainer(); - } - return diagram != null ? diagram.getType() : null; - } - - /** - * @generated - */ - public static int getVisualID(String type) { - try { - return Integer.parseInt(type); - } catch (NumberFormatException e) { - if (Boolean.TRUE.toString().equalsIgnoreCase( - Platform.getDebugOption(DEBUG_KEY))) { - UMLDiagramEditorPlugin.getInstance().logError( - "Unable to parse view type as a visualID number: " - + type); - } - } - return -1; - } - - /** - * @generated - */ - public static String getType(int visualID) { - return String.valueOf(visualID); - } - - /** - * @generated - */ - public static int getDiagramVisualID(EObject domainElement) { - if (domainElement == null) { - return -1; - } - if (UMLPackage.eINSTANCE.getPackage().isSuperTypeOf( - domainElement.eClass()) - && isDiagram((Package) domainElement)) { - return PackageEditPart.VISUAL_ID; - } - - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass()) - && isDiagram((Interaction) domainElement)) { - return PackageEditPart.VISUAL_ID; - } - - return -1; - } - - /** - * @generated - */ - public static int getNodeVisualID(View containerView, EObject domainElement) { - if (domainElement == null) { - return -1; - } - String containerModelID = org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry - .getModelID(containerView); - if (!PackageEditPart.MODEL_ID.equals(containerModelID) - && !"UMLSequence".equals(containerModelID)) { //$NON-NLS-1$ - return -1; - } - int containerVisualID; - if (PackageEditPart.MODEL_ID.equals(containerModelID)) { - containerVisualID = org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry - .getVisualID(containerView); - } else { - if (containerView instanceof Diagram) { - containerVisualID = PackageEditPart.VISUAL_ID; - } else { - return -1; - } - } - switch (containerVisualID) { - case LifelineEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getBehaviorExecutionSpecification() - .isSuperTypeOf(domainElement.eClass())) { - return BehaviorExecutionSpecificationEditPart.VISUAL_ID; - } - break; - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - break; - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - break; - case PackageEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return InteractionEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf( - domainElement.eClass())) { - return CommentEditPart.VISUAL_ID; - } - break; - } - return -1; - } - - /** - * @generated - */ - public static boolean canCreateNode(View containerView, int nodeVisualID) { - String containerModelID = org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry - .getModelID(containerView); - if (!PackageEditPart.MODEL_ID.equals(containerModelID) - && !"UMLSequence".equals(containerModelID)) { //$NON-NLS-1$ - return false; - } - int containerVisualID; - if (PackageEditPart.MODEL_ID.equals(containerModelID)) { - containerVisualID = org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry - .getVisualID(containerView); - } else { - if (containerView instanceof Diagram) { - containerVisualID = PackageEditPart.VISUAL_ID; - } else { - return false; - } - } - switch (containerVisualID) { - case InteractionEditPart.VISUAL_ID: - if (InteractionNameEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (InteractionInteractionCompartmentEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case CommentEditPart.VISUAL_ID: - if (CommentBodyEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Interaction2EditPart.VISUAL_ID: - if (InteractionName2EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (InteractionInteractionCompartment2EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case LifelineEditPart.VISUAL_ID: - if (LifelineNameEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (BehaviorExecutionSpecificationEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case CombinedFragmentEditPart.VISUAL_ID: - if (CombinedFragmentInteractionOperatorEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - if (Interaction2EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (LifelineEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - if (Interaction2EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (LifelineEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (CombinedFragmentEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case PackageEditPart.VISUAL_ID: - if (InteractionEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - if (CommentEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case MessageEditPart.VISUAL_ID: - if (MessageNameEditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Message2EditPart.VISUAL_ID: - if (MessageName2EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Message3EditPart.VISUAL_ID: - if (MessageName3EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Message4EditPart.VISUAL_ID: - if (MessageName4EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Message5EditPart.VISUAL_ID: - if (MessageName5EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - case Message6EditPart.VISUAL_ID: - if (MessageName6EditPart.VISUAL_ID == nodeVisualID) { - return true; - } - break; - } - return false; - } - - /** - * @generated - */ - public static int getLinkWithClassVisualID(EObject domainElement) { - if (domainElement == null) { - return -1; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3001((Message) domainElement)) { - return MessageEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3002((Message) domainElement)) { - return Message2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3003((Message) domainElement)) { - return Message3EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3004((Message) domainElement)) { - return Message4EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3005((Message) domainElement)) { - return Message5EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getMessage().isSuperTypeOf( - domainElement.eClass()) - && isMessage_3006((Message) domainElement)) { - return Message6EditPart.VISUAL_ID; - } - return -1; - } - - /** - * User can change implementation of this method to handle some specific - * situations not covered by default logic. - * - * @generated - */ - private static boolean isDiagram(Package element) { - return true; - } - - /** - * @generated - */ - private static boolean isDiagram(Interaction element) { - return true; - } - - /** - * @generated - */ - private static boolean isMessage_3001(Message domainElement) { - if (Message_3001_Constraint == null) { // lazy initialization - Message_3001_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::synchCall", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3001_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - private static boolean isMessage_3002(Message domainElement) { - if (Message_3002_Constraint == null) { // lazy initialization - Message_3002_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::asynchCall", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3002_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - private static boolean isMessage_3003(Message domainElement) { - if (Message_3003_Constraint == null) { // lazy initialization - Message_3003_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::reply", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3003_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - private static boolean isMessage_3004(Message domainElement) { - if (Message_3004_Constraint == null) { // lazy initialization - Message_3004_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::asynchSignal", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3004_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - private static boolean isMessage_3005(Message domainElement) { - if (Message_3005_Constraint == null) { // lazy initialization - Message_3005_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::createMessage", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3005_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - private static boolean isMessage_3006(Message domainElement) { - if (Message_3006_Constraint == null) { // lazy initialization - Message_3006_Constraint = UMLOCLFactory - .getExpression( - "self.messageSort=MessageSort::deleteMessage", UMLPackage.eINSTANCE.getMessage()); //$NON-NLS-1$ - } - Object result = Message_3006_Constraint.evaluate(domainElement); - return result instanceof Boolean && ((Boolean) result).booleanValue(); - } - - /** - * @generated - */ - protected static boolean hasViewChild(View containerView, - EObject domainElement, int visualId) { - if (domainElement == null) { - return false; - } - for (Object next : containerView.getChildren()) { - View nextView = (View) next; - if (domainElement.equals(nextView.getElement()) - && getType(visualId).equals(nextView.getType())) { - return true; - } - } - return false; - } - - /** - * @generated - */ - public static int getChildDescriptorVisualID(UMLNodeDescriptor container, - EObject domainElement) { - if (domainElement == null) { - return -1; - } - switch (container.getVisualID()) { - case InteractionEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - break; - case Interaction2EditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - break; - case LifelineEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getBehaviorExecutionSpecification() - .isSuperTypeOf(domainElement.eClass())) { - return BehaviorExecutionSpecificationEditPart.VISUAL_ID; - } - break; - case PackageEditPart.VISUAL_ID: - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return InteractionEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf( - domainElement.eClass())) { - return CommentEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf( - domainElement.eClass())) { - return Interaction2EditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf( - domainElement.eClass())) { - return LifelineEditPart.VISUAL_ID; - } - if (UMLPackage.eINSTANCE.getCombinedFragment().isSuperTypeOf( - domainElement.eClass())) { - return CombinedFragmentEditPart.VISUAL_ID; - } - break; - } - return -1; - } - - /** - * @generated - */ - private static ViewInfo diagramViewInfo = null; - - /** - * @generated - */ - public static ViewInfo getDiagramViewInfo() { - if (diagramViewInfo == null) { - diagramViewInfo = ViewInfoRegistry.getInstance() - .getHeadViewInfoForEditor(UMLDiagramEditor.ID); - } - return diagramViewInfo; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ValidateAction.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ValidateAction.java deleted file mode 100644 index 492791d06f3..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/part/ValidateAction.java +++ /dev/null @@ -1,303 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.part; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.util.Diagnostician; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.emf.validation.model.EvaluationMode; -import org.eclipse.emf.validation.model.IConstraintStatus; -import org.eclipse.emf.validation.service.IBatchValidator; -import org.eclipse.emf.validation.service.ModelValidationService; -import org.eclipse.emf.workspace.util.WorkspaceSynchronizer; -import org.eclipse.gef.EditPartViewer; -import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor; -import org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory; -import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; -import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart; -import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation; - -import org.eclipse.papyrus.diagram.sequence.providers.UMLMarkerNavigationProvider; -import org.eclipse.papyrus.diagram.sequence.providers.UMLValidationProvider; - -/** - * @generated - */ - -public class ValidateAction extends Action { - - /** - * @generated - */ - public static final String VALIDATE_ACTION_KEY = "validateAction"; //$NON-NLS-1$ - - /** - * @generated - */ - private IWorkbenchPartDescriptor workbenchPartDescriptor; - - /** - * @generated - */ - public ValidateAction(IWorkbenchPartDescriptor workbenchPartDescriptor) { - setId(VALIDATE_ACTION_KEY); - setText(Messages.ValidateActionMessage); - this.workbenchPartDescriptor = workbenchPartDescriptor; - } - - /** - * @generated - */ - public void run() { - IWorkbenchPart workbenchPart = workbenchPartDescriptor.getPartPage() - .getActivePart(); - if (workbenchPart instanceof IDiagramWorkbenchPart) { - final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) workbenchPart; - try { - new WorkspaceModifyDelegatingOperation( - new IRunnableWithProgress() { - - public void run(IProgressMonitor monitor) - throws InterruptedException, - InvocationTargetException { - runValidation(part.getDiagramEditPart(), part - .getDiagram()); - } - }).run(new NullProgressMonitor()); - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Validation action failed", e); //$NON-NLS-1$ - } - } - } - - /** - * @generated - */ - public static void runValidation(View view) { - try { - if (UMLDiagramEditorUtil.openDiagram(view.eResource())) { - IEditorPart editorPart = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getActivePage() - .getActiveEditor(); - if (editorPart instanceof IDiagramWorkbenchPart) { - runValidation(((IDiagramWorkbenchPart) editorPart) - .getDiagramEditPart(), view); - } else { - runNonUIValidation(view); - } - } - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Validation action failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void runNonUIValidation(View view) { - DiagramEditPart diagramEditPart = OffscreenEditPartFactory - .getInstance().createDiagramEditPart(view.getDiagram()); - runValidation(diagramEditPart, view); - } - - /** - * @generated - */ - public static void runValidation(DiagramEditPart diagramEditPart, View view) { - final DiagramEditPart fpart = diagramEditPart; - final View fview = view; - TransactionalEditingDomain txDomain = TransactionUtil - .getEditingDomain(view); - UMLValidationProvider.runWithConstraints(txDomain, new Runnable() { - - public void run() { - validate(fpart, fview); - } - }); - } - - /** - * @generated - */ - private static Diagnostic runEMFValidator(View target) { - if (target.isSetElement() && target.getElement() != null) { - return new Diagnostician() { - - public String getObjectLabel(EObject eObject) { - return EMFCoreUtil.getQualifiedName(eObject, true); - } - }.validate(target.getElement()); - } - return Diagnostic.OK_INSTANCE; - } - - /** - * @generated - */ - private static void validate(DiagramEditPart diagramEditPart, View view) { - IFile target = view.eResource() != null ? WorkspaceSynchronizer - .getFile(view.eResource()) : null; - if (target != null) { - UMLMarkerNavigationProvider.deleteMarkers(target); - } - Diagnostic diagnostic = runEMFValidator(view); - createMarkers(target, diagnostic, diagramEditPart); - IBatchValidator validator = (IBatchValidator) ModelValidationService - .getInstance().newValidator(EvaluationMode.BATCH); - validator.setIncludeLiveConstraints(true); - if (view.isSetElement() && view.getElement() != null) { - IStatus status = validator.validate(view.getElement()); - createMarkers(target, status, diagramEditPart); - } - } - - /** - * @generated - */ - private static void createMarkers(IFile target, IStatus validationStatus, - DiagramEditPart diagramEditPart) { - if (validationStatus.isOK()) { - return; - } - final IStatus rootStatus = validationStatus; - List allStatuses = new ArrayList(); - UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap( - diagramEditPart.getDiagramView(), collectTargetElements( - rootStatus, new HashSet(), allStatuses)); - for (Iterator it = allStatuses.iterator(); it.hasNext();) { - IConstraintStatus nextStatus = (IConstraintStatus) it.next(); - View view = UMLDiagramEditorUtil.findView(diagramEditPart, - nextStatus.getTarget(), element2ViewMap); - addMarker(diagramEditPart.getViewer(), target, view.eResource() - .getURIFragment(view), EMFCoreUtil.getQualifiedName( - nextStatus.getTarget(), true), nextStatus.getMessage(), - nextStatus.getSeverity()); - } - } - - /** - * @generated - */ - private static void createMarkers(IFile target, - Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) { - if (emfValidationStatus.getSeverity() == Diagnostic.OK) { - return; - } - final Diagnostic rootStatus = emfValidationStatus; - List allDiagnostics = new ArrayList(); - UMLDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new UMLDiagramEditorUtil.LazyElement2ViewMap( - diagramEditPart.getDiagramView(), collectTargetElements( - rootStatus, new HashSet(), allDiagnostics)); - for (Iterator it = emfValidationStatus.getChildren().iterator(); it - .hasNext();) { - Diagnostic nextDiagnostic = (Diagnostic) it.next(); - List data = nextDiagnostic.getData(); - if (data != null && !data.isEmpty() - && data.get(0) instanceof EObject) { - EObject element = (EObject) data.get(0); - View view = UMLDiagramEditorUtil.findView(diagramEditPart, - element, element2ViewMap); - addMarker( - diagramEditPart.getViewer(), - target, - view.eResource().getURIFragment(view), - EMFCoreUtil.getQualifiedName(element, true), - nextDiagnostic.getMessage(), - diagnosticToStatusSeverity(nextDiagnostic.getSeverity())); - } - } - } - - /** - * @generated - */ - private static void addMarker(EditPartViewer viewer, IFile target, - String elementId, String location, String message, - int statusSeverity) { - if (target == null) { - return; - } - UMLMarkerNavigationProvider.addMarker(target, elementId, location, - message, statusSeverity); - } - - /** - * @generated - */ - private static int diagnosticToStatusSeverity(int diagnosticSeverity) { - if (diagnosticSeverity == Diagnostic.OK) { - return IStatus.OK; - } else if (diagnosticSeverity == Diagnostic.INFO) { - return IStatus.INFO; - } else if (diagnosticSeverity == Diagnostic.WARNING) { - return IStatus.WARNING; - } else if (diagnosticSeverity == Diagnostic.ERROR - || diagnosticSeverity == Diagnostic.CANCEL) { - return IStatus.ERROR; - } - return IStatus.INFO; - } - - /** - * @generated - */ - private static Set collectTargetElements(IStatus status, - Set targetElementCollector, List allConstraintStatuses) { - if (status instanceof IConstraintStatus) { - targetElementCollector - .add(((IConstraintStatus) status).getTarget()); - allConstraintStatuses.add(status); - } - if (status.isMultiStatus()) { - IStatus[] children = status.getChildren(); - for (int i = 0; i < children.length; i++) { - collectTargetElements(children[i], targetElementCollector, - allConstraintStatuses); - } - } - return targetElementCollector; - } - - /** - * @generated - */ - private static Set collectTargetElements(Diagnostic diagnostic, - Set targetElementCollector, List allDiagnostics) { - List data = diagnostic.getData(); - EObject target = null; - if (data != null && !data.isEmpty() && data.get(0) instanceof EObject) { - target = (EObject) data.get(0); - targetElementCollector.add(target); - allDiagnostics.add(diagnostic); - } - if (diagnostic.getChildren() != null - && !diagnostic.getChildren().isEmpty()) { - for (Iterator it = diagnostic.getChildren().iterator(); it - .hasNext();) { - collectTargetElements((Diagnostic) it.next(), - targetElementCollector, allDiagnostics); - } - } - return targetElementCollector; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramAppearancePreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramAppearancePreferencePage.java deleted file mode 100644 index 1f4bf8ac724..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramAppearancePreferencePage.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramAppearancePreferencePage extends AppearancePreferencePage { - - /** - * @generated - */ - public DiagramAppearancePreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java deleted file mode 100644 index 24c12f94cdf..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramConnectionsPreferencePage.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage { - - /** - * @generated - */ - public DiagramConnectionsPreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramGeneralPreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramGeneralPreferencePage.java deleted file mode 100644 index 0ff98d8f525..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramGeneralPreferencePage.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramsPreferencePage; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramGeneralPreferencePage extends DiagramsPreferencePage { - - /** - * @generated - */ - public DiagramGeneralPreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramIconStylePreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramIconStylePreferencePage.java deleted file mode 100644 index 313395e3ee8..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramIconStylePreferencePage.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorReference; -import org.eclipse.ui.IWorkbench; - -import org.eclipse.papyrus.diagram.common.preferences.IconStylePreferencePage; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditor; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.providers.UMLElementTypes; - -/** - * @generated - */ - -public class DiagramIconStylePreferencePage extends IconStylePreferencePage { - /** - * @generated - */ - private IWorkbench myWorkbench; - - /** - * @generated - */ - public DiagramIconStylePreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } - - /** - * @generated - */ - @Override - public void init(IWorkbench workbench) { - super.init(workbench); - myWorkbench = workbench; - } - - /** - * @generated - */ - @Override - public boolean performOk() { - super.performOk(); - UMLElementTypes.refreshImageRegistry(); - refreshDiagramEditors(); - return true; - } - - /** - * @generated - */ - private void refreshDiagramEditors() { - IEditorReference[] editors = myWorkbench.getActiveWorkbenchWindow() - .getActivePage().getEditorReferences(); - for (int i = 0; i < editors.length; i++) { - IEditorPart editor = editors[i].getEditor(false); - if (editor != null && editor instanceof UMLDiagramEditor) { - ((UMLDiagramEditor) editor).refresh(); - } - } - } - - /** - * @generated - */ - @Override - protected void initHelp() { - // TODO Auto-generated method stub - - }; - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPreferenceInitializer.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPreferenceInitializer.java deleted file mode 100644 index 8ee141e0f3d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPreferenceInitializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer { - - /** - * @generated - */ - @Override - public void initializeDefaultPreferences() { - IPreferenceStore store = getPreferenceStore(); - DiagramPrintingPreferencePage.initDefaults(store); - DiagramGeneralPreferencePage.initDefaults(store); - DiagramAppearancePreferencePage.initDefaults(store); - DiagramConnectionsPreferencePage.initDefaults(store); - DiagramRulersAndGridPreferencePage.initDefaults(store); - - DiagramIconStylePreferencePage.initDefaults(store); - - } - - /** - * @generated - */ - protected IPreferenceStore getPreferenceStore() { - return UMLDiagramEditorPlugin.getInstance().getPreferenceStore(); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPrintingPreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPrintingPreferencePage.java deleted file mode 100644 index 7e1a70dbf78..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramPrintingPreferencePage.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramPrintingPreferencePage extends PrintingPreferencePage { - - /** - * @generated - */ - public DiagramPrintingPreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java deleted file mode 100644 index 8d0a377bf85..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/preferences/DiagramRulersAndGridPreferencePage.java +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.preferences; - -import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage { - - /** - * @generated - */ - public DiagramRulersAndGridPreferencePage() { - setPreferenceStore(UMLDiagramEditorPlugin.getInstance() - .getPreferenceStore()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/ElementInitializers.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/ElementInitializers.java deleted file mode 100644 index 3e0e0d3e4e9..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/ElementInitializers.java +++ /dev/null @@ -1,341 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.uml2.uml.BehaviorExecutionSpecification; -import org.eclipse.uml2.uml.CombinedFragment; -import org.eclipse.uml2.uml.Interaction; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.MessageSort; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.actions.LabelHelper; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLAbstractExpression; -import org.eclipse.papyrus.diagram.sequence.expressions.UMLOCLFactory; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class ElementInitializers { - - /** - * @generated - */ - public static void init_Interaction_1001(Interaction instance) { - try { - Object value0 = name_Interaction_1001(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Interaction_2001(Interaction instance) { - try { - Object value0 = name_Interaction_2001(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Lifeline_2002(Lifeline instance) { - try { - Object value0 = name_Lifeline_2002(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_BehaviorExecutionSpecification_2003( - BehaviorExecutionSpecification instance) { - try { - Object value0 = name_BehaviorExecutionSpecification_2003(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_CombinedFragment_2004(CombinedFragment instance) { - try { - Object value0 = name_CombinedFragment_2004(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3001(Message instance) { - try { - Object value0 = name_Message_3001(instance); - instance.setName((String) value0); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3002(Message instance) { - try { - Object value0 = UMLOCLFactory.getExpression( - "MessageSort::asynchCall", - UMLPackage.eINSTANCE.getMessage()).evaluate(instance); - - value0 = UMLAbstractExpression.performCast(value0, - UMLPackage.eINSTANCE.getMessageSort()); - instance.setMessageSort((MessageSort) value0); - Object value1 = name_Message_3002(instance); - instance.setName((String) value1); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3003(Message instance) { - try { - Object value0 = UMLOCLFactory.getExpression("MessageSort::reply", - UMLPackage.eINSTANCE.getMessage()).evaluate(instance); - - value0 = UMLAbstractExpression.performCast(value0, - UMLPackage.eINSTANCE.getMessageSort()); - instance.setMessageSort((MessageSort) value0); - Object value1 = name_Message_3003(instance); - instance.setName((String) value1); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3004(Message instance) { - try { - Object value0 = UMLOCLFactory.getExpression( - "MessageSort::asynchSignal", - UMLPackage.eINSTANCE.getMessage()).evaluate(instance); - - value0 = UMLAbstractExpression.performCast(value0, - UMLPackage.eINSTANCE.getMessageSort()); - instance.setMessageSort((MessageSort) value0); - Object value1 = name_Message_3004(instance); - instance.setName((String) value1); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3005(Message instance) { - try { - Object value0 = UMLOCLFactory.getExpression( - "MessageSort::createMessage", - UMLPackage.eINSTANCE.getMessage()).evaluate(instance); - - value0 = UMLAbstractExpression.performCast(value0, - UMLPackage.eINSTANCE.getMessageSort()); - instance.setMessageSort((MessageSort) value0); - Object value1 = name_Message_3005(instance); - instance.setName((String) value1); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static void init_Message_3006(Message instance) { - try { - Object value0 = UMLOCLFactory.getExpression( - "MessageSort::deleteMessage", - UMLPackage.eINSTANCE.getMessage()).evaluate(instance); - - value0 = UMLAbstractExpression.performCast(value0, - UMLPackage.eINSTANCE.getMessageSort()); - instance.setMessageSort((MessageSort) value0); - Object value1 = name_Message_3006(instance); - instance.setName((String) value1); - } catch (RuntimeException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Element initialization failed", e); //$NON-NLS-1$ - } - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Interaction_1001(Interaction self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Interaction_2001(Interaction self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Lifeline_2002(Lifeline self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_BehaviorExecutionSpecification_2003( - BehaviorExecutionSpecification self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_CombinedFragment_2004(CombinedFragment self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3001(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3002(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3003(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3004(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3005(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } - - /** - * @generated NOT - * - * implementation provided - */ - private static String name_Message_3006(Message self) { - if (self != null && self.eContainer() != null) { - return LabelHelper.INSTANCE.findName(self.eContainer(), self); - } - return ""; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLContributionItemProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLContributionItemProvider.java deleted file mode 100644 index 1293a83493f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLContributionItemProvider.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider; -import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor; -import org.eclipse.gmf.runtime.diagram.ui.printing.actions.PrintPreviewAction; -import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.EnhancedPrintActionHelper; -import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.RenderedPrintPreviewAction; -import org.eclipse.jface.action.IAction; - -/** - * @generated - */ - -public class UMLContributionItemProvider extends - AbstractContributionItemProvider { - - /** - * @generated - */ - protected IAction createAction(String actionId, - IWorkbenchPartDescriptor partDescriptor) { - if (actionId.equals(PrintPreviewAction.ID)) { - return new RenderedPrintPreviewAction( - new EnhancedPrintActionHelper()); - } - return super.createAction(actionId, partDescriptor); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLEditPartProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLEditPartProvider.java deleted file mode 100644 index d092ea9e23c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLEditPartProvider.java +++ /dev/null @@ -1,155 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import java.lang.ref.WeakReference; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.EditPartFactory; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.UMLEditPartFactory; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class UMLEditPartProvider extends AbstractEditPartProvider { - - /** - * @generated - */ - private EditPartFactory factory; - - /** - * @generated - */ - private boolean allowCaching; - - /** - * @generated - */ - private WeakReference cachedPart; - - /** - * @generated - */ - private WeakReference cachedView; - - /** - * @generated - */ - public UMLEditPartProvider() { - setFactory(new UMLEditPartFactory()); - setAllowCaching(true); - } - - /** - * @generated - */ - public final EditPartFactory getFactory() { - return factory; - } - - /** - * @generated - */ - protected void setFactory(EditPartFactory factory) { - this.factory = factory; - } - - /** - * @generated - */ - public final boolean isAllowCaching() { - return allowCaching; - } - - /** - * @generated - */ - protected synchronized void setAllowCaching(boolean allowCaching) { - this.allowCaching = allowCaching; - if (!allowCaching) { - cachedPart = null; - cachedView = null; - } - } - - /** - * @generated - */ - protected IGraphicalEditPart createEditPart(View view) { - EditPart part = factory.createEditPart(null, view); - if (part instanceof IGraphicalEditPart) { - return (IGraphicalEditPart) part; - } - return null; - } - - /** - * @generated - */ - protected IGraphicalEditPart getCachedPart(View view) { - if (cachedView != null && cachedView.get() == view) { - return (IGraphicalEditPart) cachedPart.get(); - } - return null; - } - - /** - * @generated - */ - @Override - public synchronized IGraphicalEditPart createGraphicEditPart(View view) { - if (isAllowCaching()) { - IGraphicalEditPart part = getCachedPart(view); - cachedPart = null; - cachedView = null; - if (part != null) { - return part; - } - } - return createEditPart(view); - } - - /** - * @generated - */ - @Override - public synchronized boolean provides(IOperation operation) { - if (operation instanceof CreateGraphicEditPartOperation) { - View view = ((IEditPartOperation) operation).getView(); - if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(view))) { - return false; - } - if (isAllowCaching() && getCachedPart(view) != null) { - return true; - } - IGraphicalEditPart part = createEditPart(view); - if (part != null) { - if (isAllowCaching()) { - cachedPart = new WeakReference(part); - cachedView = new WeakReference(view); - } - return true; - } - } - return false; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLElementTypes.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLElementTypes.java deleted file mode 100644 index 5e013524c1a..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLElementTypes.java +++ /dev/null @@ -1,334 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import java.util.HashSet; -import java.util.IdentityHashMap; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EClassifier; -import org.eclipse.emf.ecore.ENamedElement; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.uml2.uml.UMLPackage; - -import org.eclipse.papyrus.diagram.common.providers.BaseModelTypeProvider; -import org.eclipse.papyrus.diagram.common.providers.ModelTypesProviderFactory; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditor; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLElementTypes extends ElementInitializers { - - /** - * @generated - */ - private UMLElementTypes() { - } - - /** - * @generated - */ - private static Map elements; - - /** - * @generated - */ - private static ImageRegistry imageRegistry; - - /** - * @generated - */ - private static Set KNOWN_ELEMENT_TYPES; - - /** - * @generated - */ - public static final IHintedType Package_79 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Package_79"); //$NON-NLS-1$ - - /** - * @generated - */ - public static final IHintedType Interaction_1001 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Interaction_1001"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Interaction_2001 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Interaction_2001"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Lifeline_2002 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Lifeline_2002"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType BehaviorExecutionSpecification_2003 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.BehaviorExecutionSpecification_2003"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType CombinedFragment_2004 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.CombinedFragment_2004"); //$NON-NLS-1$ - - /** - * @generated - */ - public static final IHintedType Comment_2005 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Comment_2005"); //$NON-NLS-1$ - - /** - * @generated - */ - public static final IHintedType Message_3001 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3001"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Message_3002 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3002"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Message_3003 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3003"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Message_3004 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3004"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Message_3005 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3005"); //$NON-NLS-1$ - /** - * @generated - */ - public static final IHintedType Message_3006 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.Message_3006"); //$NON-NLS-1$ - - /** - * @generated - */ - public static final IHintedType ElementOwnedComment_3007 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.ElementOwnedComment_3007"); //$NON-NLS-1$ - - /** - * @generated - */ - public static final IHintedType CommentAnnotatedElement_3008 = (IHintedType) getElementType("org.eclipse.papyrus.diagram.sequence.CommentAnnotatedElement_3008"); //$NON-NLS-1$ - - /** - * @generated - */ - private static ImageRegistry getImageRegistry() { - if (imageRegistry == null) { - imageRegistry = new ImageRegistry(); - } - return imageRegistry; - } - - /** - * @generated - */ - private static String getImageRegistryKey(ENamedElement element) { - return element.getName(); - } - - /** - * @generated - */ - private static ImageDescriptor getProvidedImageDescriptor( - ENamedElement element) { - if (element instanceof EStructuralFeature) { - EStructuralFeature feature = ((EStructuralFeature) element); - EClass eContainingClass = feature.getEContainingClass(); - EClassifier eType = feature.getEType(); - if (eContainingClass != null && !eContainingClass.isAbstract()) { - element = eContainingClass; - } else if (eType instanceof EClass - && !((EClass) eType).isAbstract()) { - element = eType; - } - } - if (element instanceof EClass) { - EClass eClass = (EClass) element; - if (!eClass.isAbstract()) { - return UMLDiagramEditorPlugin.getInstance() - .getItemImageDescriptor( - eClass.getEPackage().getEFactoryInstance() - .create(eClass)); - } - } - // TODO : support structural features - return null; - } - - /** - * @generated - */ - public static ImageDescriptor getImageDescriptor(ENamedElement element) { - String key = getImageRegistryKey(element); - ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key); - if (imageDescriptor == null) { - imageDescriptor = getProvidedImageDescriptor(element); - if (imageDescriptor == null) { - imageDescriptor = ImageDescriptor.getMissingImageDescriptor(); - } - getImageRegistry().put(key, imageDescriptor); - } - return imageDescriptor; - } - - /** - * @generated - */ - public static Image getImage(ENamedElement element) { - String key = getImageRegistryKey(element); - Image image = getImageRegistry().get(key); - if (image == null) { - ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element); - if (imageDescriptor == null) { - imageDescriptor = ImageDescriptor.getMissingImageDescriptor(); - } - getImageRegistry().put(key, imageDescriptor); - image = getImageRegistry().get(key); - } - return image; - } - - /** - * @generated - */ - public static ImageDescriptor getImageDescriptor(IAdaptable hint) { - ENamedElement element = getElement(hint); - if (element == null) { - return null; - } - return getImageDescriptor(element); - } - - /** - * @generated - */ - public static Image getImage(IAdaptable hint) { - ENamedElement element = getElement(hint); - if (element == null) { - return null; - } - return getImage(element); - } - - /** - * Returns 'type' of the ecore object associated with the hint. - * - * @generated - */ - public static ENamedElement getElement(IAdaptable hint) { - Object type = hint.getAdapter(IElementType.class); - if (elements == null) { - elements = new IdentityHashMap(); - - elements.put(Package_79, UMLPackage.eINSTANCE.getPackage()); - - elements.put(Interaction_1001, UMLPackage.eINSTANCE - .getInteraction()); - - elements.put(Comment_2005, UMLPackage.eINSTANCE.getComment()); - - elements.put(Interaction_2001, UMLPackage.eINSTANCE - .getInteraction()); - - elements.put(Lifeline_2002, UMLPackage.eINSTANCE.getLifeline()); - - elements.put(BehaviorExecutionSpecification_2003, - UMLPackage.eINSTANCE.getBehaviorExecutionSpecification()); - - elements.put(CombinedFragment_2004, UMLPackage.eINSTANCE - .getCombinedFragment()); - - elements.put(Message_3001, UMLPackage.eINSTANCE.getMessage()); - - elements.put(Message_3002, UMLPackage.eINSTANCE.getMessage()); - - elements.put(Message_3003, UMLPackage.eINSTANCE.getMessage()); - - elements.put(Message_3004, UMLPackage.eINSTANCE.getMessage()); - - elements.put(Message_3005, UMLPackage.eINSTANCE.getMessage()); - - elements.put(Message_3006, UMLPackage.eINSTANCE.getMessage()); - - elements.put(ElementOwnedComment_3007, UMLPackage.eINSTANCE - .getElement_OwnedComment()); - - elements.put(CommentAnnotatedElement_3008, UMLPackage.eINSTANCE - .getComment_AnnotatedElement()); - } - return (ENamedElement) elements.get(type); - } - - /** - * @generated - */ - private static IElementType getElementType(String id) { - return ElementTypeRegistry.getInstance().getType(id); - } - - /** - * @generated - */ - public static boolean isKnownElementType(IElementType elementType) { - if (KNOWN_ELEMENT_TYPES == null) { - KNOWN_ELEMENT_TYPES = new HashSet(); - KNOWN_ELEMENT_TYPES.add(Package_79); - KNOWN_ELEMENT_TYPES.add(Interaction_1001); - KNOWN_ELEMENT_TYPES.add(Comment_2005); - KNOWN_ELEMENT_TYPES.add(Interaction_2001); - KNOWN_ELEMENT_TYPES.add(Lifeline_2002); - KNOWN_ELEMENT_TYPES.add(BehaviorExecutionSpecification_2003); - KNOWN_ELEMENT_TYPES.add(CombinedFragment_2004); - KNOWN_ELEMENT_TYPES.add(Message_3001); - KNOWN_ELEMENT_TYPES.add(Message_3002); - KNOWN_ELEMENT_TYPES.add(Message_3003); - KNOWN_ELEMENT_TYPES.add(Message_3004); - KNOWN_ELEMENT_TYPES.add(Message_3005); - KNOWN_ELEMENT_TYPES.add(Message_3006); - KNOWN_ELEMENT_TYPES.add(ElementOwnedComment_3007); - KNOWN_ELEMENT_TYPES.add(CommentAnnotatedElement_3008); - } - return KNOWN_ELEMENT_TYPES.contains(elementType); - } - - /** - * @generated - */ - public static void refreshImageRegistry() { - if (imageRegistry != null) { - imageRegistry.dispose(); - imageRegistry = null; - } - imageRegistry = new ImageRegistry(); - } - - /** - * @generated - */ - static { - ModelTypesProviderFactory.registerModelTypesProvider( - UMLDiagramEditor.ID, new BaseModelTypeProvider() { - @Override - public Image getImageHelper(IAdaptable hint) { - return getImage(hint); - } - }); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLIconProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLIconProvider.java deleted file mode 100644 index b244240b1cc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLIconProvider.java +++ /dev/null @@ -1,41 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation; -import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider; -import org.eclipse.swt.graphics.Image; - -/** - * @generated - */ -public class UMLIconProvider extends AbstractProvider implements IIconProvider { - - /** - * @generated - */ - public Image getIcon(IAdaptable hint, int flags) { - return UMLElementTypes.getImage(hint); - } - - /** - * @generated - */ - public boolean provides(IOperation operation) { - if (operation instanceof GetIconOperation) { - return ((GetIconOperation) operation).execute(this) != null; - } - return false; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLMarkerNavigationProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLMarkerNavigationProvider.java deleted file mode 100644 index ba078e09acb..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLMarkerNavigationProvider.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.providers; - -import java.util.Arrays; -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor; -import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider; - -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorUtil; - -/** - * @generated - */ - -public class UMLMarkerNavigationProvider extends - AbstractModelMarkerNavigationProvider { - - /** - * @generated - */ - public static final String MARKER_TYPE = UMLDiagramEditorPlugin.ID - + ".diagnostic"; //$NON-NLS-1$ - - /** - * @generated - */ - protected void doGotoMarker(IMarker marker) { - String elementId = marker - .getAttribute( - org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, - null); - if (elementId == null || !(getEditor() instanceof DiagramEditor)) { - return; - } - DiagramEditor editor = (DiagramEditor) getEditor(); - Map editPartRegistry = editor.getDiagramGraphicalViewer() - .getEditPartRegistry(); - EObject targetView = editor.getDiagram().eResource().getEObject( - elementId); - if (targetView == null) { - return; - } - EditPart targetEditPart = (EditPart) editPartRegistry.get(targetView); - if (targetEditPart != null) { - UMLDiagramEditorUtil.selectElementsInDiagram(editor, Arrays - .asList(new EditPart[] { targetEditPart })); - } - } - - /** - * @generated - */ - public static void deleteMarkers(IResource resource) { - try { - resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO); - } catch (CoreException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Failed to delete validation markers", e); //$NON-NLS-1$ - } - } - - /** - * @generated - */ - public static IMarker addMarker(IFile file, String elementId, - String location, String message, int statusSeverity) { - IMarker marker = null; - try { - marker = file.createMarker(MARKER_TYPE); - marker.setAttribute(IMarker.MESSAGE, message); - marker.setAttribute(IMarker.LOCATION, location); - marker - .setAttribute( - org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, - elementId); - int markerSeverity = IMarker.SEVERITY_INFO; - if (statusSeverity == IStatus.WARNING) { - markerSeverity = IMarker.SEVERITY_WARNING; - } else if (statusSeverity == IStatus.ERROR - || statusSeverity == IStatus.CANCEL) { - markerSeverity = IMarker.SEVERITY_ERROR; - } - marker.setAttribute(IMarker.SEVERITY, markerSeverity); - } catch (CoreException e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Failed to create validation marker", e); //$NON-NLS-1$ - } - return marker; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLModelingAssistantProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLModelingAssistantProvider.java deleted file mode 100644 index 2fd74428adc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLModelingAssistantProvider.java +++ /dev/null @@ -1,234 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; -import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider; -import org.eclipse.gmf.runtime.notation.Diagram; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -import org.eclipse.papyrus.diagram.common.providers.assistant.ModelingAssistantRegistry; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.Messages; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditor; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLModelingAssistantProvider extends ModelingAssistantProvider { - - /** - * @generated - */ - @Override - public List getTypesForPopupBar(IAdaptable host) { - IGraphicalEditPart editPart = (IGraphicalEditPart) host - .getAdapter(IGraphicalEditPart.class); - List types = new ArrayList(); - if (editPart instanceof LifelineEditPart) { - types.add(UMLElementTypes.BehaviorExecutionSpecification_2003); - } - if (editPart instanceof InteractionInteractionCompartmentEditPart) { - types.add(UMLElementTypes.Interaction_2001); - types.add(UMLElementTypes.Lifeline_2002); - types.add(UMLElementTypes.CombinedFragment_2004); - } - if (editPart instanceof InteractionInteractionCompartment2EditPart) { - types.add(UMLElementTypes.Interaction_2001); - types.add(UMLElementTypes.Lifeline_2002); - types.add(UMLElementTypes.CombinedFragment_2004); - } - if (editPart instanceof PackageEditPart) { - types.add(UMLElementTypes.Interaction_1001); - types.add(UMLElementTypes.Comment_2005); - } - - types = ModelingAssistantRegistry - .getInstance() - .customizeTypesForEditPart(UMLDiagramEditor.ID, editPart, types); - return types; - } - - /** - * @generated - */ - @Override - public List getRelTypesOnSource(IAdaptable source) { - IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source - .getAdapter(IGraphicalEditPart.class); - if (sourceEditPart instanceof CommentEditPart) { - List types = new ArrayList(); - types.add(UMLElementTypes.CommentAnnotatedElement_3008); - return types; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public List getRelTypesOnTarget(IAdaptable target) { - IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target - .getAdapter(IGraphicalEditPart.class); - if (targetEditPart instanceof CommentEditPart) { - List types = new ArrayList(); - types.add(UMLElementTypes.ElementOwnedComment_3007); - return types; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public List getRelTypesOnSourceAndTarget(IAdaptable source, - IAdaptable target) { - IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source - .getAdapter(IGraphicalEditPart.class); - IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target - .getAdapter(IGraphicalEditPart.class); - if (sourceEditPart instanceof CommentEditPart) { - List types = new ArrayList(); - return types; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public List getTypesForSource(IAdaptable target, - IElementType relationshipType) { - IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target - .getAdapter(IGraphicalEditPart.class); - if (targetEditPart instanceof CommentEditPart) { - List types = new ArrayList(); - return types; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public List getTypesForTarget(IAdaptable source, - IElementType relationshipType) { - IGraphicalEditPart sourceEditPart = (IGraphicalEditPart) source - .getAdapter(IGraphicalEditPart.class); - if (sourceEditPart instanceof CommentEditPart) { - List types = new ArrayList(); - return types; - } - return Collections.EMPTY_LIST; - } - - /** - * @generated - */ - @Override - public EObject selectExistingElementForSource(IAdaptable target, - IElementType relationshipType) { - return selectExistingElement(target, getTypesForSource(target, - relationshipType)); - } - - /** - * @generated - */ - @Override - public EObject selectExistingElementForTarget(IAdaptable source, - IElementType relationshipType) { - return selectExistingElement(source, getTypesForTarget(source, - relationshipType)); - } - - /** - * @generated - */ - protected EObject selectExistingElement(IAdaptable host, Collection types) { - if (types.isEmpty()) { - return null; - } - IGraphicalEditPart editPart = (IGraphicalEditPart) host - .getAdapter(IGraphicalEditPart.class); - if (editPart == null) { - return null; - } - Diagram diagram = (Diagram) editPart.getRoot().getContents().getModel(); - Collection elements = new HashSet(); - for (Iterator it = diagram.getElement().eAllContents(); it.hasNext();) { - EObject element = (EObject) it.next(); - if (isApplicableElement(element, types)) { - elements.add(element); - } - } - if (elements.isEmpty()) { - return null; - } - return selectElement((EObject[]) elements.toArray(new EObject[elements - .size()])); - } - - /** - * @generated - */ - protected boolean isApplicableElement(EObject element, Collection types) { - IElementType type = ElementTypeRegistry.getInstance().getElementType( - element); - return types.contains(type); - } - - /** - * @generated - */ - protected EObject selectElement(EObject[] elements) { - Shell shell = Display.getCurrent().getActiveShell(); - ILabelProvider labelProvider = new AdapterFactoryLabelProvider( - UMLDiagramEditorPlugin.getInstance() - .getItemProvidersAdapterFactory()); - ElementListSelectionDialog dialog = new ElementListSelectionDialog( - shell, labelProvider); - dialog.setMessage(Messages.UMLModelingAssistantProviderMessage); - dialog.setTitle(Messages.UMLModelingAssistantProviderTitle); - dialog.setMultipleSelection(false); - dialog.setElements(elements); - EObject selected = null; - if (dialog.open() == Window.OK) { - selected = (EObject) dialog.getFirstResult(); - } - return selected; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLParserProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLParserProvider.java deleted file mode 100644 index 729dc053719..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLParserProvider.java +++ /dev/null @@ -1,685 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * Javier Muñoz (Prodevelop) - Messages are updated when properties changes - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParser; -import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.uml2.uml.ConnectableElement; -import org.eclipse.uml2.uml.Event; -import org.eclipse.uml2.uml.Lifeline; -import org.eclipse.uml2.uml.Message; -import org.eclipse.uml2.uml.Operation; -import org.eclipse.uml2.uml.Property; -import org.eclipse.uml2.uml.Type; -import org.eclipse.uml2.uml.UMLPackage; -import org.eclipse.uml2.uml.ValueSpecification; - - -import org.eclipse.papyrus.diagram.common.parser.TagsAdderParser; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart; -import org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.util.MessageCommonUtil; - -/** - * @generated - */ -public class UMLParserProvider extends AbstractProvider implements - IParserProvider { - - /** - * @generated - */ - private IParser interactionName_4004Parser; - - /** - * @generated - */ - private IParser getInteractionName_4004Parser() { - if (interactionName_4004Parser == null) { - interactionName_4004Parser = createInteractionName_4004Parser(); - } - return interactionName_4004Parser; - } - - /** - * @generated - */ - protected IParser createInteractionName_4004Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - - MessageFormatParser parser = new MessageFormatParser(features); - parser.setViewPattern("sd: {0} "); - parser.setEditorPattern("{0}"); - parser.setEditPattern("{0}"); - return parser; - } - - /** - * @generated - */ - private IParser commentBody_5003Parser; - - /** - * @generated - */ - private IParser getCommentBody_5003Parser() { - if (commentBody_5003Parser == null) { - commentBody_5003Parser = createCommentBody_5003Parser(); - } - return commentBody_5003Parser; - } - - /** - * @generated - */ - protected IParser createCommentBody_5003Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getComment_Body(), }; - - MessageFormatParser parser = new MessageFormatParser(features); - return parser; - } - - /** - * @generated - */ - private IParser interactionName_4003Parser; - - /** - * @generated - */ - private IParser getInteractionName_4003Parser() { - if (interactionName_4003Parser == null) { - interactionName_4003Parser = createInteractionName_4003Parser(); - } - return interactionName_4003Parser; - } - - /** - * @generated - */ - protected IParser createInteractionName_4003Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - - MessageFormatParser parser = new MessageFormatParser(features); - parser.setViewPattern("sd: {0} "); - parser.setEditorPattern("{0}"); - parser.setEditPattern("{0}"); - return parser; - } - - /** - * @generated - */ - private IParser lifelineName_4001Parser; - - /** - * @generated - */ - private IParser getLifelineName_4001Parser() { - if (lifelineName_4001Parser == null) { - lifelineName_4001Parser = createLifelineName_4001Parser(); - } - return lifelineName_4001Parser; - } - - /** - * @generated NOT - * - * modified to show lifeline name and represents - */ - protected IParser createLifelineName_4001Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - - // Own MessageFormatParser - MessageFormatParser parser = new LifelineLabelFormatParser(features); - parser.setViewPattern("{0}: "); - parser.setEditorPattern("{0}"); - parser.setEditPattern("{0}"); - // Own TagsAdderParser - return new LifelineTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser combinedFragmentInteractionOperator_4002Parser; - - /** - * @generated - */ - private IParser getCombinedFragmentInteractionOperator_4002Parser() { - if (combinedFragmentInteractionOperator_4002Parser == null) { - combinedFragmentInteractionOperator_4002Parser = createCombinedFragmentInteractionOperator_4002Parser(); - } - return combinedFragmentInteractionOperator_4002Parser; - } - - /** - * @generated - */ - protected IParser createCombinedFragmentInteractionOperator_4002Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getCombinedFragment_InteractionOperator(), }; - - MessageFormatParser parser = new MessageFormatParser(features); - return parser; - } - - /** - * @generated - */ - private IParser messageName_4005Parser; - - /** - * @generated - */ - private IParser getMessageName_4005Parser() { - if (messageName_4005Parser == null) { - messageName_4005Parser = createMessageName_4005Parser(); - } - return messageName_4005Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4005Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser messageName_4006Parser; - - /** - * @generated - */ - private IParser getMessageName_4006Parser() { - if (messageName_4006Parser == null) { - messageName_4006Parser = createMessageName_4006Parser(); - } - return messageName_4006Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4006Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser messageName_4007Parser; - - /** - * @generated - */ - private IParser getMessageName_4007Parser() { - if (messageName_4007Parser == null) { - messageName_4007Parser = createMessageName_4007Parser(); - } - return messageName_4007Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4007Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser messageName_4008Parser; - - /** - * @generated - */ - private IParser getMessageName_4008Parser() { - if (messageName_4008Parser == null) { - messageName_4008Parser = createMessageName_4008Parser(); - } - return messageName_4008Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4008Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser messageName_4009Parser; - - /** - * @generated - */ - private IParser getMessageName_4009Parser() { - if (messageName_4009Parser == null) { - messageName_4009Parser = createMessageName_4009Parser(); - } - return messageName_4009Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4009Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - private IParser messageName_4010Parser; - - /** - * @generated - */ - private IParser getMessageName_4010Parser() { - if (messageName_4010Parser == null) { - messageName_4010Parser = createMessageName_4010Parser(); - } - return messageName_4010Parser; - } - - /** - * @generated NOT - */ - protected IParser createMessageName_4010Parser() { - EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE - .getNamedElement_Name(), }; - // Own parser for Message Label - MessageFormatParser parser = new MessageLabelFormatParser(features); - parser.setViewPattern(" {0}"); - parser.setEditorPattern(" {0}"); - parser.setEditPattern("{0}"); - // Own parser to add convenient listeners - return new MessageTagsAdderParser(parser); - } - - /** - * @generated - */ - protected IParser getParser(int visualID) { - switch (visualID) { - case InteractionNameEditPart.VISUAL_ID: - return getInteractionName_4004Parser(); - case CommentBodyEditPart.VISUAL_ID: - return getCommentBody_5003Parser(); - case InteractionName2EditPart.VISUAL_ID: - return getInteractionName_4003Parser(); - case LifelineNameEditPart.VISUAL_ID: - return getLifelineName_4001Parser(); - case CombinedFragmentInteractionOperatorEditPart.VISUAL_ID: - return getCombinedFragmentInteractionOperator_4002Parser(); - case MessageNameEditPart.VISUAL_ID: - return getMessageName_4005Parser(); - case MessageName2EditPart.VISUAL_ID: - return getMessageName_4006Parser(); - case MessageName3EditPart.VISUAL_ID: - return getMessageName_4007Parser(); - case MessageName4EditPart.VISUAL_ID: - return getMessageName_4008Parser(); - case MessageName5EditPart.VISUAL_ID: - return getMessageName_4009Parser(); - case MessageName6EditPart.VISUAL_ID: - return getMessageName_4010Parser(); - } - return null; - } - - /** - * @generated - */ - public IParser getParser(IAdaptable hint) { - String vid = (String) hint.getAdapter(String.class); - if (vid != null) { - return getParser(UMLVisualIDRegistry.getVisualID(vid)); - } - View view = (View) hint.getAdapter(View.class); - if (view != null) { - return getParser(UMLVisualIDRegistry.getVisualID(view)); - } - return null; - } - - /** - * @generated - */ - public boolean provides(IOperation operation) { - if (operation instanceof GetParserOperation) { - IAdaptable hint = ((GetParserOperation) operation).getHint(); - if (UMLElementTypes.getElement(hint) == null) { - return false; - } - return getParser(hint) != null; - } - return false; - } - - /** - * @generated - */ - public static class HintAdapter extends ParserHintAdapter { - - /** - * @generated - */ - private final IElementType elementType; - - /** - * @generated - */ - public HintAdapter(IElementType type, EObject object, String parserHint) { - super(object, parserHint); - assert type != null; - elementType = type; - } - - /** - * @generated - */ - @Override - public Object getAdapter(Class adapter) { - if (IElementType.class.equals(adapter)) { - return elementType; - } - return super.getAdapter(adapter); - } - } - - /** - * - * @NOT-generated - * @author Gabriel Merin Cubero - * - */ - public class MessageLabelFormatParser extends MessageFormatParser { - - public MessageLabelFormatParser(EAttribute[] features) { - super(features); - } - - @Override - public String getPrintString(IAdaptable adapter, int flags) { - String superString = super.getPrintString(adapter, flags); - EObject eObject = (EObject) adapter.getAdapter(EObject.class); - if (eObject instanceof Message) { - Operation op = MessageCommonUtil - .getMessageSendOperation((Message) eObject); - if (op != null) { - superString = MessageCommonUtil.getMessageOperationString( - (Message) eObject, op); - } - } - return superString; - } - - } - - /** - * - * @NOT-generated - * @author Gabriel Merin Cubero - * - */ - public class MessageTagsAdderParser extends TagsAdderParser { - - public MessageTagsAdderParser(IParser parser) { - super(parser); - } - - @Override - public List getSemanticElementsBeingParsed(EObject arg0) { - List eList = new ArrayList(super - .getSemanticElementsBeingParsed(arg0)); - - if (arg0 instanceof Message) { - Message msg = (Message) arg0; - // add the Operation - Operation op = MessageCommonUtil.getMessageSendOperation(msg); - if (op != null) { - eList.add(op); - - // add the Operation Parameters : by jmunoz - eList.addAll(op.getOwnedParameters()); - - // add the event - Event e = MessageCommonUtil.getMessageSendEvent(msg); - eList.add(e); - - // add the MessageArguments - eList.addAll(msg.getArguments()); - } - } - return eList; - } - - @Override - public boolean areSemanticElementsAffected(EObject arg0, Object arg1) { - if (arg1 instanceof Notification) { - Notification event = (Notification) arg1; - - if (event.getNotifier() instanceof ValueSpecification) { - return true; - } - - if (event.getNotifier() instanceof Operation - && UMLPackage.eINSTANCE.getNamedElement_Name().equals( - event.getFeature())) { - return true; - } - - if (event.getNotifier() instanceof Operation - && event.getFeature() == UMLPackage.eINSTANCE - .getBehavioralFeature_OwnedParameter()) { - return true; - } - - if (event.getNotifier() instanceof Event) { - return true; - } - - if (event.getNotifier() instanceof Message) { - return true; - } - - } - return false; - } - - } - - /** - * - * @NOT-generated - * @author Francisco Javier Cano Muñoz, Gabriel Merin Cubero - * - */ - public class LifelineLabelFormatParser extends MessageFormatParser { - - public LifelineLabelFormatParser(EAttribute[] features) { - super(features); - } - - @Override - public String getPrintString(IAdaptable adapter, int flags) { - String superString = super.getPrintString(adapter, flags); - EObject eObject = (EObject) adapter.getAdapter(EObject.class); - if (eObject instanceof Lifeline) { - String representsString = getLifelineRepresents((Lifeline) eObject); - if (representsString != null && representsString.length() > 0) { - superString += ("<" + representsString + ">"); - } - } - return superString; - } - - private String getLifelineRepresents(Lifeline lifeline) { - String represents = ""; - if (lifeline != null) { - ConnectableElement connectableElement = lifeline - .getRepresents(); - if (connectableElement instanceof Property) { - Property property = (Property) connectableElement; - Type type = property.getType(); - if (type != null) { - represents = type.getName(); - } - } - } - return represents; - } - - } - - /** - * - * @NOT-generated - * @author Francisco Javier Cano Muñoz, Gabriel Merin Cubero - * - */ - public class LifelineTagsAdderParser extends TagsAdderParser { - - public LifelineTagsAdderParser(IParser parser) { - super(parser); - } - - @Override - public List getSemanticElementsBeingParsed(EObject arg0) { - List eList = new ArrayList(super - .getSemanticElementsBeingParsed(arg0)); - - if (arg0 instanceof Lifeline) { - Lifeline lifeline = (Lifeline) arg0; - // add the represented element - ConnectableElement connectableElement = lifeline - .getRepresents(); - - if (connectableElement != null - && connectableElement instanceof Property) { - Property property = (Property) connectableElement; - // Listen to changes on the property - eList.add(property); - // Listen to changes on the Type referenced by the property - Type type = property.getType(); - if (type != null) { - eList.add(type); - } - } - } - return eList; - } - - @Override - public boolean areSemanticElementsAffected(EObject arg0, Object arg1) { - if (arg1 instanceof Notification) { - Notification event = (Notification) arg1; - - // Change on a ConnectableElement (Parameter, Property or - // Variable) - if (event.getNotifier() instanceof ConnectableElement - && (UMLPackage.eINSTANCE.getNamedElement_Name().equals( - event.getFeature()) || UMLPackage.eINSTANCE - .getTypedElement_Type().equals( - event.getFeature()))) { - return true; - } - // Change on the represent feature - if (event.getNotifier() instanceof Lifeline - && UMLPackage.eINSTANCE.getLifeline_Represents() - .equals(event.getFeature())) { - return true; - } - } - return super.areSemanticElementsAffected(arg0, arg1); - } - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLShortcutsDecoratorProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLShortcutsDecoratorProvider.java deleted file mode 100644 index 8da23fe5727..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLShortcutsDecoratorProvider.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.common.core.service.AbstractProvider; -import org.eclipse.gmf.runtime.common.core.service.IOperation; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart; -import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart; -import org.eclipse.gmf.runtime.diagram.ui.services.decorator.AbstractDecorator; -import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation; -import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider; -import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.common.draw2d.ManuallyDrawnShortcutDecorator; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ - -public class UMLShortcutsDecoratorProvider extends AbstractProvider implements - IDecoratorProvider { - - /** - * @generated - */ - public static final String SHORTCUTS_DECORATOR_ID = "shortcuts"; //$NON-NLS-1$ - - /** - * @generated - */ - public boolean provides(IOperation operation) { - if (!(operation instanceof CreateDecoratorsOperation)) { - return false; - } - IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation) - .getDecoratorTarget(); - View view = (View) decoratorTarget.getAdapter(View.class); - return view != null - && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(view)); - } - - /** - * @generated - */ - public void createDecorators(IDecoratorTarget decoratorTarget) { - View view = (View) decoratorTarget.getAdapter(View.class); - if (view != null) { - EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$ - if (annotation != null) { - //decoratorTarget.installDecorator(SHORTCUTS_DECORATOR_ID, new ShortcutsDecorator(decoratorTarget)); //this does not work due to #209802 - decoratorTarget.installDecorator(SHORTCUTS_DECORATOR_ID, - new ManuallyDrawnShortcutDecorator(decoratorTarget)); - } - } - } - - /** - * @generated - */ - - protected class ShortcutsDecorator extends AbstractDecorator { - - /** - * @generated - */ - public ShortcutsDecorator(IDecoratorTarget decoratorTarget) { - super(decoratorTarget); - } - - /** - * @generated - */ - public void activate() { - refresh(); - } - - /** - * @generated - */ - public void refresh() { - removeDecoration(); - EditPart editPart = (EditPart) getDecoratorTarget().getAdapter( - EditPart.class); - Image image = UMLDiagramEditorPlugin.getInstance().getBundledImage( - "icons/shortcut.gif"); //$NON-NLS-1$ - if (editPart instanceof ShapeEditPart) { - setDecoration(getDecoratorTarget().addShapeDecoration(image, - IDecoratorTarget.Direction.SOUTH_WEST, 0, false)); - } else if (editPart instanceof ConnectionEditPart) { - setDecoration(getDecoratorTarget().addConnectionDecoration( - image, 50, false)); - } - } - - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLValidationProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLValidationProvider.java deleted file mode 100644 index 5747cadbea5..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLValidationProvider.java +++ /dev/null @@ -1,141 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.validation.AbstractModelConstraint; -import org.eclipse.emf.validation.IValidationContext; -import org.eclipse.emf.validation.model.IClientSelector; -import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.AbstractContributionItemProvider; -import org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor; -import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.uml2.uml.NamedElement; - -import org.eclipse.papyrus.diagram.common.util.MDTUtil; -import org.eclipse.papyrus.diagram.common.providers.ValidationProvider; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.part.ValidateAction; - -/** - * @generated - */ - -public class UMLValidationProvider extends AbstractContributionItemProvider { - - /** - * @generated - */ - private static boolean constraintsActive = false; - - /** - * @generated - */ - public static boolean shouldConstraintsBePrivate() { - return false; - } - - /** - * @generated - */ - public static void runWithConstraints( - TransactionalEditingDomain editingDomain, Runnable operation) { - final Runnable op = operation; - Runnable task = new Runnable() { - public void run() { - try { - constraintsActive = true; - op.run(); - } finally { - constraintsActive = false; - } - } - }; - if (editingDomain != null) { - try { - editingDomain.runExclusive(task); - } catch (Exception e) { - UMLDiagramEditorPlugin.getInstance().logError( - "Validation failed", e); //$NON-NLS-1$ - } - } else { - task.run(); - } - } - - /** - * @generated - */ - protected IAction createAction(String actionId, - IWorkbenchPartDescriptor partDescriptor) { - if (ValidateAction.VALIDATE_ACTION_KEY.equals(actionId)) { - return new ValidateAction(partDescriptor); - } - return super.createAction(actionId, partDescriptor); - } - - /** - * @generated - */ - static boolean isInDefaultEditorContext(Object object) { - if (shouldConstraintsBePrivate() && !constraintsActive) { - return false; - } - if (object instanceof View) { - return constraintsActive - && PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID((View) object)); - } - return true; - } - - /** - * @generated - */ - public static class DefaultCtx implements IClientSelector { - - /** - * @generated - */ - public boolean selects(Object object) { - return isInDefaultEditorContext(object); - } - } - - /** - * @generated - */ - public static class Adapter1 extends AbstractModelConstraint { - - /** - * Implementation provided. - * - * @generated NOT - */ - public IStatus validate(IValidationContext ctx) { - NamedElement context = (NamedElement) ctx.getTarget(); - IStatus status = ValidationProvider.validateUniqueName(context); - if (status.getSeverity() != IStatus.OK) { - // UMLDiagramEditorPlugin.getInstance().getLog().log(status); - IStatusLineManager statusLine = MDTUtil.getStatusLineManager(); - if (statusLine != null) { - statusLine.setMessage(status.getMessage()); - } - return ctx.createFailureStatus(null); - } - return ctx.createSuccessStatus(); - } - } - - /** - * @generated - */ - static String formatElement(EObject object) { - return EMFCoreUtil.getQualifiedName(object, true); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLViewProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLViewProvider.java deleted file mode 100644 index 76e99cf4b24..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/providers/UMLViewProvider.java +++ /dev/null @@ -1,361 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.providers; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider; -import org.eclipse.gmf.runtime.emf.type.core.IElementType; -import org.eclipse.gmf.runtime.emf.type.core.IHintedType; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; -import org.eclipse.papyrus.diagram.sequence.view.factories.BehaviorExecutionSpecificationViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.CombinedFragmentInteractionOperatorViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.CombinedFragmentViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.CommentAnnotatedElementViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.CommentBodyViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.CommentViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.ElementOwnedCommentViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Interaction2ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.InteractionInteractionCompartment2ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.InteractionInteractionCompartmentViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.InteractionName2ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.InteractionNameViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.InteractionViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.LifelineNameViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.LifelineViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Message2ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Message3ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Message4ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Message5ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.Message6ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageName2ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageName3ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageName4ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageName5ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageName6ViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageNameViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.MessageViewFactory; -import org.eclipse.papyrus.diagram.sequence.view.factories.PackageViewFactory; - -/** - * @generated - */ -public class UMLViewProvider extends AbstractViewProvider { - /** - * @generated - */ - @Override - protected Class getDiagramViewClass(IAdaptable semanticAdapter, - String diagramKind) { - EObject semanticElement = getSemanticElement(semanticAdapter); - if (PackageEditPart.MODEL_ID.equals(diagramKind) - && UMLVisualIDRegistry.getDiagramVisualID(semanticElement) != -1) { - return PackageViewFactory.class; - } - return null; - } - - /** - * @generated - */ - @Override - protected Class getNodeViewClass(IAdaptable semanticAdapter, - View containerView, String semanticHint) { - if (containerView == null) { - return null; - } - IElementType elementType = getSemanticElementType(semanticAdapter); - EObject domainElement = getSemanticElement(semanticAdapter); - int visualID; - if (semanticHint == null) { - // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy. - // In this situation there should be NO elementType, visualID will be determined - // by VisualIDRegistry.getNodeVisualID() for domainElement. - if (elementType != null || domainElement == null) { - return null; - } - visualID = UMLVisualIDRegistry.getNodeVisualID(containerView, - domainElement); - } else { - visualID = UMLVisualIDRegistry.getVisualID(semanticHint); - if (elementType != null) { - // Semantic hint is specified together with element type. - // Both parameters should describe exactly the same diagram element. - // In addition we check that visualID returned by VisualIDRegistry.getNodeVisualID() for - // domainElement (if specified) is the same as in element type. - if (!UMLElementTypes.isKnownElementType(elementType) - || (!(elementType instanceof IHintedType))) { - return null; // foreign element type - } - String elementTypeHint = ((IHintedType) elementType) - .getSemanticHint(); - if (!semanticHint.equals(elementTypeHint)) { - return null; // if semantic hint is specified it should be the same as in element type - } - if (domainElement != null - && visualID != UMLVisualIDRegistry.getNodeVisualID( - containerView, domainElement)) { - return null; // visual id for node EClass should match visual id from element type - } - } else { - // Element type is not specified. Domain element should be present. - // This method is called with EObjectAdapter as parameter from: - // - ViewService.createNode(View container, EObject eObject, String type, PreferencesHint preferencesHint) - // - generated ViewFactory.decorateView() for parent element - if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(containerView))) { - return null; // foreign diagram - } - switch (visualID) { - case InteractionEditPart.VISUAL_ID: - case CommentEditPart.VISUAL_ID: - case Interaction2EditPart.VISUAL_ID: - case LifelineEditPart.VISUAL_ID: - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - case CombinedFragmentEditPart.VISUAL_ID: - if (domainElement == null - || visualID != UMLVisualIDRegistry.getNodeVisualID( - containerView, domainElement)) { - return null; // visual id in semantic hint should match visual id for domain element - } - break; - case InteractionNameEditPart.VISUAL_ID: - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - if (InteractionEditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case CommentBodyEditPart.VISUAL_ID: - if (CommentEditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case InteractionName2EditPart.VISUAL_ID: - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - if (Interaction2EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case LifelineNameEditPart.VISUAL_ID: - if (LifelineEditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case CombinedFragmentInteractionOperatorEditPart.VISUAL_ID: - if (CombinedFragmentEditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageNameEditPart.VISUAL_ID: - if (MessageEditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageName2EditPart.VISUAL_ID: - if (Message2EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageName3EditPart.VISUAL_ID: - if (Message3EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageName4EditPart.VISUAL_ID: - if (Message4EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageName5EditPart.VISUAL_ID: - if (Message5EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - case MessageName6EditPart.VISUAL_ID: - if (Message6EditPart.VISUAL_ID != UMLVisualIDRegistry - .getVisualID(containerView) - || containerView.getElement() != domainElement) { - return null; // wrong container - } - break; - default: - return null; - } - } - } - return getNodeViewClass(containerView, visualID); - } - - /** - * @generated - */ - protected Class getNodeViewClass(View containerView, int visualID) { - if (containerView == null - || !UMLVisualIDRegistry.canCreateNode(containerView, visualID)) { - return null; - } - switch (visualID) { - case InteractionEditPart.VISUAL_ID: - return InteractionViewFactory.class; - case InteractionNameEditPart.VISUAL_ID: - return InteractionNameViewFactory.class; - case CommentEditPart.VISUAL_ID: - return CommentViewFactory.class; - case CommentBodyEditPart.VISUAL_ID: - return CommentBodyViewFactory.class; - case Interaction2EditPart.VISUAL_ID: - return Interaction2ViewFactory.class; - case InteractionName2EditPart.VISUAL_ID: - return InteractionName2ViewFactory.class; - case LifelineEditPart.VISUAL_ID: - return LifelineViewFactory.class; - case LifelineNameEditPart.VISUAL_ID: - return LifelineNameViewFactory.class; - case BehaviorExecutionSpecificationEditPart.VISUAL_ID: - return BehaviorExecutionSpecificationViewFactory.class; - case CombinedFragmentEditPart.VISUAL_ID: - return CombinedFragmentViewFactory.class; - case CombinedFragmentInteractionOperatorEditPart.VISUAL_ID: - return CombinedFragmentInteractionOperatorViewFactory.class; - case InteractionInteractionCompartmentEditPart.VISUAL_ID: - return InteractionInteractionCompartmentViewFactory.class; - case InteractionInteractionCompartment2EditPart.VISUAL_ID: - return InteractionInteractionCompartment2ViewFactory.class; - case MessageNameEditPart.VISUAL_ID: - return MessageNameViewFactory.class; - case MessageName2EditPart.VISUAL_ID: - return MessageName2ViewFactory.class; - case MessageName3EditPart.VISUAL_ID: - return MessageName3ViewFactory.class; - case MessageName4EditPart.VISUAL_ID: - return MessageName4ViewFactory.class; - case MessageName5EditPart.VISUAL_ID: - return MessageName5ViewFactory.class; - case MessageName6EditPart.VISUAL_ID: - return MessageName6ViewFactory.class; - } - return null; - } - - /** - * @generated - */ - @Override - protected Class getEdgeViewClass(IAdaptable semanticAdapter, - View containerView, String semanticHint) { - IElementType elementType = getSemanticElementType(semanticAdapter); - if (!UMLElementTypes.isKnownElementType(elementType) - || (!(elementType instanceof IHintedType))) { - return null; // foreign element type - } - String elementTypeHint = ((IHintedType) elementType).getSemanticHint(); - if (elementTypeHint == null) { - return null; // our hint is visual id and must be specified - } - if (semanticHint != null && !semanticHint.equals(elementTypeHint)) { - return null; // if semantic hint is specified it should be the same as in element type - } - int visualID = UMLVisualIDRegistry.getVisualID(elementTypeHint); - EObject domainElement = getSemanticElement(semanticAdapter); - if (domainElement != null - && visualID != UMLVisualIDRegistry - .getLinkWithClassVisualID(domainElement)) { - return null; // visual id for link EClass should match visual id from element type - } - return getEdgeViewClass(visualID); - } - - /** - * @generated - */ - protected Class getEdgeViewClass(int visualID) { - switch (visualID) { - case MessageEditPart.VISUAL_ID: - return MessageViewFactory.class; - case Message2EditPart.VISUAL_ID: - return Message2ViewFactory.class; - case Message3EditPart.VISUAL_ID: - return Message3ViewFactory.class; - case Message4EditPart.VISUAL_ID: - return Message4ViewFactory.class; - case Message5EditPart.VISUAL_ID: - return Message5ViewFactory.class; - case Message6EditPart.VISUAL_ID: - return Message6ViewFactory.class; - case ElementOwnedCommentEditPart.VISUAL_ID: - return ElementOwnedCommentViewFactory.class; - case CommentAnnotatedElementEditPart.VISUAL_ID: - return CommentAnnotatedElementViewFactory.class; - } - return null; - } - - /** - * @generated - */ - private IElementType getSemanticElementType(IAdaptable semanticAdapter) { - if (semanticAdapter == null) { - return null; - } - return (IElementType) semanticAdapter.getAdapter(IElementType.class); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLPropertySection.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLPropertySection.java deleted file mode 100644 index dfd96729056..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLPropertySection.java +++ /dev/null @@ -1,130 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.sheet; - -import java.util.ArrayList; -import java.util.Iterator; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.transaction.TransactionalEditingDomain; -import org.eclipse.emf.transaction.util.TransactionUtil; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.IPropertySourceProvider; - -import org.eclipse.papyrus.diagram.common.sheet.PropertySourceExtension; - -/** - * @generated - */ -public class UMLPropertySection extends AdvancedPropertySection implements - IPropertySourceProvider { - - /** - * @generated - */ - public IPropertySource getPropertySource(Object object) { - if (object instanceof IPropertySource) { - return (IPropertySource) object; - } - AdapterFactory af = getAdapterFactory(object); - if (af != null) { - IItemPropertySource ips = (IItemPropertySource) af.adapt(object, - IItemPropertySource.class); - if (ips != null) { - return new PropertySourceExtension(object, ips, af); - } - } - if (object instanceof IAdaptable) { - return (IPropertySource) ((IAdaptable) object) - .getAdapter(IPropertySource.class); - } - return null; - } - - /** - * @generated - */ - @Override - protected IPropertySourceProvider getPropertySourceProvider() { - return this; - } - - /** - * Modify/unwrap selection. - * @generated - */ - protected Object transformSelection(Object selected) { - - if (selected instanceof EditPart) { - Object model = ((EditPart) selected).getModel(); - return model instanceof View ? ((View) model).getElement() : null; - } - if (selected instanceof View) { - return ((View) selected).getElement(); - } - if (selected instanceof IAdaptable) { - View view = (View) ((IAdaptable) selected).getAdapter(View.class); - if (view != null) { - return view.getElement(); - } - } - return selected; - } - - /** - * @generated - */ - @Override - public void setInput(IWorkbenchPart part, ISelection selection) { - if (selection.isEmpty() - || false == selection instanceof StructuredSelection) { - super.setInput(part, selection); - return; - } - final StructuredSelection structuredSelection = ((StructuredSelection) selection); - ArrayList transformedSelection = new ArrayList(structuredSelection - .size()); - for (Iterator it = structuredSelection.iterator(); it.hasNext();) { - Object r = transformSelection(it.next()); - if (r != null) { - transformedSelection.add(r); - } - } - super.setInput(part, new StructuredSelection(transformedSelection)); - } - - /** - * @generated - */ - protected AdapterFactory getAdapterFactory(Object object) { - if (getEditingDomain() instanceof AdapterFactoryEditingDomain) { - return ((AdapterFactoryEditingDomain) getEditingDomain()) - .getAdapterFactory(); - } - TransactionalEditingDomain editingDomain = TransactionUtil - .getEditingDomain(object); - if (editingDomain != null) { - return ((AdapterFactoryEditingDomain) editingDomain) - .getAdapterFactory(); - } - return null; - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLSheetLabelProvider.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLSheetLabelProvider.java deleted file mode 100644 index c524d47960f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/sheet/UMLSheetLabelProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.sheet; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.gef.EditPart; -import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.jface.viewers.DecoratingLabelProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.graphics.Image; - -import org.eclipse.papyrus.diagram.sequence.navigator.UMLNavigatorGroup; -import org.eclipse.papyrus.diagram.sequence.part.UMLDiagramEditorPlugin; - -/** - * @generated - */ -public class UMLSheetLabelProvider extends DecoratingLabelProvider { - - /** - * @generated - */ - public UMLSheetLabelProvider() { - super(new AdapterFactoryLabelProvider(UMLDiagramEditorPlugin - .getInstance().getItemProvidersAdapterFactory()), null); - } - - /** - * @generated - */ - @Override - public String getText(Object element) { - Object selected = unwrap(element); - if (selected instanceof UMLNavigatorGroup) { - return ((UMLNavigatorGroup) selected).getGroupName(); - } - return super.getText(selected); - } - - /** - * @generated - */ - @Override - public Image getImage(Object element) { - return super.getImage(unwrap(element)); - } - - /** - * @generated - */ - private Object unwrap(Object element) { - if (element instanceof IStructuredSelection) { - return unwrap(((IStructuredSelection) element).getFirstElement()); - } - if (element instanceof EditPart) { - return unwrapEditPart((EditPart) element); - } - if (element instanceof IAdaptable) { - View view = (View) ((IAdaptable) element).getAdapter(View.class); - if (view != null) { - return unwrapView(view); - } - } - return element; - } - - /** - * @generated - */ - private Object unwrapEditPart(EditPart p) { - if (p.getModel() instanceof View) { - return unwrapView((View) p.getModel()); - } - return p.getModel(); - } - - /** - * @generated - */ - private Object unwrapView(View view) { - return view.getElement() == null ? view : view.getElement(); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/BehaviorExecutionSpecificationViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/BehaviorExecutionSpecificationViewFactory.java deleted file mode 100644 index eafec9fc2b2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/BehaviorExecutionSpecificationViewFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.BehaviorExecutionSpecificationEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class BehaviorExecutionSpecificationViewFactory extends - AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(BehaviorExecutionSpecificationEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentInteractionOperatorViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentInteractionOperatorViewFactory.java deleted file mode 100644 index bed61e1b825..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentInteractionOperatorViewFactory.java +++ /dev/null @@ -1,33 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class CombinedFragmentInteractionOperatorViewFactory extends - BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentViewFactory.java deleted file mode 100644 index 4d754dd8e6f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CombinedFragmentViewFactory.java +++ /dev/null @@ -1,71 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CombinedFragmentInteractionOperatorEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class CombinedFragmentViewFactory extends AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(CombinedFragmentEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService() - .createNode( - eObjectAdapter, - view, - UMLVisualIDRegistry - .getType(CombinedFragmentInteractionOperatorEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentAnnotatedElementViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentAnnotatedElementViewFactory.java deleted file mode 100644 index 2caea7ff1a6..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentAnnotatedElementViewFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentAnnotatedElementEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class CommentAnnotatedElementViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(CommentAnnotatedElementEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentBodyViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentBodyViewFactory.java deleted file mode 100644 index 4278e76c70b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentBodyViewFactory.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class CommentBodyViewFactory extends BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentViewFactory.java deleted file mode 100644 index 6120c082a8a..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/CommentViewFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentBodyEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.CommentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class CommentViewFactory extends AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(CommentEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(containerView))) { - EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE - .createEAnnotation(); - shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ - shortcutAnnotation.getDetails().put( - "modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$ - view.getEAnnotations().add(shortcutAnnotation); - } - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(CommentBodyEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/ElementOwnedCommentViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/ElementOwnedCommentViewFactory.java deleted file mode 100644 index bab99d18cd9..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/ElementOwnedCommentViewFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.ElementOwnedCommentEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class ElementOwnedCommentViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(ElementOwnedCommentEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Interaction2ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Interaction2ViewFactory.java deleted file mode 100644 index 4044f94dca2..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Interaction2ViewFactory.java +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Interaction2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionName2EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Interaction2ViewFactory extends AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Interaction2EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService() - .createNode( - eObjectAdapter, - view, - UMLVisualIDRegistry - .getType(InteractionName2EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - getViewService() - .createNode( - eObjectAdapter, - view, - UMLVisualIDRegistry - .getType(InteractionInteractionCompartment2EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartment2ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartment2ViewFactory.java deleted file mode 100644 index 30d3a6b6516..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartment2ViewFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.DrawerStyle; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.TitleStyle; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartment2EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionInteractionCompartment2ViewFactory extends - BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createSortingStyle()); - styles.add(NotationFactory.eINSTANCE.createFilteringStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(InteractionInteractionCompartment2EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - setupCompartmentTitle(view); - setupCompartmentCollapsed(view); - } - - /** - * @generated - */ - protected void setupCompartmentTitle(View view) { - TitleStyle titleStyle = (TitleStyle) view - .getStyle(NotationPackage.eINSTANCE.getTitleStyle()); - if (titleStyle != null) { - titleStyle.setShowTitle(true); - } - } - - /** - * @generated - */ - protected void setupCompartmentCollapsed(View view) { - DrawerStyle drawerStyle = (DrawerStyle) view - .getStyle(NotationPackage.eINSTANCE.getDrawerStyle()); - if (drawerStyle != null) { - drawerStyle.setCollapsed(false); - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartmentViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartmentViewFactory.java deleted file mode 100644 index 06fd214d765..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionInteractionCompartmentViewFactory.java +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.DrawerStyle; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.NotationPackage; -import org.eclipse.gmf.runtime.notation.TitleStyle; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionInteractionCompartmentViewFactory extends - BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createSortingStyle()); - styles.add(NotationFactory.eINSTANCE.createFilteringStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(InteractionInteractionCompartmentEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - setupCompartmentTitle(view); - setupCompartmentCollapsed(view); - } - - /** - * @generated - */ - protected void setupCompartmentTitle(View view) { - TitleStyle titleStyle = (TitleStyle) view - .getStyle(NotationPackage.eINSTANCE.getTitleStyle()); - if (titleStyle != null) { - titleStyle.setShowTitle(true); - } - } - - /** - * @generated - */ - protected void setupCompartmentCollapsed(View view) { - DrawerStyle drawerStyle = (DrawerStyle) view - .getStyle(NotationPackage.eINSTANCE.getDrawerStyle()); - if (drawerStyle != null) { - drawerStyle.setCollapsed(false); - } - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionName2ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionName2ViewFactory.java deleted file mode 100644 index 2714ea9163f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionName2ViewFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class InteractionName2ViewFactory extends BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionNameViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionNameViewFactory.java deleted file mode 100644 index c4eec3ea943..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionNameViewFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class InteractionNameViewFactory extends BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionViewFactory.java deleted file mode 100644 index 881d5345220..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/InteractionViewFactory.java +++ /dev/null @@ -1,87 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EcoreFactory; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionInteractionCompartmentEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.InteractionNameEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.PackageEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class InteractionViewFactory extends AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(InteractionEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - if (!PackageEditPart.MODEL_ID.equals(UMLVisualIDRegistry - .getModelID(containerView))) { - EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE - .createEAnnotation(); - shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$ - shortcutAnnotation.getDetails().put( - "modelID", PackageEditPart.MODEL_ID); //$NON-NLS-1$ - view.getEAnnotations().add(shortcutAnnotation); - } - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(InteractionNameEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - getViewService() - .createNode( - eObjectAdapter, - view, - UMLVisualIDRegistry - .getType(InteractionInteractionCompartmentEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineNameViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineNameViewFactory.java deleted file mode 100644 index 282d688596e..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineNameViewFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.BasicNodeViewFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class LifelineNameViewFactory extends BasicNodeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineViewFactory.java deleted file mode 100644 index b35454ef7d9..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/LifelineViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.LifelineNameEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class LifelineViewFactory extends AbstractShapeViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createShapeStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(LifelineEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(LifelineNameEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } - -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message2ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message2ViewFactory.java deleted file mode 100644 index ee1d9f25367..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message2ViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message2EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName2EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Message2ViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Message2EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageName2EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message3ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message3ViewFactory.java deleted file mode 100644 index 3c87c924f53..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message3ViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message3EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName3EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Message3ViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Message3EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageName3EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message4ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message4ViewFactory.java deleted file mode 100644 index e67c7f62cbd..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message4ViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message4EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName4EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Message4ViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Message4EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageName4EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message5ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message5ViewFactory.java deleted file mode 100644 index f3c1eed4444..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message5ViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message5EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName5EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Message5ViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Message5EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageName5EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message6ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message6ViewFactory.java deleted file mode 100644 index a2ce8003e45..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/Message6ViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.Message6EditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageName6EditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class Message6ViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(Message6EditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageName6EditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName2ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName2ViewFactory.java deleted file mode 100644 index dc2b5a280cc..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName2ViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageName2ViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName3ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName3ViewFactory.java deleted file mode 100644 index b42a8fbb344..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName3ViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageName3ViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName4ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName4ViewFactory.java deleted file mode 100644 index 558bae9384f..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName4ViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageName4ViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName5ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName5ViewFactory.java deleted file mode 100644 index f7d37fb5f5b..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName5ViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageName5ViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName6ViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName6ViewFactory.java deleted file mode 100644 index c390171b23d..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageName6ViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageName6ViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageNameViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageNameViewFactory.java deleted file mode 100644 index 2ff37ade395..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageNameViewFactory.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint; -import org.eclipse.gmf.runtime.diagram.ui.util.MeasurementUnitHelper; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractLabelViewFactory; -import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; -import org.eclipse.gmf.runtime.notation.Location; -import org.eclipse.gmf.runtime.notation.Node; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class MessageNameViewFactory extends AbstractLabelViewFactory { - - /** - * @generated - */ - @Override - public View createView(IAdaptable semanticAdapter, View containerView, - String semanticHint, int index, boolean persisted, - PreferencesHint preferencesHint) { - Node view = (Node) super.createView(semanticAdapter, containerView, - semanticHint, index, persisted, preferencesHint); - Location location = (Location) view.getLayoutConstraint(); - IMapMode mapMode = MeasurementUnitHelper.getMapMode(containerView - .getDiagram().getMeasurementUnit()); - location.setX(mapMode.DPtoLP(1)); - location.setY(mapMode.DPtoLP(-13)); - return view; - } - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - return styles; - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageViewFactory.java deleted file mode 100644 index 1a61c46a82c..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/MessageViewFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; -import org.eclipse.gmf.runtime.diagram.ui.view.factories.ConnectionViewFactory; -import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageEditPart; -import org.eclipse.papyrus.diagram.sequence.edit.parts.MessageNameEditPart; -import org.eclipse.papyrus.diagram.sequence.part.UMLVisualIDRegistry; - -/** - * @generated - */ -public class MessageViewFactory extends ConnectionViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createRoutingStyle()); - styles.add(NotationFactory.eINSTANCE.createFontStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected void decorateView(View containerView, View view, - IAdaptable semanticAdapter, String semanticHint, int index, - boolean persisted) { - if (semanticHint == null) { - semanticHint = UMLVisualIDRegistry - .getType(MessageEditPart.VISUAL_ID); - view.setType(semanticHint); - } - super.decorateView(containerView, view, semanticAdapter, semanticHint, - index, persisted); - IAdaptable eObjectAdapter = null; - EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class); - if (eObject != null) { - eObjectAdapter = new EObjectAdapter(eObject); - } - getViewService().createNode(eObjectAdapter, view, - UMLVisualIDRegistry.getType(MessageNameEditPart.VISUAL_ID), - ViewUtil.APPEND, true, getPreferencesHint()); - } -} diff --git a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/PackageViewFactory.java b/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/PackageViewFactory.java deleted file mode 100644 index 429cdf63cfe..00000000000 --- a/deprecated/deprecated-plugins/uml.deprecated/org.eclipse.papyrus.diagram.sequence/src/org/eclipse/papyrus/diagram/sequence/view/factories/PackageViewFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, - * Generalitat de la Comunitat Valenciana . All rights reserved. This program - * and the accompanying materials are made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram implementation - * - ******************************************************************************/ -package org.eclipse.papyrus.diagram.sequence.view.factories; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory; -import org.eclipse.gmf.runtime.notation.MeasurementUnit; -import org.eclipse.gmf.runtime.notation.NotationFactory; -import org.eclipse.gmf.runtime.notation.View; - -/** - * @generated - */ -public class PackageViewFactory extends DiagramViewFactory { - - /** - * @generated - */ - @Override - protected List createStyles(View view) { - List styles = new ArrayList(); - styles.add(NotationFactory.eINSTANCE.createDiagramStyle()); - return styles; - } - - /** - * @generated - */ - @Override - protected MeasurementUnit getMeasurementUnit() { - return MeasurementUnit.PIXEL_LITERAL; - } -} |