diff options
Diffstat (limited to 'ardor3d-swt')
23 files changed, 2861 insertions, 0 deletions
diff --git a/ardor3d-swt/.classpath b/ardor3d-swt/.classpath new file mode 100644 index 0000000..663dc2d --- /dev/null +++ b/ardor3d-swt/.classpath @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/main/java"/> + <classpathentry kind="src" path="src/test/java"/> + <classpathentry combineaccessrules="false" kind="src" path="/ardor3d-core"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry exported="true" kind="lib" path="lib/swt/windows/swt.jar"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/ardor3d-swt/.project b/ardor3d-swt/.project new file mode 100644 index 0000000..e7b7a8e --- /dev/null +++ b/ardor3d-swt/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ardor3d-swt</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/ardor3d-swt/.settings/org.eclipse.core.resources.prefs b/ardor3d-swt/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..69e2109 --- /dev/null +++ b/ardor3d-swt/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +#Wed Jan 07 11:33:44 PST 2009 +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/ardor3d-swt/.settings/org.eclipse.jdt.core.prefs b/ardor3d-swt/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..4f03ea7 --- /dev/null +++ b/ardor3d-swt/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,276 @@ +#Tue Apr 06 11:31:14 CDT 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes=_ +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=1 +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=120 +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=true +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=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not 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=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true diff --git a/ardor3d-swt/.settings/org.eclipse.jdt.ui.prefs b/ardor3d-swt/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..f479490 --- /dev/null +++ b/ardor3d-swt/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,114 @@ +#Sun Jan 04 11:43:23 CST 2009
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=true
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=true
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=true
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=true
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=true
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=true
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=false
+cleanup.organize_imports=true
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=true
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=true
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=true
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_ArdorLabs
+cleanup_settings_version=2
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_ArdorLabs
+formatter_settings_version=11
+org.eclipse.jdt.ui.exception.name=ex
+org.eclipse.jdt.ui.gettersetter.use.is=true
+org.eclipse.jdt.ui.javadoc=false
+org.eclipse.jdt.ui.keywordthis=false
+org.eclipse.jdt.ui.overrideannotation=true
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><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"/><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/**\r\n * Copyright (c) 2008-2010 Ardor Labs, Inc.\r\n *\r\n * This file is part of Ardor3D.\r\n *\r\n * Ardor3D is free software\: you can redistribute it and/or modify it \r\n * under the terms of its license which may be found in the accompanying\r\n * LICENSE file or at <http\://www.ardor3d.com/LICENSE>.\r\n */\r\n\r\n${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><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\r\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\r\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}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=true
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=true
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=true
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=true
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/ardor3d-swt/lib/swt/about.html b/ardor3d-swt/lib/swt/about.html new file mode 100644 index 0000000..e8d3f42 --- /dev/null +++ b/ardor3d-swt/lib/swt/about.html @@ -0,0 +1,205 @@ +<!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>August 17, 2006</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> + +<h3>Third Party Content</h3> + +<p>The Content includes items that have been sourced from third parties as set out below. If you +did not receive this Content directly from the Eclipse Foundation, the following is provided +for informational purposes only, and you should look to the Redistributor’s license for +terms and conditions of use.</p> + +<h4>Carbon Binding</h4> + +<p>The "Carbon Binding" is a binding to the Carbon API. The Content may include any or all of three portions of the Carbon Binding:</p> + +<p>The following files in the plug-in JAR shall be defined as the native code portion of the Carbon Binding:</p> +<ul> + <li>libswt-pi-carbon-xxxx.jnilib (where "xxxx" is the version number)</li> +</ul> + +<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Carbon Binding:</p> + +<ul> + <li>The contents of the directory org/eclipse/swt/internal/carbon (but not including any sub-directories)</li> +</ul> + +<p>The Carbon Binding contains portions of Apple Computer's Carbon API header files which are:</p> + +<blockquote>Copyright © 1983-2002 Apple Computer, Inc.</blockquote> + +<p>In addition to the terms and conditions of the EPL, the following notice applies to your use of the Carbon Binding and must be retained and reproduced in its entirety with all redistributions of the +Carbon Binding:</p> + +<blockquote> +Copyright © 2004 Apple Computer, Inc.<br> +This text and the following notice must be retained and reproduced in their entirety with all redistributions of this project:<br><br> +<strong>IMPORTANT NOTICE</strong>: This project, which consists of certain Java bindings, includes or otherwise makes references to application programming interfaces +(APIs) that are owned by Apple Computer, Inc., including but not limited to certain Apple Carbon APIs. While you may use, copy, modify and redistribute +this Java bindings project in accordance with the terms of the Eclipse Public License (EPL) version 1.0, you are not granted any rights under any Apple or +third party intellectual property rights (including without limitation, patent, copyright, trademark and trade secret rights) to Apple's Carbon API header files +themselves, nor to any underlying implementations of any Apple Carbon APIs or to any functionality that is invoked by calling any of those APIs. Without +limiting the generality of the foregoing, you understand that it is not Apple's intention by way of this project to authorize the reverse engineering of the Java +bindings into Apple's original Carbon.h header files. +</blockquote> + +<h4>Mozilla Binding</h4> + +<p>The "Mozilla Binding" is a binding to the Mozilla API. The Content may include any or all of the following files:</p> + +<p>The following files in the plug-in JAR shall be defined as the native code portion of the Mozilla Binding:</p> +<ul> + <li>libswt-xulrunner-carbon-xxxx.so (where "xxxx" is the version number)</li> + <li>libswt-xpcominit-carbon-xxxx.so (where "xxxx" is the version number)</li> +</ul> + +<p>The following files in both the plug-in JAR and the src.zip shall be defined respectively as the bytecode and source code portions of the Mozilla Binding:</p> +<ul> + <li>The contents of the directory org/eclipse/swt/internal/mozilla (but not including any sub-directories)</li> +</ul> + +<p>The Mozilla Binding contains portions of Mozilla ("Mozilla"). Mozilla is made available by Mozilla.org. Use of Mozilla is governed by the terms and +conditions of the Mozilla Public License Version 1.1 ("MPL"). A copy of the MPL is provided with the Content (<a href="about_files/mpl-v11.txt" target="_blank">mpl-v11.txt</a>) and is also available at +<a href="http://www.mozilla.org/MPL/MPL-1.1.html" target="_blank">http://www.mozilla.org/MPL/MPL-1.1.html</a>.</p> + +<h4>Independent JPEG Group's JPEG software release 6b</h4> + +<p>This software is based in part on the work of the Independent JPEG Group's JPEG software release 6b ("LIBJPEG"). +LIBJPEG was used to implement the decoding of JPEG format files in Java (TM). The Content does NOT include any portion of the LIBJPEG file ansi2knr.c.</p> + +<p>Your use of LIBJPEG is subject to the terms and conditions located in the <a href="about_files/IJG_README">about_files/IJG_README</a> file which is included +with the Content.</p> + +<p>The IJG's website is located at <a href="http://ijg.org/" target="_blank">http://ijg.org</a>.</p> + +<p>The class org.eclipse.swt.internal.image.JPEGFileFormat is based on following files from LIBJPEG:</p> + +<ul> + <li>cderror.h</li> + <li>cdjpeg.h</li> + <li>jchuff.h</li> + <li>jdcolor.c</li> + <li>jdct.h</li> + <li>jdhuff.h</li> + <li>jerror.h</li> + <li>jidctint.c</li> + <li>jinclude.h</li> + <li>jmemsys.h</li> + <li>jmorecfg.h</li> + <li>jpegint.h</li> + <li>jpeglib.h</li> + <li>jversion.h</li> + <li>transupp.h</li> +</ul> + +<p>The class org.eclipse.swt.internal.image.JPEGDecoder is based on the following files from LIBJPEG:</p> + +<ul> + <li>jcapimin.c</li> + <li>jcapistd.c</li> + <li>jccoefct.c</li> + <li>jccolor.c</li> + <li>jcdctmgr.c</li> + <li>jchuff.c</li> + <li>jcinit.c</li> + <li>jcmainct.c</li> + <li>jcmarker.c</li> + <li>jcmaster.c</li> + <li>jcomapi.c</li> + <li>jcparam.c</li> + <li>jcphuff.c</li> + <li>jcprepct.c</li> + <li>jcsample.c</li> + <li>jctrans.c</li> + <li>jdapimin.c</li> + <li>jdapistd.c</li> + <li>jdatadst.c</li> + <li>jdatasrc.c</li> + <li>jdcoefct.c</li> + <li>jdcolor.c</li> + <li>jddctmgr.c</li> + <li>jdhuff.c</li> + <li>jdinput.c</li> + <li>jdmainct.c</li> + <li>jdmarker.c</li> + <li>jdmaster.c</li> + <li>jdmerge.c</li> + <li>jdphuff.c</li> + <li>jdpostct.c</li> + <li>jdsample.c</li> + <li>jdtrans.c</li> + <li>jerror.c</li> + <li>jfdctflt.c</li> + <li>jfdctfst.c</li> + <li>jfdctint.c</li> + <li>jidctflt.c</li> + <li>jidctfst.c</li> + <li>jidctint.c</li> + <li>jidctred.c</li> + <li>jpegtran.c</li> + <li>jquant1.c</li> + <li>jquant2.c</li> + <li>jutils.c</li> + <li>cderror.h</li> + <li>cdjpeg.h</li> + <li>jchuff.h</li> + <li>jconfig.h</li> + <li>jdct.h</li> + <li>jdhuff.h</li> + <li>jerror.h</li> + <li>jinclude.h</li> + <li>jmorecfg.h</li> + <li>jpegint.h</li> + <li>jpeglib.h</li> + <li>jversion.h</li> + <li>transupp.h</li> +</ul> + +<p>The following changes were made to the LIBJPEG code in the Content:</p> + +<ol> + <li>In Java, pointer math is not allowed so indexing was used instead.</li> + <li>Function pointers were replaced with switch statements.</li> + <li>The virtual memory, tracing and progress monitoring were removed.</li> + <li>The error handling was simplified and now uses Java exceptions.</li> +</ol> + +<h4>PuTTY 0.58 (derivative work)</h4> + +<p>Portions of the SWT class org/eclipse/swt/internal/image/PngDeflater are based on PuTTY's sshzlib.c. PuTTY is made available by Mozilla.org. Use of PuTTY is governed by the terms and +conditions of the the following MIT-style license: </p> +<blockquote> + <p><em>PuTTY is copyright 1997-2007 Simon Tatham.</em> </p> + <p><em>Portions copyright Robert de Bath, Joris van Rantwijk, Delian Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry, Justin Bradford, Ben Harris, Malcolm Smith, Ahmad Khalifa, Markus Kuhn, and CORE SDI S.A.</em> </p> + <p><em>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</em> </p> + <p><em>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</em> </p> + <p><em>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</em> </p> +</blockquote> +<p>A copy of the license is also available at <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html" target="_blank">http://www.chiark.greenend.org.uk/~sgtatham/putty/licence.html</a>.</p> + +<p><small>Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</small></p> + +</body> +</html>
\ No newline at end of file diff --git a/ardor3d-swt/lib/swt/about_files/IJG_README b/ardor3d-swt/lib/swt/about_files/IJG_README new file mode 100644 index 0000000..86cc206 --- /dev/null +++ b/ardor3d-swt/lib/swt/about_files/IJG_README @@ -0,0 +1,385 @@ +The Independent JPEG Group's JPEG software +========================================== + +README for release 6b of 27-Mar-1998 +==================================== + +This distribution contains the sixth public release of the Independent JPEG +Group's free JPEG software. You are welcome to redistribute this software and +to use it for any purpose, subject to the conditions under LEGAL ISSUES, below. + +Serious users of this software (particularly those incorporating it into +larger programs) should contact IJG at [email protected] to be added to +our electronic mailing list. Mailing list members are notified of updates +and have a chance to participate in technical discussions, etc. + +This software is the work of Tom Lane, Philip Gladstone, Jim Boucher, +Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, +Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG +Group. + +IJG is not affiliated with the official ISO JPEG standards committee. + + +DOCUMENTATION ROADMAP +===================== + +This file contains the following sections: + +OVERVIEW General description of JPEG and the IJG software. +LEGAL ISSUES Copyright, lack of warranty, terms of distribution. +REFERENCES Where to learn more about JPEG. +ARCHIVE LOCATIONS Where to find newer versions of this software. +RELATED SOFTWARE Other stuff you should get. +FILE FORMAT WARS Software *not* to get. +TO DO Plans for future IJG releases. + +Other documentation files in the distribution are: + +User documentation: + install.doc How to configure and install the IJG software. + usage.doc Usage instructions for cjpeg, djpeg, jpegtran, + rdjpgcom, and wrjpgcom. + *.1 Unix-style man pages for programs (same info as usage.doc). + wizard.doc Advanced usage instructions for JPEG wizards only. + change.log Version-to-version change highlights. +Programmer and internal documentation: + libjpeg.doc How to use the JPEG library in your own programs. + example.c Sample code for calling the JPEG library. + structure.doc Overview of the JPEG library's internal structure. + filelist.doc Road map of IJG files. + coderules.doc Coding style rules --- please read if you contribute code. + +Please read at least the files install.doc and usage.doc. Useful information +can also be found in the JPEG FAQ (Frequently Asked Questions) article. See +ARCHIVE LOCATIONS below to find out where to obtain the FAQ article. + +If you want to understand how the JPEG code works, we suggest reading one or +more of the REFERENCES, then looking at the documentation files (in roughly +the order listed) before diving into the code. + + +OVERVIEW +======== + +This package contains C software to implement JPEG image compression and +decompression. JPEG (pronounced "jay-peg") is a standardized compression +method for full-color and gray-scale images. JPEG is intended for compressing +"real-world" scenes; line drawings, cartoons and other non-realistic images +are not its strong suit. JPEG is lossy, meaning that the output image is not +exactly identical to the input image. Hence you must not use JPEG if you +have to have identical output bits. However, on typical photographic images, +very good compression levels can be obtained with no visible change, and +remarkably high compression levels are possible if you can tolerate a +low-quality image. For more details, see the references, or just experiment +with various compression settings. + +This software implements JPEG baseline, extended-sequential, and progressive +compression processes. Provision is made for supporting all variants of these +processes, although some uncommon parameter settings aren't implemented yet. +For legal reasons, we are not distributing code for the arithmetic-coding +variants of JPEG; see LEGAL ISSUES. We have made no provision for supporting +the hierarchical or lossless processes defined in the standard. + +We provide a set of library routines for reading and writing JPEG image files, +plus two sample applications "cjpeg" and "djpeg", which use the library to +perform conversion between JPEG and some other popular image file formats. +The library is intended to be reused in other applications. + +In order to support file conversion and viewing software, we have included +considerable functionality beyond the bare JPEG coding/decoding capability; +for example, the color quantization modules are not strictly part of JPEG +decoding, but they are essential for output to colormapped file formats or +colormapped displays. These extra functions can be compiled out of the +library if not required for a particular application. We have also included +"jpegtran", a utility for lossless transcoding between different JPEG +processes, and "rdjpgcom" and "wrjpgcom", two simple applications for +inserting and extracting textual comments in JFIF files. + +The emphasis in designing this software has been on achieving portability and +flexibility, while also making it fast enough to be useful. In particular, +the software is not intended to be read as a tutorial on JPEG. (See the +REFERENCES section for introductory material.) Rather, it is intended to +be reliable, portable, industrial-strength code. We do not claim to have +achieved that goal in every aspect of the software, but we strive for it. + +We welcome the use of this software as a component of commercial products. +No royalty is required, but we do ask for an acknowledgement in product +documentation, as described under LEGAL ISSUES. + + +LEGAL ISSUES +============ + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a + program, you must acknowledge somewhere in your documentation that + you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + +ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, +sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. +ansi2knr.c is NOT covered by the above copyright and conditions, but instead +by the usual distribution terms of the Free Software Foundation; principally, +that you must include source code if you redistribute it. (See the file +ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part +of any program generated from the IJG code, this does not limit you more than +the foregoing paragraphs do. + +The Unix configuration script "configure" was produced with GNU Autoconf. +It is copyright by the Free Software Foundation but is freely distributable. +The same holds for its supporting scripts (config.guess, config.sub, +ltconfig, ltmain.sh). Another support script, install-sh, is copyright +by M.I.T. but is also freely distributable. + +It appears that the arithmetic coding option of the JPEG spec is covered by +patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot +legally be used without obtaining one or more licenses. For this reason, +support for arithmetic coding has been removed from the free JPEG software. +(Since arithmetic coding provides only a marginal gain over the unpatented +Huffman mode, it is unlikely that very many implementations will support it.) +So far as we are aware, there are no patent restrictions on the remaining +code. + +The IJG distribution formerly included code to read and write GIF files. +To avoid entanglement with the Unisys LZW patent, GIF reading support has +been removed altogether, and the GIF writer has been simplified to produce +"uncompressed GIFs". This technique does not use the LZW algorithm; the +resulting GIF files are larger than usual, but are readable by all standard +GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + + +REFERENCES +========== + +We highly recommend reading one or more of these references before trying to +understand the innards of the JPEG software. + +The best short technical introduction to the JPEG compression algorithm is + Wallace, Gregory K. "The JPEG Still Picture Compression Standard", + Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44. +(Adjacent articles in that issue discuss MPEG motion picture compression, +applications of JPEG, and related topics.) If you don't have the CACM issue +handy, a PostScript file containing a revised version of Wallace's article is +available at ftp://ftp.uu.net/graphics/jpeg/wallace.ps.gz. The file (actually +a preprint for an article that appeared in IEEE Trans. Consumer Electronics) +omits the sample images that appeared in CACM, but it includes corrections +and some added material. Note: the Wallace article is copyright ACM and IEEE, +and it may not be used for commercial purposes. + +A somewhat less technical, more leisurely introduction to JPEG can be found in +"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by +M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides +good explanations and example C code for a multitude of compression methods +including JPEG. It is an excellent source if you are comfortable reading C +code but don't know much about data compression in general. The book's JPEG +sample code is far from industrial-strength, but when you are ready to look +at a full implementation, you've got one here... + +The best full description of JPEG is the textbook "JPEG Still Image Data +Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published +by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp. +The book includes the complete text of the ISO JPEG standards (DIS 10918-1 +and draft DIS 10918-2). This is by far the most complete exposition of JPEG +in existence, and we highly recommend it. + +The JPEG standard itself is not available electronically; you must order a +paper copy through ISO or ITU. (Unless you feel a need to own a certified +official copy, we recommend buying the Pennebaker and Mitchell book instead; +it's much cheaper and includes a great deal of useful explanatory material.) +In the USA, copies of the standard may be ordered from ANSI Sales at (212) +642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI +doesn't take credit card orders, but Global does.) It's not cheap: as of +1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7% +shipping/handling. The standard is divided into two parts, Part 1 being the +actual specification, while Part 2 covers compliance testing methods. Part 1 +is titled "Digital Compression and Coding of Continuous-tone Still Images, +Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS +10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of +Continuous-tone Still Images, Part 2: Compliance testing" and has document +numbers ISO/IEC IS 10918-2, ITU-T T.83. + +Some extensions to the original JPEG standard are defined in JPEG Part 3, +a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG +currently does not support any Part 3 extensions. + +The JPEG standard does not specify all details of an interchangeable file +format. For the omitted details we follow the "JFIF" conventions, revision +1.02. A copy of the JFIF spec is available from: + Literature Department + C-Cube Microsystems, Inc. + 1778 McCarthy Blvd. + Milpitas, CA 95035 + phone (408) 944-6300, fax (408) 944-6314 +A PostScript version of this document is available by FTP at +ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text +version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing +the figures. + +The TIFF 6.0 file format specification can be obtained by FTP from +ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme +found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems. +IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6). +Instead, we recommend the JPEG design proposed by TIFF Technical Note #2 +(Compression tag 7). Copies of this Note can be obtained from ftp.sgi.com or +from ftp://ftp.uu.net/graphics/jpeg/. It is expected that the next revision +of the TIFF spec will replace the 6.0 JPEG design with the Note's design. +Although IJG's own code does not support TIFF/JPEG, the free libtiff library +uses our library to implement TIFF/JPEG per the Note. libtiff is available +from ftp://ftp.sgi.com/graphics/tiff/. + + +ARCHIVE LOCATIONS +================= + +The "official" archive site for this software is ftp.uu.net (Internet +address 192.48.96.9). The most recent released version can always be found +there in directory graphics/jpeg. This particular version will be archived +as ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz. If you don't have +direct Internet access, UUNET's archives are also available via UUCP; contact [email protected] for information on retrieving files that way. + +Numerous Internet sites maintain copies of the UUNET files. However, only +ftp.uu.net is guaranteed to have the latest official version. + +You can also obtain this software in DOS-compatible "zip" archive format from +the SimTel archives (ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/), or +on CompuServe in the Graphics Support forum (GO CIS:GRAPHSUP), library 12 +"JPEG Tools". Again, these versions may sometimes lag behind the ftp.uu.net +release. + +The JPEG FAQ (Frequently Asked Questions) article is a useful source of +general information about JPEG. It is updated constantly and therefore is +not included in this distribution. The FAQ is posted every two weeks to +Usenet newsgroups comp.graphics.misc, news.answers, and other groups. +It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/ +and other news.answers archive sites, including the official news.answers +archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/. +If you don't have Web or FTP access, send e-mail to [email protected] +with body + send usenet/news.answers/jpeg-faq/part1 + send usenet/news.answers/jpeg-faq/part2 + + +RELATED SOFTWARE +================ + +Numerous viewing and image manipulation programs now support JPEG. (Quite a +few of them use this library to do so.) The JPEG FAQ described above lists +some of the more popular free and shareware viewers, and tells where to +obtain them on Internet. + +If you are on a Unix machine, we highly recommend Jef Poskanzer's free +PBMPLUS software, which provides many useful operations on PPM-format image +files. In particular, it can convert PPM images to and from a wide range of +other formats, thus making cjpeg/djpeg considerably more useful. The latest +version is distributed by the NetPBM group, and is available from numerous +sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/. +Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is; +you are likely to have difficulty making it work on any non-Unix machine. + +A different free JPEG implementation, written by the PVRG group at Stanford, +is available from ftp://havefun.stanford.edu/pub/jpeg/. This program +is designed for research and experimentation rather than production use; +it is slower, harder to use, and less portable than the IJG code, but it +is easier to read and modify. Also, the PVRG code supports lossless JPEG, +which we do not. (On the other hand, it doesn't do progressive JPEG.) + + +FILE FORMAT WARS +================ + +Some JPEG programs produce files that are not compatible with our library. +The root of the problem is that the ISO JPEG committee failed to specify a +concrete file format. Some vendors "filled in the blanks" on their own, +creating proprietary formats that no one else could read. (For example, none +of the early commercial JPEG implementations for the Macintosh were able to +exchange compressed files.) + +The file format we have adopted is called JFIF (see REFERENCES). This format +has been agreed to by a number of major commercial JPEG vendors, and it has +become the de facto standard. JFIF is a minimal or "low end" representation. +We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF +Technical Note #2) for "high end" applications that need to record a lot of +additional data about an image. TIFF/JPEG is fairly new and not yet widely +supported, unfortunately. + +The upcoming JPEG Part 3 standard defines a file format called SPIFF. +SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should +be able to read the most common variant of SPIFF. SPIFF has some technical +advantages over JFIF, but its major claim to fame is simply that it is an +official standard rather than an informal one. At this point it is unclear +whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto +standard. IJG intends to support SPIFF once the standard is frozen, but we +have not decided whether it should become our default output format or not. +(In any case, our decoder will remain capable of reading JFIF indefinitely.) + +Various proprietary file formats incorporating JPEG compression also exist. +We have little or no sympathy for the existence of these formats. Indeed, +one of the original reasons for developing this free software was to help +force convergence on common, open format standards for JPEG files. Don't +use a proprietary file format! + + +TO DO +===== + +The major thrust for v7 will probably be improvement of visual quality. +The current method for scaling the quantization tables is known not to be +very good at low Q values. We also intend to investigate block boundary +smoothing, "poor man's variable quantization", and other means of improving +quality-vs-file-size performance without sacrificing compatibility. + +In future versions, we are considering supporting some of the upcoming JPEG +Part 3 extensions --- principally, variable quantization and the SPIFF file +format. + +As always, speeding things up is of great interest. + +Please send bug reports, offers of help, etc. to [email protected]. diff --git a/ardor3d-swt/lib/swt/about_files/mpl-v11.txt b/ardor3d-swt/lib/swt/about_files/mpl-v11.txt new file mode 100644 index 0000000..7714141 --- /dev/null +++ b/ardor3d-swt/lib/swt/about_files/mpl-v11.txt @@ -0,0 +1,470 @@ + MOZILLA PUBLIC LICENSE + Version 1.1 + + --------------- + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by Exhibit + A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, + to cause the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty percent + (50%) of the outstanding shares or beneficial ownership of such + entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Code (or portions thereof) with or without Modifications, and/or + as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or + selling of Original Code, to make, have made, use, practice, + sell, and offer for sale, and/or otherwise dispose of the + Original Code (or portions thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are + effective on the date Initial Developer first distributes + Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused + by: i) the modification of the Original Code or ii) the + combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof) either on an + unmodified basis, with other Modifications, as Covered Code + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either alone + and/or in combination with its Contributor Version (or portions + of such combination), to make, use, sell, offer for sale, have + made, and/or otherwise dispose of: 1) Modifications made by that + Contributor (or portions thereof); and 2) the combination of + Modifications made by that Contributor with its Contributor + Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first makes Commercial Use of + the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; + 3) for infringements caused by: i) third party modifications of + Contributor Version or ii) the combination of Modifications made + by that Contributor with other software (except as part of the + Contributor Version) or other devices; or 4) under Patent Claims + infringed by Covered Code in the absence of Modifications made by + that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, + Contributor must include a text file with the Source Code + distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If Contributor obtains such knowledge after + the Modification is made available as described in Section 3.2, + Contributor shall promptly modify the LEGAL file in all copies + Contributor makes available thereafter and shall take other steps + (such as notifying appropriate mailing lists or newsgroups) + reasonably calculated to inform those who received the Covered + Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming + interface and Contributor has knowledge of patent licenses which + are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to + Section 3.4(a) above, Contributor believes that Contributor's + Modifications are Contributor's original creation(s) and/or + Contributor has sufficient rights to grant the rights conveyed by + this License. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must (a) rename Your license so that + the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", + "MPL", "NPL" or any confusingly similar phrase do not appear in your + license (except to note that your license differs from this License) + and (b) otherwise make it clear that Your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial + Developer, Original Code or Contributor in the notice described in + Exhibit A shall not of themselves be deemed to be modifications of + this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declatory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, + all end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the NPL or the alternative licenses, if any, specified + by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.1 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those + above. If you wish to allow use of your version of this file only + under the terms of the [____] License and not to allow others to use + your version of this file under the MPL, indicate your decision by + deleting the provisions above and replace them with the notice and + other provisions required by the [___] License. If you do not delete + the provisions above, a recipient may use your version of this file + under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] + diff --git a/ardor3d-swt/lib/swt/linux/swt.jar b/ardor3d-swt/lib/swt/linux/swt.jar Binary files differnew file mode 100644 index 0000000..f8e94dd --- /dev/null +++ b/ardor3d-swt/lib/swt/linux/swt.jar diff --git a/ardor3d-swt/lib/swt/macosx-carbon/swt.jar b/ardor3d-swt/lib/swt/macosx-carbon/swt.jar Binary files differnew file mode 100644 index 0000000..34754e0 --- /dev/null +++ b/ardor3d-swt/lib/swt/macosx-carbon/swt.jar diff --git a/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa.jar b/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa.jar Binary files differnew file mode 100644 index 0000000..691d480 --- /dev/null +++ b/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa.jar diff --git a/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa_64.jar b/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa_64.jar Binary files differnew file mode 100644 index 0000000..48d8668 --- /dev/null +++ b/ardor3d-swt/lib/swt/macosx-cocoa/swt_cocoa_64.jar diff --git a/ardor3d-swt/lib/swt/windows/swt.jar b/ardor3d-swt/lib/swt/windows/swt.jar Binary files differnew file mode 100644 index 0000000..6bb0233 --- /dev/null +++ b/ardor3d-swt/lib/swt/windows/swt.jar diff --git a/ardor3d-swt/pom.xml b/ardor3d-swt/pom.xml new file mode 100644 index 0000000..09aa143 --- /dev/null +++ b/ardor3d-swt/pom.xml @@ -0,0 +1,141 @@ +
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.ardor3d</groupId>
+ <artifactId>ardor3d</artifactId>
+ <relativePath>../pom.xml</relativePath>
+ <version>0.9-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>ardor3d-swt</artifactId>
+ <packaging>bundle</packaging>
+ <name>Ardor 3D SWT</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>ardor3d-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.easymock</groupId>
+ <artifactId>easymockclassextension</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>swt</artifactId>
+ <classifier>${swt.classifier}</classifier>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>linux-x86</id>
+ <activation>
+ <os>
+ <arch>i386</arch>
+ <name>linux</name>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>linux-x86</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>linux-x86_64</id>
+ <activation>
+ <os>
+ <arch>amd64</arch>
+ <name>Linux</name>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>linux-x86_64</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>solaris-sparc</id>
+ <activation>
+ <os>
+ <arch>sparc</arch>
+ <name>SunOS</name>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>solaris-sparc</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>solaris-x86</id>
+ <activation>
+ <os>
+ <arch>x86</arch>
+ <name>SunOS</name>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>solaris-x86</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>macosx-cocoa-64</id>
+ <activation>
+ <os>
+ <arch>x86_64</arch>
+ <family>mac</family>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>mac-x86_64</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>macosx-cocoa</id>
+ <activation>
+ <os>
+ <arch>x86</arch>
+ <family>mac</family>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>mac-x86</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>win32</id>
+ <activation>
+ <os>
+ <arch>x86</arch>
+ <family>windows</family>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>win32-x86</swt.classifier>
+ </properties>
+ </profile>
+ <profile>
+ <id>win64</id>
+ <activation>
+ <os>
+ <arch>amd64</arch>
+ <family>windows</family>
+ </os>
+ </activation>
+ <properties>
+ <swt.classifier>win32-x86_64</swt.classifier>
+ </properties>
+ </profile>
+ </profiles>
+</project>
diff --git a/ardor3d-swt/src/main/java/com/ardor3d/framework/swt/SwtCanvas.java b/ardor3d-swt/src/main/java/com/ardor3d/framework/swt/SwtCanvas.java new file mode 100644 index 0000000..97aebf3 --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/framework/swt/SwtCanvas.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.framework.swt; + +import java.util.concurrent.CountDownLatch; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.opengl.GLCanvas; +import org.eclipse.swt.opengl.GLData; +import org.eclipse.swt.widgets.Composite; + +import com.ardor3d.annotation.MainThread; +import com.ardor3d.framework.Canvas; +import com.ardor3d.framework.CanvasRenderer; +import com.ardor3d.framework.DisplaySettings; + +/** + * A canvas for embedding into SWT applications. + */ +public class SwtCanvas extends GLCanvas implements Canvas { + private CanvasRenderer _canvasRenderer; + private boolean _inited = false; + private final GLData _passedGLData; + + public SwtCanvas(final Composite composite, final int style, final GLData glData) { + super(composite, style, glData); + _passedGLData = clone(glData); + setCurrent(); + } + + private GLData clone(final GLData glData) { + final GLData rVal = new GLData(); + rVal.accumAlphaSize = glData.accumAlphaSize; + rVal.accumBlueSize = glData.accumBlueSize; + rVal.accumGreenSize = glData.accumGreenSize; + rVal.accumRedSize = glData.accumRedSize; + rVal.alphaSize = glData.alphaSize; + rVal.blueSize = glData.blueSize; + rVal.depthSize = glData.depthSize; + rVal.doubleBuffer = glData.doubleBuffer; + rVal.greenSize = glData.greenSize; + rVal.redSize = glData.redSize; + rVal.sampleBuffers = glData.sampleBuffers; + rVal.samples = glData.samples; + rVal.stencilSize = glData.stencilSize; + rVal.stereo = glData.stereo; + return rVal; + } + + public void setCanvasRenderer(final CanvasRenderer renderer) { + _canvasRenderer = renderer; + } + + @MainThread + private void privateInit() { + // tell our parent to lay us out so we have the right starting size. + getParent().layout(); + final Point size = getSize(); + + setCurrent(); + + final DisplaySettings settings = new DisplaySettings(Math.max(size.x, 1), Math.max(size.y, 1), 0, 0, + _passedGLData.alphaSize, _passedGLData.depthSize, _passedGLData.stencilSize, _passedGLData.samples, + false, _passedGLData.stereo); + + _canvasRenderer.init(settings, false); // false - do not do back buffer swap, swt will do that. + _inited = true; + } + + @MainThread + public void init() { + privateInit(); + } + + @MainThread + public void draw(final CountDownLatch latch) { + if (!_inited) { + privateInit(); + } + + if (!isDisposed() && isVisible()) { + setCurrent(); + + if (_canvasRenderer.draw()) { + swapBuffers(); + _canvasRenderer.releaseCurrentContext(); + } + } + + latch.countDown(); + } + + public CanvasRenderer getCanvasRenderer() { + return _canvasRenderer; + } +} diff --git a/ardor3d-swt/src/main/java/com/ardor3d/image/util/SWTImageUtil.java b/ardor3d-swt/src/main/java/com/ardor3d/image/util/SWTImageUtil.java new file mode 100644 index 0000000..cb6348e --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/image/util/SWTImageUtil.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.image.util; + +import java.nio.ByteBuffer; +import java.util.List; + +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; + +import com.ardor3d.image.Image; +import com.ardor3d.image.PixelDataType; +import com.google.common.collect.Lists; + +/** + * Utility methods for converting Ardor3D Images to SWT ImageData. + */ +public abstract class SWTImageUtil { + + /** + * Convert the given Ardor3D Image to a List of ImageData objects. It is a List because Ardor3D Images may contain + * multiple layers (for example, in the case of cube maps or 3D textures). + * + * @param input + * the Ardor3D Image to convert + * @return the ImageData object(s) created in the conversion + */ + public static List<ImageData> convertToSWT(final Image input) { + // convert, using a full white tint (i.e. no applied color change from original data.) + return convertToSWT(input, null, 1.0); + } + + /** + * Convert the given Ardor3D Image to a List of ImageData objects. It is a List because Ardor3D Images may contain + * multiple layers (for example, in the case of cube maps or 3D textures). The given SWT Color is used to modulate + * or "tint" the returned image. + * + * TODO: Add support for more formats.<br/> + * XXX: Note that only images of data type ImageDataType.UnsignedByte and ImageDataFormat of RGB or RGBA are + * currently supported. + * + * @param input + * the Ardor3D Image to convert + * @param tint + * the Color to apply to the generated image + * @return the ImageData object(s) created in the conversion + */ + public static List<ImageData> convertToSWT(final Image input, final Color tint, final double alphaTint) { + if (input.getDataType() != PixelDataType.UnsignedByte) { + throw new Error("Unhandled Ardor3D image data type: " + input.getDataType()); + } + // count the number of layers we will be converting. + final int size = input.getData().size(); + + // grab our image width and height + final int width = input.getWidth(), height = input.getHeight(); + + // create our return list + final List<ImageData> rVal = Lists.newArrayList(); + + // Calculate our modulation or "tint" values per channel + final double tRed = tint != null ? tint.getRed() / 255. : 1.0; + final double tGreen = tint != null ? tint.getGreen() / 255. : 1.0; + final double tBlue = tint != null ? tint.getBlue() / 255. : 1.0; + final double tAlpha = alphaTint; + + // go through each layer + for (int i = 0; i < size; i++) { + ImageData image; + final ByteBuffer data = input.getData(i); + data.rewind(); + boolean alpha = false; + switch (input.getDataFormat()) { + case RGBA: + alpha = true; + // Falls through on purpose. + case RGB: + if (alpha) { + // use alpha data... XXX: Is this right? + image = new ImageData(width, height, 32, new PaletteData(0xFF0000, 0x00FF00, 0x0000FF)); + image.transparentPixel = -1; + } else { + image = new ImageData(width, height, 24, new PaletteData(0xFF0000, 0x00FF00, 0x0000FF)); + image.transparentPixel = 255; + } + int index, + r, + g, + b, + a, + argb; + + // Go through each pixel + for (int x = 0; x < width; x++) { + for (int y = 0; y < height; y++) { + index = (alpha ? 4 : 3) * (y * width + x); + r = (int) (((data.get(index + 0))) * tRed); + g = (int) (((data.get(index + 1))) * tGreen); + b = (int) (((data.get(index + 2))) * tBlue); + + // convert to integer expression + argb = ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); + + // add alpha, if applicable + if (alpha) { + a = (int) (((data.get(index + 3))) * tAlpha); + argb |= (a & 0xFF) << 24; + image.setAlpha(x, y, a & 0xFF); + } + + // apply to image + image.setPixel(x, y, argb); + } + } + break; + default: + throw new Error("Unhandled image data format: " + input.getDataFormat()); + } + + // add to our list + rVal.add(image); + } + + // return list + return rVal; + } + +} diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtFocusWrapper.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtFocusWrapper.java new file mode 100644 index 0000000..930c43a --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtFocusWrapper.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.input.swt; + +import static com.google.common.base.Preconditions.checkNotNull; + +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.widgets.Control; + +import com.ardor3d.input.FocusWrapper; + +/** + * Focus Listener wrapper class for use with SWT. + */ +public class SwtFocusWrapper implements FocusWrapper, FocusListener { + private volatile boolean _focusLost = false; + + private final Control _control; + + public SwtFocusWrapper(final Control control) { + _control = checkNotNull(control, "control"); + } + + public void focusGained(final FocusEvent focusEvent) { + // nothing to do + } + + public void focusLost(final FocusEvent focusEvent) { + _focusLost = true; + } + + public boolean getAndClearFocusLost() { + final boolean result = _focusLost; + + _focusLost = false; + + return result; + } + + public void init() { + _control.addFocusListener(this); + } +} diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKey.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKey.java new file mode 100644 index 0000000..be52efd --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKey.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.input.swt; + +import org.eclipse.swt.SWT; + +import com.ardor3d.input.Key; + +/** + * Enumeration for use in converting between SWT key codes and Ardor3d Keys. + */ +public enum SwtKey { + SWT_ESCAPE(SWT.ESC, Key.ESCAPE), // + SWT_1('1', Key.ONE), // + SWT_2('2', Key.TWO), // + SWT_3('3', Key.THREE), // + SWT_4('4', Key.FOUR), // + SWT_5('5', Key.FIVE), // + SWT_6('6', Key.SIX), // + SWT_7('7', Key.SEVEN), // + SWT_8('8', Key.EIGHT), // + SWT_9('9', Key.NINE), // + SWT_0('0', Key.ZERO), // + SWT_MINUS('-', Key.MINUS), // + SWT_EQUALS('=', Key.EQUALS), // + SWT_BACK(SWT.BS, Key.BACK), // + SWT_TAB(SWT.TAB, Key.TAB), // + SWT_Q('q', Key.Q), // + SWT_W('w', Key.W), // + SWT_E('e', Key.E), // + SWT_R('r', Key.R), // + SWT_T('t', Key.T), // + SWT_Y('y', Key.Y), // + SWT_U('u', Key.U), // + SWT_I('i', Key.I), // + SWT_O('o', Key.O), // + SWT_P('p', Key.P), // + SWT_LBRACKET('(', Key.LBRACKET), // + SWT_RBRACKET(')', Key.RBRACKET), // + SWT_RETURN(SWT.TRAVERSE_RETURN, Key.RETURN), // + SWT_LCONTROL(SWT.CTRL, Key.LCONTROL), // + SWT_A('a', Key.A), // + SWT_S('s', Key.S), // + SWT_D('d', Key.D), // + SWT_F('f', Key.F), // + SWT_G('g', Key.G), // + SWT_H('h', Key.H), // + SWT_J('j', Key.J), // + SWT_K('k', Key.K), // + SWT_L('l', Key.L), // + SWT_SEMICOLON(';', Key.SEMICOLON), // + SWT_APOSTROPHE('\'', Key.APOSTROPHE), // + SWT_GRAVE('`', Key.GRAVE), // + SWT_LSHIFT(SWT.SHIFT, Key.LSHIFT), // + SWT_BACKSLASH('\\', Key.BACKSLASH), // + SWT_Z('z', Key.Z), // + SWT_X('x', Key.X), // + SWT_C('c', Key.C), // + SWT_V('v', Key.V), // + SWT_B('b', Key.B), // + SWT_N('n', Key.N), // + SWT_M('m', Key.M), // + SWT_COMMA(',', Key.COMMA), // + SWT_PERIOD('.', Key.PERIOD), // + SWT_SLASH('/', Key.SLASH), // + SWT_MULTIPLY('*', Key.MULTIPLY), // + SWT_SPACE(' ', Key.SPACE), // + SWT_CAPITAL(SWT.CAPS_LOCK, Key.CAPITAL), // + SWT_F1(SWT.F1, Key.F1), // + SWT_F2(SWT.F2, Key.F2), // + SWT_F3(SWT.F3, Key.F3), // + SWT_F4(SWT.F4, Key.F4), // + SWT_F5(SWT.F5, Key.F5), // + SWT_F6(SWT.F6, Key.F6), // + SWT_F7(SWT.F7, Key.F7), // + SWT_F8(SWT.F8, Key.F8), // + SWT_F9(SWT.F9, Key.F9), // + SWT_F10(SWT.F10, Key.F10), // + SWT_NUMLOCK(SWT.NUM_LOCK, Key.NUMLOCK), // + SWT_SCROLL(SWT.SCROLL_LOCK, Key.SCROLL), // + SWT_NUMPAD7(SWT.KEYPAD_7, Key.NUMPAD7), // + SWT_NUMPAD8(SWT.KEYPAD_8, Key.NUMPAD8), // + SWT_NUMPAD9(SWT.KEYPAD_9, Key.NUMPAD9), // + SWT_NUMPAD4(SWT.KEYPAD_4, Key.NUMPAD4), // + SWT_NUMPAD5(SWT.KEYPAD_5, Key.NUMPAD5), // + SWT_NUMPAD6(SWT.KEYPAD_6, Key.NUMPAD6), // + SWT_ADD('+', Key.NUMPADADD), // + SWT_NUMPAD1(SWT.KEYPAD_1, Key.NUMPAD1), // + SWT_NUMPAD2(SWT.KEYPAD_2, Key.NUMPAD2), // + SWT_NUMPAD3(SWT.KEYPAD_3, Key.NUMPAD3), // + SWT_NUMPAD0(SWT.KEYPAD_0, Key.NUMPAD0), // + SWT_DECIMAL(SWT.KEYPAD_DECIMAL, Key.DECIMAL), // + SWT_F11(SWT.F11, Key.F11), // + SWT_F12(SWT.F12, Key.F12), // + SWT_F13(SWT.F13, Key.F13), // + SWT_F14(SWT.F14, Key.F14), // + SWT_F15(SWT.F15, Key.F15), // + SWT_AT('@', Key.AT), // + SWT_COLON('|', Key.COLON), // + SWT_UNDERLINE('_', Key.UNDERLINE), // + SWT_DIVIDE(SWT.KEYPAD_DIVIDE, Key.DIVIDE), // + SWT_PAUSE(SWT.PAUSE, Key.PAUSE), // + SWT_HOME(SWT.HOME, Key.HOME), // + SWT_UP(SWT.ARROW_UP, Key.UP), // + SWT_PAGEUP_PRIOR(SWT.PAGE_UP, Key.PAGEUP_PRIOR), // + SWT_LEFT(SWT.ARROW_LEFT, Key.LEFT), // + SWT_RIGHT(SWT.ARROW_RIGHT, Key.RIGHT), // + SWT_END(SWT.END, Key.END), // + SWT_DOWN(SWT.ARROW_DOWN, Key.DOWN), // + SWT_PAGEDOWN_NEXT(SWT.PAGE_DOWN, Key.PAGEDOWN_NEXT), // + SWT_INSERT(SWT.INSERT, Key.INSERT), // + SWT_DELETE(SWT.DEL, Key.DELETE), // + SWT_NUMPADADD(SWT.KEYPAD_ADD, Key.NUMPADADD), // + SWT_NUMPADSUB(SWT.KEYPAD_SUBTRACT, Key.NUMPADSUBTRACT), // + SWT_NUMPADMULTIPLY(SWT.KEYPAD_MULTIPLY, Key.MULTIPLY), // + SWT_NUMPADDIVIDE(SWT.KEYPAD_DIVIDE, Key.DIVIDE), // + SWT_NUMPADENTER(SWT.KEYPAD_CR, Key.NUMPADENTER), // + SWT_LMENU(SWT.ALT, Key.LMENU), // + SWT_COMMAND(SWT.COMMAND, Key.LMETA), // + SWT_SYSRQ(SWT.PRINT_SCREEN, Key.SYSRQ); + + private final int _swtCode; + private final Key _key; + + SwtKey(final int swtCode, final Key key) { + _swtCode = swtCode; + _key = key; + } + + public static Key findByCode(final int swtCode) { + for (final SwtKey swtKey : values()) { + if (swtKey._swtCode == swtCode) { + return swtKey._key; + } + } + + throw new IllegalStateException("No SWT key found corresponding to code: " + swtCode); + } +} diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKeyboardWrapper.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKeyboardWrapper.java new file mode 100644 index 0000000..7a7535b --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtKeyboardWrapper.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.input.swt; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.LinkedList; + +import org.eclipse.swt.events.KeyListener; +import org.eclipse.swt.widgets.Control; + +import com.ardor3d.annotation.GuardedBy; +import com.ardor3d.annotation.ThreadSafe; +import com.ardor3d.input.Key; +import com.ardor3d.input.KeyEvent; +import com.ardor3d.input.KeyState; +import com.ardor3d.input.KeyboardWrapper; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.PeekingIterator; + +/** + * Keyboard wrapper for SWT input. + */ +@ThreadSafe +public class SwtKeyboardWrapper implements KeyboardWrapper, KeyListener { + @GuardedBy("this") + private final LinkedList<KeyEvent> _upcomingEvents; + + private final Control _control; + + @GuardedBy("this") + private SwtKeyboardIterator _currentIterator = null; + @GuardedBy("this") + private Key _lastKeyPressed = null; + + public SwtKeyboardWrapper(final Control control) { + _upcomingEvents = new LinkedList<KeyEvent>(); + _control = checkNotNull(control, "control"); + } + + public void init() { + _control.addKeyListener(this); + } + + public synchronized PeekingIterator<KeyEvent> getEvents() { + if (_currentIterator == null || !_currentIterator.hasNext()) { + _currentIterator = new SwtKeyboardIterator(); + } + + return _currentIterator; + } + + public synchronized void keyPressed(final org.eclipse.swt.events.KeyEvent event) { + final Key key = fromKeyEventToKey(event); + if (key == _lastKeyPressed) { + // ignore if this is a repeat event + return; + } + + final char keyChar = event.character; + + if (_lastKeyPressed != null) { + // if this is a different key to the last key that was pressed, then + // add an 'up' even for the previous one - SWT doesn't send an 'up' event for the + // first key in the below scenario: + // 1. key 1 down + // 2. key 2 down + // 3. key 1 up + _upcomingEvents.add(new KeyEvent(_lastKeyPressed, KeyState.UP, keyChar)); + } + + _lastKeyPressed = key; + _upcomingEvents.add(new KeyEvent(key, KeyState.DOWN, keyChar)); + } + + public synchronized void keyReleased(final org.eclipse.swt.events.KeyEvent event) { + _upcomingEvents.add(new KeyEvent(fromKeyEventToKey(event), KeyState.UP, event.character)); + _lastKeyPressed = null; + } + + /** + * Convert from SWT key event to Ardor3D Key. Override to provide additional or custom behavior. + * + * @param e + * the SWT KeyEvent received by the input system. + * @return an Ardor3D Key, to be forwarded to the Predicate/Trigger system. + */ + public synchronized Key fromKeyEventToKey(final org.eclipse.swt.events.KeyEvent e) { + return SwtKey.findByCode(e.keyCode); + } + + private class SwtKeyboardIterator extends AbstractIterator<KeyEvent> implements PeekingIterator<KeyEvent> { + + @Override + protected KeyEvent computeNext() { + synchronized (SwtKeyboardWrapper.this) { + if (_upcomingEvents.isEmpty()) { + return endOfData(); + } + + return _upcomingEvents.poll(); + } + } + } +} diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java new file mode 100644 index 0000000..8918263 --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseManager.java @@ -0,0 +1,119 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.input.swt; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Display; + +import com.ardor3d.image.util.SWTImageUtil; +import com.ardor3d.input.GrabbedState; +import com.ardor3d.input.MouseCursor; +import com.ardor3d.input.MouseManager; + +/** + * Implementation of the {@link com.ardor3d.input.MouseManager} interface for use with SWT. This implementation supports + * the optional {@link #setGrabbed(com.ardor3d.input.GrabbedState)} and {@link #setPosition(int, int)} methods. The + * constructor takes an SWT {@link org.eclipse.swt.widgets.Control} instance, for which the cursor is set. In a + * multi-canvas application, each canvas can have its own SwtMouseManager instance, or it is possible to use a single + * one for the SWT container that includes the control. + */ +public class SwtMouseManager implements MouseManager { + + private static Cursor _transparentCursor; + + private final Control _control; + + /** our current grabbed state */ + private GrabbedState _grabbedState; + + /** Our cursor prior to a setGrabbed(GRABBED) operation. Stored to be used when cursor is "ungrabbed" */ + private Cursor _pregrabCursor; + + public SwtMouseManager(final Control control) { + _control = control; + } + + public void setCursor(final MouseCursor cursor) { + if (cursor == MouseCursor.SYSTEM_DEFAULT) { + _control.setCursor(null); + return; + } + + final ImageData imageData = SWTImageUtil.convertToSWT(cursor.getImage()).get(0); + + final Cursor swtCursor = new Cursor(_control.getDisplay(), imageData, cursor.getHotspotX(), cursor + .getHotspotY()); + + _control.setCursor(swtCursor); + } + + public void setPosition(final int x, final int y) { + final Point p = new Point(x, _control.getSize().y - y); + _control.getDisplay().setCursorLocation(_control.toDisplay(p)); + } + + public void setGrabbed(final GrabbedState grabbedState) { + if (!isSetGrabbedSupported()) { + throw new UnsupportedOperationException(); + } + + // check if we should be here. + if (_grabbedState == grabbedState) { + return; + } + + // remember our grabbed state mode. + _grabbedState = grabbedState; + + if (grabbedState == GrabbedState.GRABBED) { + // remember our old cursor + _pregrabCursor = _control.getCursor(); + + // set our cursor to be invisible + _control.setCursor(getTransparentCursor()); + } else { + // restore our old cursor + _control.setCursor(_pregrabCursor); + } + } + + private final Cursor getTransparentCursor() { + if (_transparentCursor == null) { + final Display display = _control.getDisplay(); + final Color white = display.getSystemColor(SWT.COLOR_WHITE); + final Color black = display.getSystemColor(SWT.COLOR_BLACK); + final PaletteData palette = new PaletteData(new RGB[] { white.getRGB(), black.getRGB() }); + final ImageData sourceData = new ImageData(16, 16, 1, palette); + sourceData.transparentPixel = 0; + _transparentCursor = new Cursor(display, sourceData, 0, 0); + } + return _transparentCursor; + } + + public boolean isSetPositionSupported() { + return true; + } + + public boolean isSetGrabbedSupported() { + return true; + } + + public GrabbedState getGrabbed() { + return _grabbedState; + } +}
\ No newline at end of file diff --git a/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseWrapper.java b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseWrapper.java new file mode 100644 index 0000000..46266d7 --- /dev/null +++ b/ardor3d-swt/src/main/java/com/ardor3d/input/swt/SwtMouseWrapper.java @@ -0,0 +1,217 @@ +/** + * Copyright (c) 2008-2012 Ardor Labs, Inc. + * + * This file is part of Ardor3D. + * + * Ardor3D is free software: you can redistribute it and/or modify it + * under the terms of its license which may be found in the accompanying + * LICENSE file or at <http://www.ardor3d.com/LICENSE>. + */ + +package com.ardor3d.input.swt; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.LinkedList; + +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseMoveListener; +import org.eclipse.swt.events.MouseWheelListener; +import org.eclipse.swt.widgets.Control; + +import com.ardor3d.annotation.GuardedBy; +import com.ardor3d.annotation.ThreadSafe; +import com.ardor3d.input.ButtonState; +import com.ardor3d.input.MouseButton; +import com.ardor3d.input.MouseState; +import com.ardor3d.input.MouseWrapper; +import com.google.common.collect.AbstractIterator; +import com.google.common.collect.EnumMultiset; +import com.google.common.collect.Maps; +import com.google.common.collect.Multiset; +import com.google.common.collect.PeekingIterator; + +/** + * A mouse wrapper for use with SWT. + */ +@ThreadSafe +public class SwtMouseWrapper implements MouseWrapper, MouseListener, MouseMoveListener, MouseWheelListener { + @GuardedBy("this") + private final LinkedList<MouseState> _upcomingEvents = new LinkedList<MouseState>(); + + private final Control _control; + + @GuardedBy("this") + private SwtMouseIterator _currentIterator = null; + + @GuardedBy("this") + private MouseState _lastState = null; + + private final Multiset<MouseButton> _clicks = EnumMultiset.create(MouseButton.class); + private final EnumMap<MouseButton, Long> _lastClickTime = Maps.newEnumMap(MouseButton.class); + private final EnumSet<MouseButton> _clickArmed = EnumSet.noneOf(MouseButton.class); + + public SwtMouseWrapper(final Control control) { + _control = checkNotNull(control, "control"); + for (final MouseButton mb : MouseButton.values()) { + _lastClickTime.put(mb, 0L); + } + } + + public void init() { + _control.addMouseListener(this); + _control.addMouseMoveListener(this); + _control.addMouseWheelListener(this); + } + + public synchronized PeekingIterator<MouseState> getEvents() { + expireClickEvents(); + + if (_currentIterator == null || !_currentIterator.hasNext()) { + _currentIterator = new SwtMouseIterator(); + } + + return _currentIterator; + } + + private void expireClickEvents() { + if (!_clicks.isEmpty()) { + for (final MouseButton mb : MouseButton.values()) { + if (System.currentTimeMillis() - _lastClickTime.get(mb) > MouseState.CLICK_TIME_MS) { + _clicks.setCount(mb, 0); + } + } + } + } + + public synchronized void mouseDoubleClick(final MouseEvent mouseEvent) { + // ignoring this. We'll handle (multi)click in a uniform way + } + + public synchronized void mouseDown(final MouseEvent e) { + final MouseButton b = getButtonForEvent(e); + if (_clickArmed.contains(b)) { + _clicks.setCount(b, 0); + } + _clickArmed.add(b); + _lastClickTime.put(b, System.currentTimeMillis()); + + initState(e); + + final EnumMap<MouseButton, ButtonState> buttons = _lastState.getButtonStates(); + + setStateForButton(e, buttons, ButtonState.DOWN); + + addNewState(e, 0, buttons, null); + } + + public synchronized void mouseUp(final MouseEvent e) { + initState(e); + + final EnumMap<MouseButton, ButtonState> buttons = _lastState.getButtonStates(); + + setStateForButton(e, buttons, ButtonState.UP); + + final MouseButton b = getButtonForEvent(e); + if (_clickArmed.contains(b) && (System.currentTimeMillis() - _lastClickTime.get(b) <= MouseState.CLICK_TIME_MS)) { + _clicks.add(b); // increment count of clicks for button b. + // XXX: Note the double event add... this prevents sticky click counts, but is it the best way? + addNewState(e, 0, buttons, EnumMultiset.create(_clicks)); + } else { + _clicks.setCount(b, 0); // clear click count for button b. + } + _clickArmed.remove(b); + + addNewState(e, 0, buttons, null); + } + + private int getDX(final MouseEvent e) { + return e.x - _lastState.getX(); + } + + private int getDY(final MouseEvent e) { + return getArdor3DY(e) - _lastState.getY(); + } + + /** + * @param e + * our mouseEvent + * @return the Y coordinate of the event, flipped relative to the component since we expect an origin in the lower + * left corner. + */ + private int getArdor3DY(final MouseEvent e) { + return _control.getSize().y - e.y; + } + + private void setStateForButton(final MouseEvent e, final EnumMap<MouseButton, ButtonState> buttons, + final ButtonState buttonState) { + final MouseButton button = getButtonForEvent(e); + buttons.put(button, buttonState); + } + + private MouseButton getButtonForEvent(final MouseEvent e) { + MouseButton button; + switch (e.button) { // ordering is different than swt + case 1: + button = MouseButton.LEFT; + break; + case 3: + button = MouseButton.RIGHT; + break; + case 2: + button = MouseButton.MIDDLE; + break; + default: + throw new RuntimeException("unknown button: " + e.button); + } + return button; + } + + public synchronized void mouseMove(final MouseEvent mouseEvent) { + _clickArmed.clear(); + _clicks.clear(); + + // check that we have a valid _lastState + initState(mouseEvent); + + addNewState(mouseEvent, 0, _lastState.getButtonStates(), null); + } + + public synchronized void mouseScrolled(final MouseEvent mouseEvent) { + initState(mouseEvent); + + addNewState(mouseEvent, mouseEvent.count, _lastState.getButtonStates(), null); + } + + private void initState(final MouseEvent mouseEvent) { + if (_lastState == null) { + _lastState = new MouseState(mouseEvent.x, getArdor3DY(mouseEvent), 0, 0, 0, null, null); + } + } + + private void addNewState(final MouseEvent mouseEvent, final int wheelDX, + final EnumMap<MouseButton, ButtonState> buttons, final Multiset<MouseButton> clicks) { + + final MouseState newState = new MouseState(mouseEvent.x, getArdor3DY(mouseEvent), getDX(mouseEvent), + getDY(mouseEvent), wheelDX, buttons, clicks); + + _upcomingEvents.add(newState); + _lastState = newState; + } + + private class SwtMouseIterator extends AbstractIterator<MouseState> implements PeekingIterator<MouseState> { + @Override + protected MouseState computeNext() { + synchronized (SwtMouseWrapper.this) { + if (_upcomingEvents.isEmpty()) { + return endOfData(); + } + + return _upcomingEvents.poll(); + } + } + } +} diff --git a/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtKeyboardWrapper.java b/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtKeyboardWrapper.java new file mode 100644 index 0000000..6586584 --- /dev/null +++ b/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtKeyboardWrapper.java @@ -0,0 +1,117 @@ +/**
+ * Copyright (c) 2008-2012 Ardor Labs, Inc.
+ *
+ * This file is part of Ardor3D.
+ *
+ * Ardor3D is free software: you can redistribute it and/or modify it
+ * under the terms of its license which may be found in the accompanying
+ * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
+ */
+
+package com.ardor3d.input.swt;
+
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
+import java.util.Iterator;
+
+import org.eclipse.swt.widgets.Event;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.ardor3d.framework.swt.SwtCanvas;
+import com.ardor3d.input.Key;
+import com.ardor3d.input.KeyEvent;
+import com.ardor3d.input.KeyState;
+
+public class TestSwtKeyboardWrapper {
+ SwtKeyboardWrapper kw;
+
+ SwtCanvas control;
+
+ org.eclipse.swt.events.KeyEvent e1, e2;
+
+ @Before
+ public void setup() throws Exception {
+ control = createMock("control", SwtCanvas.class);
+
+ kw = new SwtKeyboardWrapper(control);
+
+ final Event event = new Event();
+ event.widget = control;
+
+ e1 = new org.eclipse.swt.events.KeyEvent(event);
+ e2 = new org.eclipse.swt.events.KeyEvent(event);
+ }
+
+ @Test
+ public void testKeys1() throws Exception {
+
+ e1.keyCode = 'a';
+
+ kw.keyPressed(e1);
+ kw.keyReleased(e1);
+
+ final Iterator<KeyEvent> events = kw.getEvents();
+
+ final KeyEvent event1 = events.next();
+ final KeyEvent event2 = events.next();
+
+ assertFalse("no more", events.hasNext());
+ assertFalse("no more", kw.getEvents().hasNext());
+
+ assertEquals("key a", Key.A, event1.getKey());
+ assertEquals("down", KeyState.DOWN, event1.getState());
+
+ assertEquals("key a", Key.A, event2.getKey());
+ assertEquals("up", KeyState.UP, event2.getState());
+ }
+
+ @Test
+ public void testKeys2() throws Exception {
+ e1.keyCode = 'a';
+ e2.keyCode = 'b';
+
+ kw.keyPressed(e1);
+ kw.keyPressed(e2);
+
+ final Iterator<KeyEvent> events = kw.getEvents();
+
+ final KeyEvent event1 = events.next();
+ final KeyEvent event2 = events.next();
+ final KeyEvent event3 = events.next();
+
+ assertFalse("no more", events.hasNext());
+ assertFalse("no more", kw.getEvents().hasNext());
+
+ assertEquals("key a", Key.A, event1.getKey());
+ assertEquals("down", KeyState.DOWN, event1.getState());
+
+ assertEquals("key a", Key.A, event2.getKey());
+ assertEquals("up", KeyState.UP, event2.getState());
+
+ assertEquals("key b", Key.B, event3.getKey());
+ assertEquals("down", KeyState.DOWN, event3.getState());
+ }
+
+ @Test
+ public void testKeysRepeat() throws Exception {
+
+ e1.keyCode = 'a';
+
+ kw.keyPressed(e1);
+ kw.keyPressed(e1);
+
+ final Iterator<KeyEvent> events = kw.getEvents();
+
+ final KeyEvent event1 = events.next();
+
+ assertFalse("no more", events.hasNext());
+ assertFalse("no more", kw.getEvents().hasNext());
+
+ assertEquals("key a", Key.A, event1.getKey());
+ assertEquals("down", KeyState.DOWN, event1.getState());
+ }
+
+}
diff --git a/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtMouseWrapper.java b/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtMouseWrapper.java new file mode 100644 index 0000000..5e2dfeb --- /dev/null +++ b/ardor3d-swt/src/test/java/com/ardor3d/input/swt/TestSwtMouseWrapper.java @@ -0,0 +1,235 @@ +/**
+ * Copyright (c) 2008-2012 Ardor Labs, Inc.
+ *
+ * This file is part of Ardor3D.
+ *
+ * Ardor3D is free software: you can redistribute it and/or modify it
+ * under the terms of its license which may be found in the accompanying
+ * LICENSE file or at <http://www.ardor3d.com/LICENSE>.
+ */
+
+package com.ardor3d.input.swt;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.classextension.EasyMock.createMock;
+import static org.easymock.classextension.EasyMock.replay;
+import static org.easymock.classextension.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Iterator;
+
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Event;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.ardor3d.framework.swt.SwtCanvas;
+import com.ardor3d.input.ButtonState;
+import com.ardor3d.input.MouseButton;
+import com.ardor3d.input.MouseState;
+
+public class TestSwtMouseWrapper {
+ SwtMouseWrapper wrapper;
+
+ SwtCanvas control;
+
+ MouseEvent e1, e2;
+
+ Object[] mocks;
+
+ @Before
+ public void setup() throws Exception {
+ control = createMock("control", SwtCanvas.class);
+
+ wrapper = new SwtMouseWrapper(control);
+ final Event event = new Event();
+ event.widget = control;
+
+ e1 = new MouseEvent(event);
+ e2 = new MouseEvent(event);
+
+ mocks = new Object[] { control };
+ }
+
+ @After
+ public void verifyMocks() throws Exception {
+ verify(mocks);
+ }
+
+ @Test
+ public void testMove1() throws Exception {
+ control.addMouseListener(wrapper);
+ control.addMouseMoveListener(wrapper);
+ control.addMouseWheelListener(wrapper);
+
+ expect(control.getSize()).andReturn(new Point(100, 100)).atLeastOnce();
+
+ replay(mocks);
+
+ wrapper.init();
+
+ setXY(e1, 2, 0);
+
+ wrapper.mouseMove(e1);
+
+ MouseState state = wrapper.getEvents().next();
+
+ assertFalse("no more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 2, state.getX());
+ assertEquals("dx", 0, state.getDx());
+ assertEquals("y", 100, state.getY());
+ assertEquals("dy", 0, state.getDy());
+
+ for (final ButtonState bs : state.getButtonStates().values()) {
+ assertEquals("up", ButtonState.UP, bs);
+ }
+
+ setXY(e1, 4, 0);
+
+ wrapper.mouseMove(e1);
+
+ state = wrapper.getEvents().next();
+
+ assertFalse("no more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 4, state.getX());
+ assertEquals("dx", 2, state.getDx());
+ assertEquals("y", 100, state.getY());
+ assertEquals("dy", 0, state.getDy());
+
+ for (final ButtonState bs : state.getButtonStates().values()) {
+ assertEquals("up", ButtonState.UP, bs);
+ }
+
+ setXY(e1, 2, 4);
+
+ wrapper.mouseMove(e1);
+
+ state = wrapper.getEvents().next();
+
+ assertFalse("no more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 2, state.getX());
+ assertEquals("dx", -2, state.getDx());
+ assertEquals("y", 96, state.getY());
+ assertEquals("dy", -4, state.getDy());
+
+ for (final ButtonState bs : state.getButtonStates().values()) {
+ assertEquals("up", ButtonState.UP, bs);
+ }
+ }
+
+ @Test
+ public void testButtons() throws Exception {
+ control.addMouseListener(wrapper);
+ control.addMouseMoveListener(wrapper);
+ control.addMouseWheelListener(wrapper);
+
+ expect(control.getSize()).andReturn(new Point(100, 100)).atLeastOnce();
+
+ replay(mocks);
+
+ wrapper.init();
+
+ // mouse down, then drag
+ setWithButtons(e1, 0, 0, 1);
+ wrapper.mouseDown(e1);
+
+ setXY(e2, 2, 4);
+ wrapper.mouseMove(e2);
+
+ final Iterator<MouseState> events = wrapper.getEvents();
+
+ MouseState s1 = events.next();
+ final MouseState s2 = events.next();
+
+ assertFalse("more events", events.hasNext());
+ assertFalse("more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 0, s1.getX());
+ assertEquals("dx", 0, s1.getDx());
+ assertEquals("y", 100, s1.getY());
+ assertEquals("dy", 0, s1.getDy());
+ assertTrue("left down", s1.getButtonState(MouseButton.LEFT) == ButtonState.DOWN);
+ assertFalse("right down", s1.getButtonState(MouseButton.RIGHT) == ButtonState.DOWN);
+
+ assertEquals("x", 2, s2.getX());
+ assertEquals("dx", 2, s2.getDx());
+ assertEquals("y", 96, s2.getY());
+ assertEquals("dy", -4, s2.getDy());
+ assertTrue("left down", s2.getButtonState(MouseButton.LEFT) == ButtonState.DOWN);
+ assertFalse("right down", s2.getButtonState(MouseButton.RIGHT) == ButtonState.DOWN);
+
+ // press right button
+ setWithButtons(e1, 2, 4, 3);
+ wrapper.mouseDown(e1);
+
+ s1 = wrapper.getEvents().next();
+
+ assertFalse("more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 2, s1.getX());
+ assertEquals("dx", 0, s1.getDx());
+ assertEquals("y", 96, s1.getY());
+ assertEquals("dy", 0, s1.getDy());
+ assertTrue("left down", s1.getButtonState(MouseButton.LEFT) == ButtonState.DOWN);
+ assertTrue("right down", s1.getButtonState(MouseButton.RIGHT) == ButtonState.DOWN);
+
+ // release left button
+ setWithButtons(e1, 3, 5, 1);
+ wrapper.mouseUp(e1);
+
+ s1 = wrapper.getEvents().next();
+
+ // Because we moved the mouse, there should not be a click count for the left button release...
+ assertTrue("clicked", s1.getClickCount(MouseButton.LEFT) == 0);
+
+ assertFalse("more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 3, s1.getX());
+ assertEquals("dx", 1, s1.getDx());
+ assertEquals("y", 95, s1.getY());
+ assertEquals("dy", -1, s1.getDy());
+ assertFalse("left down", s1.getButtonState(MouseButton.LEFT) == ButtonState.DOWN);
+ assertTrue("right down", s1.getButtonState(MouseButton.RIGHT) == ButtonState.DOWN);
+
+ // release right button
+ setWithButtons(e1, 3, 5, 3);
+ wrapper.mouseUp(e1);
+
+ // We expect two state, one with a clickcount of 1,
+ s1 = wrapper.getEvents().next();
+
+ assertTrue("clicked", s1.getClickCount(MouseButton.RIGHT) == 1);
+
+ // and then the same state, but with clickcount of 0
+ s1 = wrapper.getEvents().next();
+
+ assertFalse("more events", wrapper.getEvents().hasNext());
+
+ assertEquals("x", 3, s1.getX());
+ assertEquals("dx", 0, s1.getDx());
+ assertEquals("y", 95, s1.getY());
+ assertEquals("dy", 0, s1.getDy());
+ assertFalse("left down", s1.getButtonState(MouseButton.LEFT) == ButtonState.DOWN);
+ assertFalse("right down", s1.getButtonState(MouseButton.RIGHT) == ButtonState.DOWN);
+
+ }
+
+ private void setWithButtons(final MouseEvent event, final int x, final int y, final int button) {
+ event.x = x;
+ event.y = y;
+ event.button = button;
+ }
+
+ private void setXY(final MouseEvent event, final int x, final int y) {
+ event.x = x;
+ event.y = y;
+ }
+
+}
|