diff --git a/.gitattributes b/.gitattributes
deleted file mode 100644
index bdb0cab..0000000
--- a/.gitattributes
+++ /dev/null
@@ -1,17 +0,0 @@
-# Auto detect text files and perform LF normalization
-* text=auto
-
-# Custom for Visual Studio
-*.cs diff=csharp
-
-# Standard to msysgit
-*.doc diff=astextplain
-*.DOC diff=astextplain
-*.docx diff=astextplain
-*.DOCX diff=astextplain
-*.dot diff=astextplain
-*.DOT diff=astextplain
-*.pdf diff=astextplain
-*.PDF diff=astextplain
-*.rtf diff=astextplain
-*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
index 6650b99..0a517c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,4 +54,8 @@ out/
.idea/
*.iml
src/META-INF/MANIFEST.MF
-.metadata/
\ No newline at end of file
+.metadata/
+/.gradle/
+/build/
+.settings/
+.project
diff --git a/.project b/.project
deleted file mode 100644
index 1914fcc..0000000
--- a/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- ModelCreator
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 99f26c0..0000000
--- a/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/=UTF-8
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d8223dc..0000000
--- a/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,285 +0,0 @@
-eclipse.preferences.version=1
-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_annotation=0
-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_method_declaration=0
-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_resources_in_try=80
-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.alignment_for_union_type_in_multicatch=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=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=next_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=next_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=80
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-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.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
-org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-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_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=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_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=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_after_type_annotation=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=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=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=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_try=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_semicolon_in_try_resources=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_try=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_lambda_arrow=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_try=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_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=500
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=false
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index f74f954..0000000
--- a/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-eclipse.preferences.version=1
-formatter_profile=_Eclipse [built-in] Edit
-formatter_settings_version=12
diff --git a/license.txt b/LICENSE
similarity index 100%
rename from license.txt
rename to LICENSE
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..a906ee1
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,30 @@
+apply plugin: "java"
+apply plugin: "application"
+
+version = "pre5"
+mainClassName = "com.mrcrayfish.modelcreator.Start"
+sourceCompatibility = targetCompatibility = 1.8
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile 'com.google.code.gson:gson:2.8.5'
+ compile 'org.slick2d:slick2d-core:1.0.2'
+ compile 'com.jtattoo:JTattoo:1.6.11'
+
+ compile 'org.lwjgl.lwjgl:lwjgl:2.9.3'
+ compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.3'
+ compile 'org.lwjgl.lwjgl:lwjgl-platform:2.9.3'
+}
+
+jar {
+ manifest {
+ attributes "Main-Class": mainClassName
+ }
+
+ from {
+ configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
+ }
+}
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..0d4a951
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..a95009c
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..f955316
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/libs/JTattoo-1.6.11.jar b/libs/JTattoo-1.6.11.jar
deleted file mode 100644
index 1324fb6..0000000
Binary files a/libs/JTattoo-1.6.11.jar and /dev/null differ
diff --git a/libs/gson-2.3.1.jar b/libs/gson-2.3.1.jar
deleted file mode 100644
index 250132c..0000000
Binary files a/libs/gson-2.3.1.jar and /dev/null differ
diff --git a/libs/lwjgl.jar b/libs/lwjgl.jar
deleted file mode 100644
index 82294e1..0000000
Binary files a/libs/lwjgl.jar and /dev/null differ
diff --git a/libs/lwjgl_util.jar b/libs/lwjgl_util.jar
deleted file mode 100644
index 97911ab..0000000
Binary files a/libs/lwjgl_util.jar and /dev/null differ
diff --git a/libs/slick-util.jar b/libs/slick-util.jar
deleted file mode 100644
index 10b552a..0000000
Binary files a/libs/slick-util.jar and /dev/null differ
diff --git a/natives/linux/libjinput-linux.so b/natives/linux/libjinput-linux.so
deleted file mode 100644
index 3cdc439..0000000
Binary files a/natives/linux/libjinput-linux.so and /dev/null differ
diff --git a/natives/linux/libjinput-linux64.so b/natives/linux/libjinput-linux64.so
deleted file mode 100644
index de1ee5f..0000000
Binary files a/natives/linux/libjinput-linux64.so and /dev/null differ
diff --git a/natives/linux/liblwjgl.so b/natives/linux/liblwjgl.so
deleted file mode 100644
index ba6e7f6..0000000
Binary files a/natives/linux/liblwjgl.so and /dev/null differ
diff --git a/natives/linux/liblwjgl64.so b/natives/linux/liblwjgl64.so
deleted file mode 100644
index 8ed0992..0000000
Binary files a/natives/linux/liblwjgl64.so and /dev/null differ
diff --git a/natives/linux/libopenal.so b/natives/linux/libopenal.so
deleted file mode 100644
index 0a3a619..0000000
Binary files a/natives/linux/libopenal.so and /dev/null differ
diff --git a/natives/linux/libopenal64.so b/natives/linux/libopenal64.so
deleted file mode 100644
index e0693c0..0000000
Binary files a/natives/linux/libopenal64.so and /dev/null differ
diff --git a/natives/macosx/libjinput-osx.dylib b/natives/macosx/libjinput-osx.dylib
deleted file mode 100644
index 59a3eab..0000000
Binary files a/natives/macosx/libjinput-osx.dylib and /dev/null differ
diff --git a/natives/macosx/liblwjgl.dylib b/natives/macosx/liblwjgl.dylib
deleted file mode 100644
index a6083b9..0000000
Binary files a/natives/macosx/liblwjgl.dylib and /dev/null differ
diff --git a/natives/macosx/openal.dylib b/natives/macosx/openal.dylib
deleted file mode 100644
index 3c6d0f7..0000000
Binary files a/natives/macosx/openal.dylib and /dev/null differ
diff --git a/natives/solaris/liblwjgl.so b/natives/solaris/liblwjgl.so
deleted file mode 100644
index 4e2d8cc..0000000
Binary files a/natives/solaris/liblwjgl.so and /dev/null differ
diff --git a/natives/solaris/liblwjgl64.so b/natives/solaris/liblwjgl64.so
deleted file mode 100644
index 2573d63..0000000
Binary files a/natives/solaris/liblwjgl64.so and /dev/null differ
diff --git a/natives/solaris/libopenal.so b/natives/solaris/libopenal.so
deleted file mode 100644
index be5dbce..0000000
Binary files a/natives/solaris/libopenal.so and /dev/null differ
diff --git a/natives/solaris/libopenal64.so b/natives/solaris/libopenal64.so
deleted file mode 100644
index 3ef75b5..0000000
Binary files a/natives/solaris/libopenal64.so and /dev/null differ
diff --git a/natives/windows/OpenAL32.dll b/natives/windows/OpenAL32.dll
deleted file mode 100644
index 1f69e94..0000000
Binary files a/natives/windows/OpenAL32.dll and /dev/null differ
diff --git a/natives/windows/OpenAL64.dll b/natives/windows/OpenAL64.dll
deleted file mode 100644
index 6f2a2fe..0000000
Binary files a/natives/windows/OpenAL64.dll and /dev/null differ
diff --git a/natives/windows/jinput-dx8.dll b/natives/windows/jinput-dx8.dll
deleted file mode 100644
index 6d27ad5..0000000
Binary files a/natives/windows/jinput-dx8.dll and /dev/null differ
diff --git a/natives/windows/jinput-dx8_64.dll b/natives/windows/jinput-dx8_64.dll
deleted file mode 100644
index 6730589..0000000
Binary files a/natives/windows/jinput-dx8_64.dll and /dev/null differ
diff --git a/natives/windows/jinput-raw.dll b/natives/windows/jinput-raw.dll
deleted file mode 100644
index ce1d162..0000000
Binary files a/natives/windows/jinput-raw.dll and /dev/null differ
diff --git a/natives/windows/jinput-raw_64.dll b/natives/windows/jinput-raw_64.dll
deleted file mode 100644
index 3d2b3ad..0000000
Binary files a/natives/windows/jinput-raw_64.dll and /dev/null differ
diff --git a/natives/windows/lwjgl.dll b/natives/windows/lwjgl.dll
deleted file mode 100644
index e6c97d9..0000000
Binary files a/natives/windows/lwjgl.dll and /dev/null differ
diff --git a/natives/windows/lwjgl64.dll b/natives/windows/lwjgl64.dll
deleted file mode 100644
index 2c8b93e..0000000
Binary files a/natives/windows/lwjgl64.dll and /dev/null differ
diff --git a/src/com/mrcrayfish/modelcreator/Camera.java b/src/main/java/com/mrcrayfish/modelcreator/Camera.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Camera.java
rename to src/main/java/com/mrcrayfish/modelcreator/Camera.java
diff --git a/src/com/mrcrayfish/modelcreator/Constants.java b/src/main/java/com/mrcrayfish/modelcreator/Constants.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Constants.java
rename to src/main/java/com/mrcrayfish/modelcreator/Constants.java
diff --git a/src/com/mrcrayfish/modelcreator/Exporter.java b/src/main/java/com/mrcrayfish/modelcreator/Exporter.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Exporter.java
rename to src/main/java/com/mrcrayfish/modelcreator/Exporter.java
diff --git a/src/com/mrcrayfish/modelcreator/Icons.java b/src/main/java/com/mrcrayfish/modelcreator/Icons.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Icons.java
rename to src/main/java/com/mrcrayfish/modelcreator/Icons.java
diff --git a/src/com/mrcrayfish/modelcreator/Importer.java b/src/main/java/com/mrcrayfish/modelcreator/Importer.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Importer.java
rename to src/main/java/com/mrcrayfish/modelcreator/Importer.java
diff --git a/src/com/mrcrayfish/modelcreator/Menu.java b/src/main/java/com/mrcrayfish/modelcreator/Menu.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Menu.java
rename to src/main/java/com/mrcrayfish/modelcreator/Menu.java
diff --git a/src/com/mrcrayfish/modelcreator/ModelCreator.java b/src/main/java/com/mrcrayfish/modelcreator/ModelCreator.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/ModelCreator.java
rename to src/main/java/com/mrcrayfish/modelcreator/ModelCreator.java
diff --git a/src/com/mrcrayfish/modelcreator/ProjectManager.java b/src/main/java/com/mrcrayfish/modelcreator/ProjectManager.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/ProjectManager.java
rename to src/main/java/com/mrcrayfish/modelcreator/ProjectManager.java
diff --git a/src/com/mrcrayfish/modelcreator/Settings.java b/src/main/java/com/mrcrayfish/modelcreator/Settings.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/Settings.java
rename to src/main/java/com/mrcrayfish/modelcreator/Settings.java
diff --git a/src/com/mrcrayfish/modelcreator/Start.java b/src/main/java/com/mrcrayfish/modelcreator/Start.java
similarity index 92%
rename from src/com/mrcrayfish/modelcreator/Start.java
rename to src/main/java/com/mrcrayfish/modelcreator/Start.java
index 13a1503..fc923f4 100644
--- a/src/com/mrcrayfish/modelcreator/Start.java
+++ b/src/main/java/com/mrcrayfish/modelcreator/Start.java
@@ -6,11 +6,14 @@
import javax.swing.UIManager;
import com.jtattoo.plaf.fast.FastLookAndFeel;
+import com.mrcrayfish.modelcreator.util.SharedLibraryLoader;
public class Start
{
public static void main(String[] args)
{
+ SharedLibraryLoader.load(false);
+
Double version = Double.parseDouble(System.getProperty("java.specification.version"));
if (version < 1.8)
{
@@ -19,7 +22,6 @@ public static void main(String[] args)
}
System.setProperty("org.lwjgl.util.Debug", "true");
- //System.setProperty("org.lwjgl.librarypath", new File("natives/windows").getAbsolutePath());
try
{
diff --git a/src/com/mrcrayfish/modelcreator/dialog/WelcomeDialog.java b/src/main/java/com/mrcrayfish/modelcreator/dialog/WelcomeDialog.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/dialog/WelcomeDialog.java
rename to src/main/java/com/mrcrayfish/modelcreator/dialog/WelcomeDialog.java
diff --git a/src/com/mrcrayfish/modelcreator/element/Element.java b/src/main/java/com/mrcrayfish/modelcreator/element/Element.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/element/Element.java
rename to src/main/java/com/mrcrayfish/modelcreator/element/Element.java
diff --git a/src/com/mrcrayfish/modelcreator/element/ElementManager.java b/src/main/java/com/mrcrayfish/modelcreator/element/ElementManager.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/element/ElementManager.java
rename to src/main/java/com/mrcrayfish/modelcreator/element/ElementManager.java
diff --git a/src/com/mrcrayfish/modelcreator/element/Face.java b/src/main/java/com/mrcrayfish/modelcreator/element/Face.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/element/Face.java
rename to src/main/java/com/mrcrayfish/modelcreator/element/Face.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/BottomPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/BottomPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/BottomPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/BottomPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/CuboidTabbedPane.java b/src/main/java/com/mrcrayfish/modelcreator/panels/CuboidTabbedPane.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/CuboidTabbedPane.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/CuboidTabbedPane.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/ElementExtraPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/ElementExtraPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/ElementExtraPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/ElementExtraPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/FaceExtrasPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/FaceExtrasPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/FaceExtrasPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/FaceExtrasPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/GlobalPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/GlobalPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/GlobalPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/GlobalPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/IValueUpdater.java b/src/main/java/com/mrcrayfish/modelcreator/panels/IValueUpdater.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/IValueUpdater.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/IValueUpdater.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/OriginPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/OriginPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/OriginPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/OriginPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/PositionPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/PositionPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/PositionPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/PositionPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/SidebarPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/SidebarPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/SidebarPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/SidebarPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/SizePanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/SizePanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/SizePanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/SizePanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/TexturePanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/TexturePanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/TexturePanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/TexturePanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/UVPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/UVPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/UVPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/UVPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/tabs/ElementPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/tabs/ElementPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/tabs/ElementPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/tabs/ElementPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/tabs/FacePanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/tabs/FacePanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/tabs/FacePanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/tabs/FacePanel.java
diff --git a/src/com/mrcrayfish/modelcreator/panels/tabs/RotationPanel.java b/src/main/java/com/mrcrayfish/modelcreator/panels/tabs/RotationPanel.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/panels/tabs/RotationPanel.java
rename to src/main/java/com/mrcrayfish/modelcreator/panels/tabs/RotationPanel.java
diff --git a/src/com/mrcrayfish/modelcreator/screenshot/PendingScreenshot.java b/src/main/java/com/mrcrayfish/modelcreator/screenshot/PendingScreenshot.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/screenshot/PendingScreenshot.java
rename to src/main/java/com/mrcrayfish/modelcreator/screenshot/PendingScreenshot.java
diff --git a/src/com/mrcrayfish/modelcreator/screenshot/Screenshot.java b/src/main/java/com/mrcrayfish/modelcreator/screenshot/Screenshot.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/screenshot/Screenshot.java
rename to src/main/java/com/mrcrayfish/modelcreator/screenshot/Screenshot.java
diff --git a/src/com/mrcrayfish/modelcreator/screenshot/ScreenshotCallback.java b/src/main/java/com/mrcrayfish/modelcreator/screenshot/ScreenshotCallback.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/screenshot/ScreenshotCallback.java
rename to src/main/java/com/mrcrayfish/modelcreator/screenshot/ScreenshotCallback.java
diff --git a/src/com/mrcrayfish/modelcreator/screenshot/Uploader.java b/src/main/java/com/mrcrayfish/modelcreator/screenshot/Uploader.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/screenshot/Uploader.java
rename to src/main/java/com/mrcrayfish/modelcreator/screenshot/Uploader.java
diff --git a/src/com/mrcrayfish/modelcreator/sidebar/Sidebar.java b/src/main/java/com/mrcrayfish/modelcreator/sidebar/Sidebar.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/sidebar/Sidebar.java
rename to src/main/java/com/mrcrayfish/modelcreator/sidebar/Sidebar.java
diff --git a/src/com/mrcrayfish/modelcreator/sidebar/UVSidebar.java b/src/main/java/com/mrcrayfish/modelcreator/sidebar/UVSidebar.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/sidebar/UVSidebar.java
rename to src/main/java/com/mrcrayfish/modelcreator/sidebar/UVSidebar.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/ClipboardTexture.java b/src/main/java/com/mrcrayfish/modelcreator/texture/ClipboardTexture.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/ClipboardTexture.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/ClipboardTexture.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/PendingTexture.java b/src/main/java/com/mrcrayfish/modelcreator/texture/PendingTexture.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/PendingTexture.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/PendingTexture.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureAnimation.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureAnimation.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureAnimation.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureAnimation.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureCallback.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureCallback.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureCallback.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureCallback.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureCellRenderer.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureCellRenderer.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureCellRenderer.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureCellRenderer.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureEntry.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureEntry.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureEntry.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureEntry.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureManager.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureManager.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureManager.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureManager.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureMeta.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureMeta.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureMeta.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureMeta.java
diff --git a/src/com/mrcrayfish/modelcreator/texture/TextureProperties.java b/src/main/java/com/mrcrayfish/modelcreator/texture/TextureProperties.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/texture/TextureProperties.java
rename to src/main/java/com/mrcrayfish/modelcreator/texture/TextureProperties.java
diff --git a/src/com/mrcrayfish/modelcreator/util/Circle.java b/src/main/java/com/mrcrayfish/modelcreator/util/Circle.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/Circle.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/Circle.java
diff --git a/src/com/mrcrayfish/modelcreator/util/Clipboard.java b/src/main/java/com/mrcrayfish/modelcreator/util/Clipboard.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/Clipboard.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/Clipboard.java
diff --git a/src/com/mrcrayfish/modelcreator/util/ComponentUtil.java b/src/main/java/com/mrcrayfish/modelcreator/util/ComponentUtil.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/ComponentUtil.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/ComponentUtil.java
diff --git a/src/com/mrcrayfish/modelcreator/util/FaceDimension.java b/src/main/java/com/mrcrayfish/modelcreator/util/FaceDimension.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/FaceDimension.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/FaceDimension.java
diff --git a/src/com/mrcrayfish/modelcreator/util/FontManager.java b/src/main/java/com/mrcrayfish/modelcreator/util/FontManager.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/FontManager.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/FontManager.java
diff --git a/src/com/mrcrayfish/modelcreator/util/Parser.java b/src/main/java/com/mrcrayfish/modelcreator/util/Parser.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/Parser.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/Parser.java
diff --git a/src/com/mrcrayfish/modelcreator/util/ResourceUtil b/src/main/java/com/mrcrayfish/modelcreator/util/ResourceUtil
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/ResourceUtil
rename to src/main/java/com/mrcrayfish/modelcreator/util/ResourceUtil
diff --git a/src/main/java/com/mrcrayfish/modelcreator/util/SharedLibraryLoader.java b/src/main/java/com/mrcrayfish/modelcreator/util/SharedLibraryLoader.java
new file mode 100644
index 0000000..43321d7
--- /dev/null
+++ b/src/main/java/com/mrcrayfish/modelcreator/util/SharedLibraryLoader.java
@@ -0,0 +1,376 @@
+package com.mrcrayfish.modelcreator.util;
+
+/*******************************************************************************
+ * Copyright 2011 See AUTHORS file.
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.util.UUID;
+import java.util.zip.CRC32;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+/**
+ * Loads shared libraries from JAR files. Call {@link SharedLibraryLoader#load()
+ * to load the required LWJGL 3 native shared libraries.
+ *
+ * @author mzechner
+ * @author Nathan Sweet
+ */
+public class SharedLibraryLoader
+{
+
+ public static final boolean isWindows = System.getProperty("os.name").contains("Windows");
+ public static final boolean isLinux = System.getProperty("os.name").contains("Linux");
+ public static final boolean isMac = System.getProperty("os.name").contains("Mac");
+ public static final boolean is64Bit = System.getProperty("os.arch").equals("amd64")
+ || System.getProperty("os.arch").equals("x86_64");
+
+ private static final boolean usingJws;
+
+ static
+ {
+ if (!isWindows && !isLinux && !isMac)
+ {
+ throw new UnsupportedOperationException("Unknown platform: " + System.getProperty("os.name"));
+ }
+
+ // Don't extract natives if using JWS.
+ boolean failed = false;
+ try
+ {
+ Method method = Class.forName("javax.jnlp.ServiceManager").getDeclaredMethod("lookup",
+ new Class[] { String.class });
+ method.invoke(null, "javax.jnlp.PersistenceService");
+ }
+ catch (Throwable ex)
+ {
+ failed = true;
+ }
+ usingJws = !failed;
+ }
+
+ /**
+ * Extracts the LWJGL native libraries from the classpath and sets the
+ * "org.lwjgl.librarypath" system property.
+ */
+ public static synchronized void load(boolean disableOpenAL)
+ {
+ if (usingJws)
+ return;
+
+ SharedLibraryLoader loader = new SharedLibraryLoader();
+ File nativesDir = null;
+ try
+ {
+ if (SharedLibraryLoader.isWindows)
+ {
+
+ nativesDir = loader.extractFile(SharedLibraryLoader.is64Bit ? "lwjgl64.dll" : "lwjgl.dll", null)
+ .getParentFile();
+
+ if (!disableOpenAL)
+ loader.extractFile(SharedLibraryLoader.is64Bit ? "OpenAL64.dll" : "OpenAL32.dll",
+ nativesDir.getName());
+
+ }
+ else if (SharedLibraryLoader.isMac)
+ {
+
+ nativesDir = loader.extractFile("liblwjgl.dylib", null).getParentFile();
+
+ if (!disableOpenAL)
+ loader.extractFile("openal.dylib", nativesDir.getName());
+
+ }
+ else if (SharedLibraryLoader.isLinux)
+ {
+
+ nativesDir = loader.extractFile(SharedLibraryLoader.is64Bit ? "liblwjgl64.so" : "liblwjgl.so", null)
+ .getParentFile();
+
+ if (!disableOpenAL)
+ loader.extractFile(SharedLibraryLoader.is64Bit ? "libopenal64.so" : "libopenal.so",
+ nativesDir.getName());
+
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Unknown platform: " + System.getProperty("os.name"));
+ }
+ }
+ catch (Throwable ex)
+ {
+ throw new Error("Unable to extract LWJGL natives.", ex);
+ }
+
+ System.setProperty("org.lwjgl.librarypath", nativesDir.getAbsolutePath());
+ }
+
+ private String nativesJar;
+
+ private SharedLibraryLoader()
+ {
+ }
+
+ /** Returns a CRC of the remaining bytes in the stream. */
+ private String crc(InputStream input)
+ {
+ if (input == null)
+ throw new IllegalArgumentException("input cannot be null.");
+ CRC32 crc = new CRC32();
+ byte[] buffer = new byte[4096];
+ try
+ {
+ while (true)
+ {
+ int length = input.read(buffer);
+ if (length == -1)
+ break;
+ crc.update(buffer, 0, length);
+ }
+ } catch (Exception ex)
+ {
+ if (input != null)
+ {
+ try
+ {
+ input.close();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ }
+ return Long.toString(crc.getValue(), 16);
+ }
+
+ private InputStream readFile(String path)
+ {
+ if (nativesJar == null)
+ {
+ InputStream input = SharedLibraryLoader.class.getResourceAsStream("/" + path);
+ if (input == null)
+ throw new RuntimeException("Unable to read file for extraction: " + path);
+ return input;
+ }
+
+ // Read from JAR.
+ ZipFile file = null;
+ try
+ {
+ file = new ZipFile(nativesJar);
+ ZipEntry entry = file.getEntry(path);
+ if (entry == null)
+ throw new RuntimeException("Couldn't find '" + path + "' in JAR: " + nativesJar);
+ return file.getInputStream(entry);
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException("Error reading '" + path + "' in JAR: " + nativesJar, ex);
+ }
+ finally
+ {
+ if (file != null)
+ {
+ try
+ {
+ file.close();
+ }
+ catch (IOException e)
+ {
+ }
+ }
+ }
+ }
+
+ /**
+ * Extracts the specified file into the temp directory if it does not already
+ * exist or the CRC does not match. If file extraction fails and the file exists
+ * at java.library.path, that file is returned.
+ *
+ * @param sourcePath The file to extract from the classpath or JAR.
+ * @param dirName The name of the subdirectory where the file will be
+ * extracted. If null, the file's CRC will be used.
+ * @return The extracted file.
+ */
+ private File extractFile(String sourcePath, String dirName) throws IOException
+ {
+ try
+ {
+ String sourceCrc = crc(readFile(sourcePath));
+ if (dirName == null)
+ dirName = sourceCrc;
+
+ File extractedFile = getExtractedFile(dirName, new File(sourcePath).getName());
+ return extractFile(sourcePath, sourceCrc, extractedFile);
+ }
+ catch (RuntimeException ex)
+ {
+ // Fallback to file at java.library.path location, eg for applets.
+ File file = new File(System.getProperty("java.library.path"), sourcePath);
+ if (file.exists())
+ return file;
+ throw ex;
+ }
+ }
+
+ /**
+ * Returns a path to a file that can be written. Tries multiple locations and
+ * verifies writing succeeds.
+ */
+ private File getExtractedFile(String dirName, String fileName)
+ {
+ // Temp directory with username in path.
+ File idealFile = new File(
+ System.getProperty("java.io.tmpdir") + "/lwjgl" + System.getProperty("user.name") + "/" + dirName,
+ fileName);
+ if (canWrite(idealFile))
+ return idealFile;
+
+ // System provided temp directory.
+ try
+ {
+ File file = File.createTempFile(dirName, null);
+ if (file.delete())
+ {
+ file = new File(file, fileName);
+ if (canWrite(file))
+ return file;
+ }
+ }
+ catch (IOException ignored)
+ {
+ }
+
+ // User home.
+ File file = new File(System.getProperty("user.home") + "/.lwjgl/" + dirName, fileName);
+ if (canWrite(file))
+ return file;
+
+ // Relative directory.
+ file = new File(".temp/" + dirName, fileName);
+ if (canWrite(file))
+ return file;
+
+ return idealFile; // Will likely fail, but we did our best.
+ }
+
+ /**
+ * Returns true if the parent directories of the file can be created and the
+ * file can be written.
+ */
+ private boolean canWrite(File file)
+ {
+ File parent = file.getParentFile();
+ File testFile;
+ if (file.exists())
+ {
+ if (!file.canWrite() || !canExecute(file))
+ return false;
+ // Don't overwrite existing file just to check if we can write to directory.
+ testFile = new File(parent, UUID.randomUUID().toString());
+ }
+ else
+ {
+ parent.mkdirs();
+ if (!parent.isDirectory())
+ return false;
+ testFile = file;
+ }
+ try
+ {
+ new FileOutputStream(testFile).close();
+ if (!canExecute(testFile))
+ return false;
+ return true;
+ }
+ catch (Throwable ex)
+ {
+ return false;
+ }
+ finally
+ {
+ testFile.delete();
+ }
+ }
+
+ private boolean canExecute(File file)
+ {
+ try
+ {
+ if (file.canExecute())
+ return true;
+
+ file.setExecutable(true, false);
+ return file.canExecute();
+ }
+ catch (Exception ignored)
+ {
+ }
+
+ return false;
+ }
+
+ private File extractFile(String sourcePath, String sourceCrc, File extractedFile) throws IOException
+ {
+ String extractedCrc = null;
+ if (extractedFile.exists())
+ {
+ try
+ {
+ extractedCrc = crc(new FileInputStream(extractedFile));
+ }
+ catch (FileNotFoundException ignored)
+ {
+ }
+ }
+
+ // If file doesn't exist or the CRC doesn't match, extract it to the temp dir.
+ if (extractedCrc == null || !extractedCrc.equals(sourceCrc))
+ {
+ try
+ {
+ InputStream input = readFile(sourcePath);
+ extractedFile.getParentFile().mkdirs();
+ FileOutputStream output = new FileOutputStream(extractedFile);
+ byte[] buffer = new byte[4096];
+ while (true)
+ {
+ int length = input.read(buffer);
+ if (length == -1)
+ break;
+ output.write(buffer, 0, length);
+ }
+ input.close();
+ output.close();
+ }
+ catch (IOException ex)
+ {
+ throw new RuntimeException(
+ "Error extracting file: " + sourcePath + "\nTo: " + extractedFile.getAbsolutePath(), ex);
+ }
+ }
+
+ return extractedFile;
+ }
+
+}
diff --git a/src/com/mrcrayfish/modelcreator/util/StreamUtils.java b/src/main/java/com/mrcrayfish/modelcreator/util/StreamUtils.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/StreamUtils.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/StreamUtils.java
diff --git a/src/com/mrcrayfish/modelcreator/util/Util.java b/src/main/java/com/mrcrayfish/modelcreator/util/Util.java
similarity index 100%
rename from src/com/mrcrayfish/modelcreator/util/Util.java
rename to src/main/java/com/mrcrayfish/modelcreator/util/Util.java
diff --git a/res/bebas_neue.otf b/src/main/resources/bebas_neue.otf
similarity index 100%
rename from res/bebas_neue.otf
rename to src/main/resources/bebas_neue.otf
diff --git a/res/duplicate.png b/src/main/resources/duplicate.png
similarity index 100%
rename from res/duplicate.png
rename to src/main/resources/duplicate.png
diff --git a/res/duplicate_rollover.png b/src/main/resources/duplicate_rollover.png
similarity index 100%
rename from res/duplicate_rollover.png
rename to src/main/resources/duplicate_rollover.png
diff --git a/res/icons/add.png b/src/main/resources/icons/add.png
similarity index 100%
rename from res/icons/add.png
rename to src/main/resources/icons/add.png
diff --git a/res/icons/add_rollover.png b/src/main/resources/icons/add_rollover.png
similarity index 100%
rename from res/icons/add_rollover.png
rename to src/main/resources/icons/add_rollover.png
diff --git a/res/icons/arrow_down.png b/src/main/resources/icons/arrow_down.png
similarity index 100%
rename from res/icons/arrow_down.png
rename to src/main/resources/icons/arrow_down.png
diff --git a/res/icons/arrow_up.png b/src/main/resources/icons/arrow_up.png
similarity index 100%
rename from res/icons/arrow_up.png
rename to src/main/resources/icons/arrow_up.png
diff --git a/res/icons/bin.png b/src/main/resources/icons/bin.png
similarity index 100%
rename from res/icons/bin.png
rename to src/main/resources/icons/bin.png
diff --git a/res/icons/bin_open.png b/src/main/resources/icons/bin_open.png
similarity index 100%
rename from res/icons/bin_open.png
rename to src/main/resources/icons/bin_open.png
diff --git a/res/icons/box_off.png b/src/main/resources/icons/box_off.png
similarity index 100%
rename from res/icons/box_off.png
rename to src/main/resources/icons/box_off.png
diff --git a/res/icons/box_on.png b/src/main/resources/icons/box_on.png
similarity index 100%
rename from res/icons/box_on.png
rename to src/main/resources/icons/box_on.png
diff --git a/res/icons/cancel.png b/src/main/resources/icons/cancel.png
similarity index 100%
rename from res/icons/cancel.png
rename to src/main/resources/icons/cancel.png
diff --git a/res/icons/clear.png b/src/main/resources/icons/clear.png
similarity index 100%
rename from res/icons/clear.png
rename to src/main/resources/icons/clear.png
diff --git a/res/icons/clipboard.png b/src/main/resources/icons/clipboard.png
similarity index 100%
rename from res/icons/clipboard.png
rename to src/main/resources/icons/clipboard.png
diff --git a/res/icons/coin.png b/src/main/resources/icons/coin.png
similarity index 100%
rename from res/icons/coin.png
rename to src/main/resources/icons/coin.png
diff --git a/res/icons/copy.png b/src/main/resources/icons/copy.png
similarity index 100%
rename from res/icons/copy.png
rename to src/main/resources/icons/copy.png
diff --git a/res/icons/cube.png b/src/main/resources/icons/cube.png
similarity index 100%
rename from res/icons/cube.png
rename to src/main/resources/icons/cube.png
diff --git a/res/icons/disk.png b/src/main/resources/icons/disk.png
similarity index 100%
rename from res/icons/disk.png
rename to src/main/resources/icons/disk.png
diff --git a/res/icons/exit.png b/src/main/resources/icons/exit.png
similarity index 100%
rename from res/icons/exit.png
rename to src/main/resources/icons/exit.png
diff --git a/res/icons/export.png b/src/main/resources/icons/export.png
similarity index 100%
rename from res/icons/export.png
rename to src/main/resources/icons/export.png
diff --git a/res/icons/facebook.png b/src/main/resources/icons/facebook.png
similarity index 100%
rename from res/icons/facebook.png
rename to src/main/resources/icons/facebook.png
diff --git a/res/icons/github.png b/src/main/resources/icons/github.png
similarity index 100%
rename from res/icons/github.png
rename to src/main/resources/icons/github.png
diff --git a/res/icons/imgur.png b/src/main/resources/icons/imgur.png
similarity index 100%
rename from res/icons/imgur.png
rename to src/main/resources/icons/imgur.png
diff --git a/res/icons/import.png b/src/main/resources/icons/import.png
similarity index 100%
rename from res/icons/import.png
rename to src/main/resources/icons/import.png
diff --git a/res/icons/load.png b/src/main/resources/icons/load.png
similarity index 100%
rename from res/icons/load.png
rename to src/main/resources/icons/load.png
diff --git a/res/icons/minecraft_forum.png b/src/main/resources/icons/minecraft_forum.png
similarity index 100%
rename from res/icons/minecraft_forum.png
rename to src/main/resources/icons/minecraft_forum.png
diff --git a/res/icons/model_cauldron.png b/src/main/resources/icons/model_cauldron.png
similarity index 100%
rename from res/icons/model_cauldron.png
rename to src/main/resources/icons/model_cauldron.png
diff --git a/res/icons/model_chair.png b/src/main/resources/icons/model_chair.png
similarity index 100%
rename from res/icons/model_chair.png
rename to src/main/resources/icons/model_chair.png
diff --git a/res/icons/new.png b/src/main/resources/icons/new.png
similarity index 100%
rename from res/icons/new.png
rename to src/main/resources/icons/new.png
diff --git a/res/icons/paste.png b/src/main/resources/icons/paste.png
similarity index 100%
rename from res/icons/paste.png
rename to src/main/resources/icons/paste.png
diff --git a/res/icons/patreon.png b/src/main/resources/icons/patreon.png
similarity index 100%
rename from res/icons/patreon.png
rename to src/main/resources/icons/patreon.png
diff --git a/res/icons/planet_minecraft.png b/src/main/resources/icons/planet_minecraft.png
similarity index 100%
rename from res/icons/planet_minecraft.png
rename to src/main/resources/icons/planet_minecraft.png
diff --git a/res/icons/reddit.png b/src/main/resources/icons/reddit.png
similarity index 100%
rename from res/icons/reddit.png
rename to src/main/resources/icons/reddit.png
diff --git a/res/icons/set/icon_128x.png b/src/main/resources/icons/set/icon_128x.png
similarity index 100%
rename from res/icons/set/icon_128x.png
rename to src/main/resources/icons/set/icon_128x.png
diff --git a/res/icons/set/icon_16x.png b/src/main/resources/icons/set/icon_16x.png
similarity index 100%
rename from res/icons/set/icon_16x.png
rename to src/main/resources/icons/set/icon_16x.png
diff --git a/res/icons/set/icon_32x.png b/src/main/resources/icons/set/icon_32x.png
similarity index 100%
rename from res/icons/set/icon_32x.png
rename to src/main/resources/icons/set/icon_32x.png
diff --git a/res/icons/set/icon_64x.png b/src/main/resources/icons/set/icon_64x.png
similarity index 100%
rename from res/icons/set/icon_64x.png
rename to src/main/resources/icons/set/icon_64x.png
diff --git a/res/icons/texture.png b/src/main/resources/icons/texture.png
similarity index 100%
rename from res/icons/texture.png
rename to src/main/resources/icons/texture.png
diff --git a/res/icons/transparent.png b/src/main/resources/icons/transparent.png
similarity index 100%
rename from res/icons/transparent.png
rename to src/main/resources/icons/transparent.png
diff --git a/res/icons/twitter.png b/src/main/resources/icons/twitter.png
similarity index 100%
rename from res/icons/twitter.png
rename to src/main/resources/icons/twitter.png
diff --git a/res/models/cauldron.model b/src/main/resources/models/cauldron.model
similarity index 100%
rename from res/models/cauldron.model
rename to src/main/resources/models/cauldron.model
diff --git a/res/models/modern_chair.model b/src/main/resources/models/modern_chair.model
similarity index 100%
rename from res/models/modern_chair.model
rename to src/main/resources/models/modern_chair.model
diff --git a/res/remove.png b/src/main/resources/remove.png
similarity index 100%
rename from res/remove.png
rename to src/main/resources/remove.png
diff --git a/res/remove_rollover.png b/src/main/resources/remove_rollover.png
similarity index 100%
rename from res/remove_rollover.png
rename to src/main/resources/remove_rollover.png
diff --git a/res/sticker.png b/src/main/resources/sticker.png
similarity index 100%
rename from res/sticker.png
rename to src/main/resources/sticker.png