mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2025-02-16 21:09:12 +01:00
Formatting (Use spaces instead of tabs)
Added a eclipse formatting profile (Window -> Preferences -> Java -> Code Style -> Formatter -> Import)
This commit is contained in:
parent
52e0256f42
commit
968846b3f7
295
eclipse_code_convention.xml
Normal file
295
eclipse_code_convention.xml
Normal file
@ -0,0 +1,295 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="HIDtoVPADNetworkClient Code Convention" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="160"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="160"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
@ -29,9 +29,10 @@ import net.ash.HIDToVPADNetworkClient.util.Settings;
|
||||
import net.ash.HIDToVPADNetworkClient.util.Utilities;
|
||||
|
||||
/**
|
||||
* Main controller interface, extended by controller drivers.
|
||||
* <br><br>
|
||||
* Main controller interface, extended by controller drivers. <br>
|
||||
* <br>
|
||||
* See {@link LinuxDevInputController} for a full implementation.
|
||||
*
|
||||
* @author ash
|
||||
*/
|
||||
public abstract class Controller implements Runnable {
|
||||
@ -100,16 +101,15 @@ public abstract class Controller implements Runnable{
|
||||
public abstract byte[] pollLatestData();
|
||||
|
||||
/**
|
||||
* Sets up the driver.
|
||||
* <br>
|
||||
* Sets up the driver. <br>
|
||||
* During this method call, a connection will be made with the controller hardware (if required).
|
||||
*
|
||||
* @param arg Driver-specific init argument, see {@link ControllerManager} and {@link ControllerDetector}.
|
||||
* @param arg
|
||||
* Driver-specific init argument, see {@link ControllerManager} and {@link ControllerDetector}.
|
||||
* @return Whether initialization was successful.
|
||||
*/
|
||||
public abstract boolean initController(String identifier);
|
||||
|
||||
|
||||
/**
|
||||
* Destroys the controller driver and ends the polling thread.
|
||||
*/
|
||||
@ -123,7 +123,6 @@ public abstract class Controller implements Runnable{
|
||||
*/
|
||||
public abstract void destroyDriver();
|
||||
|
||||
|
||||
private void endThread() {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
@ -141,7 +140,8 @@ public abstract class Controller implements Runnable{
|
||||
done = shutdownDone;
|
||||
}
|
||||
Utilities.sleep(50);
|
||||
if(i++ > 50) System.out.println("Thread doesn't stop!!");
|
||||
if (i++ > 50)
|
||||
System.out.println("Thread doesn't stop!!");
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
|
@ -59,7 +59,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
||||
|
||||
setVID((short) (identifier.hashCode() & 0xFFFF));
|
||||
setPID((short) ((identifier.hashCode() >> Short.BYTES) & 0xFFFF));
|
||||
System.out.println("[LinuxDevInputController] " + identifier.toString() + " fakevid: " + Integer.toHexString((int)getVID() & 0xFFFF) + " fakepid: " + Integer.toHexString((int)getPID() & 0xFFFF));
|
||||
System.out.println("[LinuxDevInputController] " + identifier.toString() + " fakevid: " + Integer.toHexString((int) getVID() & 0xFFFF) + " fakepid: "
|
||||
+ Integer.toHexString((int) getPID() & 0xFFFF));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -128,7 +129,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
||||
|
||||
@Override
|
||||
protected void doSleepAfterPollingData() {
|
||||
//This is event driven (aka pollLatestData() is blocking anyway until we have data), we don't need to sleep it all.
|
||||
// This is event driven (aka pollLatestData() is blocking anyway until
|
||||
// we have data), we don't need to sleep it all.
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,7 +143,8 @@ public class LinuxDevInputController extends Controller implements Runnable{
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "[" + super.toString() + ";VID," + Integer.toHexString((int)getVID() & 0xFFFF) + ";PID," + Integer.toHexString((int)getPID() & 0xFFFF) + ";run," + isActive() + ((controller == null) ? ";uninitialised]" : ";initialised]");
|
||||
return "[" + super.toString() + ";VID," + Integer.toHexString((int) getVID() & 0xFFFF) + ";PID," + Integer.toHexString((int) getPID() & 0xFFFF)
|
||||
+ ";run," + isActive() + ((controller == null) ? ";uninitialised]" : ";initialised]");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,12 +36,13 @@ import purejavahidapi.InputReportListener;
|
||||
public class PureJavaHidController extends Controller implements InputReportListener {
|
||||
public static Controller getInstance(String deviceIdentifier) throws IOException, ControllerInitializationFailedException {
|
||||
HidDevice device = PureJavaHidApiManager.getDeviceByPath(deviceIdentifier);
|
||||
//We use a special version to optimize the data for the switch pro controller
|
||||
if(device.getHidDeviceInfo().getVendorId() == SwitchProController.SWITCH_PRO_CONTROLLER_VID &&
|
||||
device.getHidDeviceInfo().getProductId() == SwitchProController.SWITCH_PRO_CONTROLLER_PID){
|
||||
// We use a special version to optimize the data for the switch pro
|
||||
// controller
|
||||
if (device.getHidDeviceInfo().getVendorId() == SwitchProController.SWITCH_PRO_CONTROLLER_VID
|
||||
&& device.getHidDeviceInfo().getProductId() == SwitchProController.SWITCH_PRO_CONTROLLER_PID) {
|
||||
return new SwitchProController(deviceIdentifier);
|
||||
}else if(device.getHidDeviceInfo().getVendorId() == DS4NewController.DS4_NEW_CONTROLLER_VID &&
|
||||
device.getHidDeviceInfo().getProductId() == DS4NewController.DS4_NEW_CONTROLLER_PID){
|
||||
} else if (device.getHidDeviceInfo().getVendorId() == DS4NewController.DS4_NEW_CONTROLLER_VID
|
||||
&& device.getHidDeviceInfo().getProductId() == DS4NewController.DS4_NEW_CONTROLLER_PID) {
|
||||
return new DS4NewController(deviceIdentifier);
|
||||
} else {
|
||||
return new PureJavaHidController(deviceIdentifier);
|
||||
@ -57,8 +58,7 @@ public class PureJavaHidController extends Controller implements InputReportList
|
||||
|
||||
protected int PACKET_LENGTH = 64;
|
||||
|
||||
@Getter @Setter(AccessLevel.PRIVATE)
|
||||
private HidDevice hidDevice;
|
||||
@Getter @Setter(AccessLevel.PRIVATE) private HidDevice hidDevice;
|
||||
|
||||
@Override
|
||||
public boolean initController(String identifier) {
|
||||
|
@ -54,7 +54,8 @@ public class XInputController extends Controller {
|
||||
} catch (XInputNotLoadedException e) {
|
||||
// TODO: Log?
|
||||
}
|
||||
if(device == null) return false;
|
||||
if (device == null)
|
||||
return false;
|
||||
setDevice(device);
|
||||
return true;
|
||||
}
|
||||
@ -68,25 +69,41 @@ public class XInputController extends Controller {
|
||||
XInputButtons buttons = components.getButtons();
|
||||
|
||||
int buttonState = 0;
|
||||
if(buttons.a) buttonState |= (1 << 0);
|
||||
if(buttons.b) buttonState |= (1 << 1);
|
||||
if(buttons.x) buttonState |= (1 << 2);
|
||||
if(buttons.y) buttonState |= (1 << 3);
|
||||
if (buttons.a)
|
||||
buttonState |= (1 << 0);
|
||||
if (buttons.b)
|
||||
buttonState |= (1 << 1);
|
||||
if (buttons.x)
|
||||
buttonState |= (1 << 2);
|
||||
if (buttons.y)
|
||||
buttonState |= (1 << 3);
|
||||
|
||||
if(buttons.left) buttonState |= (1 << 4);
|
||||
if(buttons.up) buttonState |= (1 << 5);
|
||||
if(buttons.right) buttonState |= (1 << 6);
|
||||
if(buttons.down) buttonState |= (1 << 7);
|
||||
if (buttons.left)
|
||||
buttonState |= (1 << 4);
|
||||
if (buttons.up)
|
||||
buttonState |= (1 << 5);
|
||||
if (buttons.right)
|
||||
buttonState |= (1 << 6);
|
||||
if (buttons.down)
|
||||
buttonState |= (1 << 7);
|
||||
|
||||
if(buttons.back) buttonState |= (1 << 8);
|
||||
if(buttons.start) buttonState |= (1 << 9);
|
||||
if(buttons.lShoulder) buttonState |= (1 << 10);
|
||||
if(buttons.rShoulder) buttonState |= (1 << 11);
|
||||
if(buttons.lThumb) buttonState |= (1 << 12);
|
||||
if(buttons.rThumb) buttonState |= (1 << 13);
|
||||
if(buttons.unknown) buttonState |= (1 << 14);
|
||||
if (buttons.back)
|
||||
buttonState |= (1 << 8);
|
||||
if (buttons.start)
|
||||
buttonState |= (1 << 9);
|
||||
if (buttons.lShoulder)
|
||||
buttonState |= (1 << 10);
|
||||
if (buttons.rShoulder)
|
||||
buttonState |= (1 << 11);
|
||||
if (buttons.lThumb)
|
||||
buttonState |= (1 << 12);
|
||||
if (buttons.rThumb)
|
||||
buttonState |= (1 << 13);
|
||||
if (buttons.unknown)
|
||||
buttonState |= (1 << 14);
|
||||
if (XInputDevice.isGuideButtonSupported()) {
|
||||
if (buttons.guide) buttonState |= (1 << 15);
|
||||
if (buttons.guide)
|
||||
buttonState |= (1 << 15);
|
||||
}
|
||||
|
||||
XInputAxes axes = components.getAxes();
|
||||
|
@ -36,21 +36,26 @@ public class GuiCloseListener implements WindowListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowActivated(WindowEvent arg0) {}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent arg0) {}
|
||||
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent arg0) {}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent arg0) {}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent arg0) {}
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent arg0) {}
|
||||
public void windowActivated(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowDeiconified(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowIconified(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void windowOpened(WindowEvent arg0) {
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,8 @@ public class GuiControllerList extends JPanel {
|
||||
}
|
||||
|
||||
public synchronized void updateControllerList() {
|
||||
//System.out.println("[GuiControllerList] Updating controller list..."); //XXX debug text
|
||||
// System.out.println("[GuiControllerList] Updating controller
|
||||
// list..."); //XXX debug text
|
||||
|
||||
boolean repaintNeeded = false;
|
||||
|
||||
|
@ -66,7 +66,6 @@ public class GuiInputControls extends JPanel implements ActionListener {
|
||||
connectButton = new JButton(CONNECT);
|
||||
connectButton.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||
|
||||
|
||||
ipTextBox = new JTextField();
|
||||
ipTextBox.setColumns(15);
|
||||
ipTextBox.setText(Settings.getIpAddr());
|
||||
|
@ -50,6 +50,7 @@ public class GuiMain extends JPanel {
|
||||
|
||||
private GuiControllerList leftControllerList;
|
||||
private GuiInputControls rightSideControls;
|
||||
|
||||
public GuiMain() {
|
||||
super(new BorderLayout());
|
||||
|
||||
|
@ -70,6 +70,7 @@ public class ActiveControllerManager implements Runnable{
|
||||
}
|
||||
|
||||
private Map<Controller, NetworkHIDDevice> activeControllers = new HashMap<Controller, NetworkHIDDevice>();
|
||||
|
||||
public void updateControllerStates() {
|
||||
List<Controller> currentControllers = ControllerManager.getActiveControllers();
|
||||
|
||||
|
@ -109,9 +109,7 @@ public class ControllerManager{
|
||||
}
|
||||
break;
|
||||
/*
|
||||
* TODO:
|
||||
* Currently the XInput will be set active automatically.
|
||||
* But this should move to something for the settings?
|
||||
* TODO: Currently the XInput will be set active automatically. But this should move to something for the settings?
|
||||
*/
|
||||
case XINPUT14:
|
||||
try {
|
||||
@ -132,7 +130,8 @@ public class ControllerManager{
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if(c != null){ //I don't like that starting the Thread happens here =/
|
||||
if (c != null) { // I don't like that starting the Thread
|
||||
// happens here =/
|
||||
new Thread(c).start();
|
||||
attachedControllers.put(deviceIdentifier, c);
|
||||
}
|
||||
@ -180,7 +179,10 @@ public class ControllerManager{
|
||||
XInputDevice device;
|
||||
try {
|
||||
device = XInputDevice.getDeviceFor(i);
|
||||
if(device.poll() && device.isConnected()){ //Check if it is this controller is connected
|
||||
if (device.poll() && device.isConnected()) { // Check if it
|
||||
// is this
|
||||
// controller
|
||||
// is connected
|
||||
result.put(XInputController.XINPUT_INDENTIFER + i, type);
|
||||
}
|
||||
} catch (XInputNotLoadedException e) {
|
||||
@ -196,7 +198,8 @@ public class ControllerManager{
|
||||
private static Map<String, ControllerType> detectLinuxControllers() {
|
||||
Map<String, ControllerType> result = new HashMap<String, ControllerType>();
|
||||
File devInput = new File("/dev/input");
|
||||
if (!devInput.exists()) return result;
|
||||
if (!devInput.exists())
|
||||
return result;
|
||||
|
||||
File[] linuxControllers = devInput.listFiles(new FilenameFilter() {
|
||||
public boolean accept(File dir, String name) {
|
||||
|
@ -35,7 +35,6 @@ import net.ash.HIDToVPADNetworkClient.network.commands.DetachCommand;
|
||||
import net.ash.HIDToVPADNetworkClient.network.commands.DeviceCommand;
|
||||
import net.ash.HIDToVPADNetworkClient.network.commands.ReadCommand;
|
||||
import net.ash.HIDToVPADNetworkClient.util.HandleFoundry;
|
||||
import net.ash.HIDToVPADNetworkClient.util.Utilities;
|
||||
|
||||
public class NetworkHIDDevice {
|
||||
@Getter private final short vid;
|
||||
@ -73,6 +72,7 @@ public class NetworkHIDDevice {
|
||||
}
|
||||
|
||||
private byte[] lastdata = null;
|
||||
|
||||
public void sendRead(byte[] data) {
|
||||
if (!Arrays.equals(lastdata, data)) {
|
||||
synchronized (readCommandLock) {
|
||||
|
@ -21,6 +21,7 @@
|
||||
*******************************************************************************/
|
||||
|
||||
package net.ash.HIDToVPADNetworkClient.network;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -70,6 +71,7 @@ public class NetworkManager implements Runnable{
|
||||
* We want to remove them at the end of a cycle. To make sure the detach was send before removing.
|
||||
*/
|
||||
@Getter private List<NetworkHIDDevice> toRemove = new ArrayList<NetworkHIDDevice>();
|
||||
|
||||
@Synchronized("toRemove")
|
||||
public void removeHIDDevice(NetworkHIDDevice device) {
|
||||
device.sendDetach();
|
||||
@ -90,12 +92,15 @@ public class NetworkManager implements Runnable{
|
||||
}
|
||||
|
||||
private void ping() {
|
||||
if(isConnected() || tcpClient.isShouldRetry())sendingCommand(new PingCommand());
|
||||
if (isConnected() || tcpClient.isShouldRetry())
|
||||
sendingCommand(new PingCommand());
|
||||
}
|
||||
|
||||
public void proccessCommands() {
|
||||
List<DeviceCommand> commands = new ArrayList<DeviceCommand>();
|
||||
commands.addAll(ownCommands); //TODO: Does this need a synchronized block? It _should_ be only access from this thread. Need to think about it
|
||||
commands.addAll(ownCommands); // TODO: Does this need a synchronized
|
||||
// block? It _should_ be only access from
|
||||
// this thread. Need to think about it
|
||||
ownCommands.clear();
|
||||
synchronized (toRemove) {
|
||||
synchronized (devices) {
|
||||
@ -105,7 +110,8 @@ public class NetworkManager implements Runnable{
|
||||
}
|
||||
}
|
||||
|
||||
if(commands.isEmpty())return;
|
||||
if (commands.isEmpty())
|
||||
return;
|
||||
|
||||
// Split up into "read commands" and other commands.
|
||||
List<ReadCommand> readCommands = new ArrayList<ReadCommand>();
|
||||
|
@ -48,34 +48,24 @@ public class Protocol {
|
||||
|
||||
public static final byte UDP_CMD_DATA = 0x03;
|
||||
|
||||
|
||||
public static final byte TCP_CMD_ATTACH_CONFIG_FOUND = (byte) 0xE0;
|
||||
public static final byte TCP_CMD_ATTACH_CONFIG_NOT_FOUND = (byte) 0xE1;
|
||||
public static final byte TCP_CMD_ATTACH_USERDATA_OKAY = (byte) 0xE8;
|
||||
public static final byte TCP_CMD_ATTACH_USERDATA_BAD = (byte) 0xE9;
|
||||
|
||||
private Protocol(){}
|
||||
private Protocol() {
|
||||
}
|
||||
|
||||
public enum HandshakeReturnCode {
|
||||
BAD_HANDSHAKE,
|
||||
SAME_CLIENT,
|
||||
NEW_CLIENT
|
||||
BAD_HANDSHAKE, SAME_CLIENT, NEW_CLIENT
|
||||
}
|
||||
|
||||
public static byte[] getRawAttachDataToSend(AttachCommand command) throws IOException {
|
||||
return ByteBuffer.allocate(9)
|
||||
.put(Protocol.TCP_CMD_ATTACH)
|
||||
.putInt(command.getHandle())
|
||||
.putShort(command.getVid())
|
||||
.putShort(command.getPid())
|
||||
.array();
|
||||
return ByteBuffer.allocate(9).put(Protocol.TCP_CMD_ATTACH).putInt(command.getHandle()).putShort(command.getVid()).putShort(command.getPid()).array();
|
||||
}
|
||||
|
||||
public static byte[] getRawDetachDataToSend(DetachCommand command) throws IOException {
|
||||
return ByteBuffer.allocate(5)
|
||||
.put(Protocol.TCP_CMD_DETACH)
|
||||
.putInt(command.getHandle())
|
||||
.array();
|
||||
return ByteBuffer.allocate(5).put(Protocol.TCP_CMD_DETACH).putInt(command.getHandle()).array();
|
||||
}
|
||||
|
||||
public static byte[] getRawPingDataToSend(PingCommand command) {
|
||||
|
@ -44,8 +44,7 @@ public class TCPClient {
|
||||
private DataOutputStream out;
|
||||
@Getter private int clientID = HandleFoundry.next();
|
||||
|
||||
@Getter @Setter(AccessLevel.PRIVATE)
|
||||
private int shouldRetry = Settings.MAXIMUM_TRIES_FOR_RECONNECTING;
|
||||
@Getter @Setter(AccessLevel.PRIVATE) private int shouldRetry = Settings.MAXIMUM_TRIES_FOR_RECONNECTING;
|
||||
|
||||
private String ip;
|
||||
|
||||
@ -65,7 +64,9 @@ public class TCPClient {
|
||||
throw new Exception();
|
||||
} else {
|
||||
if (resultHandshake == HandshakeReturnCode.NEW_CLIENT && this.ip != null) {
|
||||
//We check the IP to be sure it's the first time we connect to a WiiU. //TODO: Sending a ID from the WiiU which will be compared?
|
||||
// We check the IP to be sure it's the first time we connect to
|
||||
// a WiiU. //TODO: Sending a ID from the WiiU which will be
|
||||
// compared?
|
||||
// we are new to the client.
|
||||
ActiveControllerManager.getInstance().attachAllActiveControllers();
|
||||
} else if (resultHandshake == HandshakeReturnCode.SAME_CLIENT) {
|
||||
@ -77,7 +78,8 @@ public class TCPClient {
|
||||
}
|
||||
|
||||
private synchronized HandshakeReturnCode doHandshake() throws Exception {
|
||||
if (recvByte() != Protocol.TCP_HANDSHAKE) return HandshakeReturnCode.BAD_HANDSHAKE;
|
||||
if (recvByte() != Protocol.TCP_HANDSHAKE)
|
||||
return HandshakeReturnCode.BAD_HANDSHAKE;
|
||||
send(clientID);
|
||||
log.info("[TCP] Handshaking...");
|
||||
HandshakeReturnCode test = (recvByte() == Protocol.TCP_NEW_CLIENT) ? HandshakeReturnCode.NEW_CLIENT : HandshakeReturnCode.SAME_CLIENT;
|
||||
@ -104,7 +106,9 @@ public class TCPClient {
|
||||
try {
|
||||
if (shouldRetry++ < Settings.MAXIMUM_TRIES_FOR_RECONNECTING) {
|
||||
System.out.println("Trying again to connect! Attempt number " + shouldRetry);
|
||||
connect(ip); //TODO: this is for reconnecting when the WiiU switches the application. But this breaks disconnecting, woops.
|
||||
connect(ip); // TODO: this is for reconnecting when the WiiU
|
||||
// switches the application. But this breaks
|
||||
// disconnecting, woops.
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ public class UDPClient {
|
||||
sock = new DatagramSocket();
|
||||
host = InetAddress.getByName(ip);
|
||||
}
|
||||
|
||||
public static UDPClient createUDPClient(String ip) {
|
||||
UDPClient result = null;
|
||||
try {
|
||||
|
@ -20,6 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*******************************************************************************/
|
||||
package net.ash.HIDToVPADNetworkClient.network.commands;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
* SOFTWARE.
|
||||
*******************************************************************************/
|
||||
package net.ash.HIDToVPADNetworkClient.network.commands;
|
||||
|
||||
import lombok.Data;
|
||||
import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
||||
|
||||
|
@ -27,6 +27,7 @@ public class PingCommand extends DeviceCommand {
|
||||
public PingCommand() {
|
||||
this((short) 0, null);
|
||||
}
|
||||
|
||||
private PingCommand(int hidHandle, NetworkHIDDevice sender) {
|
||||
super(hidHandle, sender);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import net.ash.HIDToVPADNetworkClient.network.NetworkHIDDevice;
|
||||
|
||||
public class ReadCommand extends DeviceCommand {
|
||||
@Getter private final byte[] data;
|
||||
|
||||
public ReadCommand(int hidHandle, byte[] data, NetworkHIDDevice sender) {
|
||||
super(hidHandle, sender);
|
||||
this.data = data;
|
||||
|
@ -28,10 +28,12 @@ package net.ash.HIDToVPADNetworkClient.util;
|
||||
import java.util.Random;
|
||||
|
||||
public class HandleFoundry {
|
||||
//We start with a random value, so we have at each startup a different clientID!
|
||||
// We start with a random value, so we have at each startup a different
|
||||
// clientID!
|
||||
private static int h = new Random().nextInt();
|
||||
|
||||
private HandleFoundry(){}
|
||||
private HandleFoundry() {
|
||||
}
|
||||
|
||||
public static int next() {
|
||||
return h++;
|
||||
|
@ -30,13 +30,16 @@ import purejavahidapi.PureJavaHidApi;
|
||||
|
||||
public class PureJavaHidApiManager {
|
||||
|
||||
private PureJavaHidApiManager(){}
|
||||
private PureJavaHidApiManager() {
|
||||
}
|
||||
|
||||
public static boolean MAC_OS_X;
|
||||
|
||||
/**
|
||||
* Searches the corresponding HIDDevice for the given path
|
||||
* @param path Path of the HIDDevice
|
||||
*
|
||||
* @param path
|
||||
* Path of the HIDDevice
|
||||
* @return It the device is found, it will be returned. Otherwise null is returned.
|
||||
* @throws IOException
|
||||
*/
|
||||
|
@ -46,10 +46,10 @@ public class Settings {
|
||||
public static final int PING_INTERVAL = 1000;
|
||||
public static final int PROCESS_CMD_INTERVAL = 10;
|
||||
|
||||
@Getter @Setter
|
||||
private static String ipAddr = "192.168.0.35"; //@Maschell, you're welcome
|
||||
@Getter @Setter private static String ipAddr = "192.168.0.35"; // @Maschell, you're welcome
|
||||
|
||||
private Settings() {}
|
||||
private Settings() {
|
||||
}
|
||||
|
||||
public static void loadSettings() {
|
||||
File configDir = new File(getConfigDir());
|
||||
|
@ -23,11 +23,14 @@ package net.ash.HIDToVPADNetworkClient.util;
|
||||
|
||||
public class Utilities {
|
||||
|
||||
private Utilities(){}
|
||||
private Utilities() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Let me just sleep!
|
||||
* @param ms sleep duration in ms
|
||||
*
|
||||
* @param ms
|
||||
* sleep duration in ms
|
||||
*/
|
||||
public static void sleep(int ms) {
|
||||
try {
|
||||
@ -38,11 +41,14 @@ public class Utilities{
|
||||
|
||||
/**
|
||||
* Convert a byte array to a formated String
|
||||
* @param ba byte array
|
||||
*
|
||||
* @param ba
|
||||
* byte array
|
||||
* @return String representing the binary data
|
||||
*/
|
||||
public static String ByteArrayToString(byte[] ba) {
|
||||
if(ba == null) return null;
|
||||
if (ba == null)
|
||||
return null;
|
||||
StringBuilder hex = new StringBuilder(ba.length * 2);
|
||||
for (byte b : ba) {
|
||||
hex.append(String.format("%02X", b));
|
||||
@ -52,7 +58,9 @@ public class Utilities{
|
||||
|
||||
/**
|
||||
* Converts a signed short value to a unsigned byte
|
||||
* @param value short value
|
||||
*
|
||||
* @param value
|
||||
* short value
|
||||
* @return converted value
|
||||
*/
|
||||
public static short signedShortToByte(int value) {
|
||||
@ -61,7 +69,9 @@ public class Utilities{
|
||||
|
||||
/**
|
||||
* Converts a signed short value to a unsigned byte
|
||||
* @param value short value
|
||||
*
|
||||
* @param value
|
||||
* short value
|
||||
* @return converted value
|
||||
*/
|
||||
public static short signedShortToByte(short value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user